Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] product_secondary_unit: use existing value #1556

Conversation

alexey-pelykh
Copy link
Contributor

The rec._origin[rec._secondary_unit_fields["qty_field"]] will still be used via https://github.com/odoo/odoo/blob/f9054640f8640d4449df5f7ea5fb7b4e8de4d89a/odoo/fields.py#L1197-L1201:

            elif self.store and record._origin and not (self.compute and self.readonly):
                # new record with origin: fetch from origin
                value = self.convert_to_cache(record._origin[self.name], record, validate=False)
                env.cache.set(record, self, value)

@OCA-git-bot
Copy link
Contributor

Hi @sergio-teruel,
some modules you are maintaining are being modified, check this out!

@alexey-pelykh
Copy link
Contributor Author

Hi @sergio-teruel, please take a look and share your vision on this - it needs specifically you.

@alexey-pelykh
Copy link
Contributor Author

@OCA/product-maintainers anyone?

@alexey-pelykh
Copy link
Contributor Author

@pedrobaeza 🙏 I require help with someone looking into this

@sergio-teruel
Copy link
Contributor

Sorry @alexey-pelykh Now I do not remenber the reasson of that... @pedrobaeza Do you remember it?

@pedrobaeza pedrobaeza added this to the 16.0 milestone Mar 25, 2024
@pedrobaeza
Copy link
Member

I think this may be related to the record containing NewId references that don't fetch the value correctly in defaults. The commit introducing it was: 5a71b68

@alexey-pelykh
Copy link
Contributor Author

Hm, yet the tests aren't failing so either they aren't covering that or there's nothing to fix now?

@pedrobaeza
Copy link
Member

Maybe the problem doesn't exist in v16. Anyway, why do you want to change it?

@alexey-pelykh
Copy link
Contributor Author

Because that's what is causing OCA/sale-workflow@589e363 to not work - I did a lot of testing if the OCA/sale-workflow@ad19530 as you can see :)

@alexey-pelykh
Copy link
Contributor Author

And what's more important - the current code is already there in v16 just as a branch that's going to get executed in .new() cases anyhow.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK then, let's fix it and see if there's any side effect:

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-1556-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ea3b97c into OCA:16.0 Mar 26, 2024
9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f1c209b. Thanks a lot for contributing to OCA. ❤️

@alexey-pelykh alexey-pelykh deleted the 16.0-fix-product_secondary_unit-qty_field_reset branch March 26, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants