-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
[18.0][MIG] product_state: Migration to 18.0 #1795
base: 18.0
Are you sure you want to change the base?
Conversation
* [10.0] re-introduce state field on product * [ADD] add setup for product state
I've added both field content and help to ease understand the possibilities (draft and sellable have different meaning than In Development and Normal
Currently translated at 100.0% (6 of 6 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_state/pt/
Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/de/
Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/fr/ Translated using Weblate (French) Currently translated at 55.2% (16 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/fr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/ [MIG] product_state: Migration to 14.0
Application: False
Currently translated at 93.1% (27 of 29 strings) Translation: product-attribute-14.0/product-attribute-14.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_state/nl/
As fields are on the form view, a write is called with them. This is an unwanted behaviour.
* Fix bug when inverting non-exist new state * Show default and active fields in product state form * Refactor inverse state to use with variant state
Co-authored-by: Iryna Vyshnevska <[email protected]>
Translated using Weblate (Catalan) Currently translated at 93.7% (30 of 32 strings) Translation: product-attribute-15.0/product-attribute-15.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_state/ca/
[UPD] Update product_state.pot [UPD] README.rst
Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/it/
Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/it/ Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/it/ Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/es/ [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/ Translated using Weblate (Spanish) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/es/ Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/it/ Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_state/it/
The product state shouldn't be copied when copying the product so this adds copy=False to the state field. [IMP] product_state: Add test for copy [FIX] Test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
/ocabot migration product_state |
@@ -55,10 +55,10 @@ def _set_product_state_id(self, record): | |||
ProductState = record.env["product.state"] | |||
product_state = ProductState.search([("code", "=", record.state)], limit=1) | |||
if record.state and not product_state: | |||
msg = _("The product state code %s could not be found.") | |||
msg = self.env._("The product state code %s could not be found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the translation function arguments instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the new way to translate 😉
https://www.odoo.com/documentation/18.0/developer/howtos/translations.html#explicit-exports
product_state/__manifest__.py
Outdated
"license": "AGPL-3", | ||
"depends": ["product", "sale"], | ||
"depends": ["product", "sale", "stock"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding this new dependency ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sounds wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review, adding this new dependency because the ir.model.access.csv
file references the stock.group_stock_manager
group.
This access was added in 14.0 by aleuffre (#1124)
I have also asked him why the dependency on the stock module was not added (#1124 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reference. Although that sounds wrong :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@natuan9 I'd remove it and fix it w/ a glue module. Then they'll have to fix the module on v14 by backporting the work from v18. See my proposal on the PR on v14.
@rousseldenis WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your proposal, and I will implement it in a fix commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I create a new PR for adding a glue module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, add a separate commit here to remove dependency (to be backported) and entry in security.
Then, add a new PR to add product_state_stock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm not sure if that's a good name... we already have https://github.com/OCA/product-attribute/tree/14.0/product_stock_state 😵
What about product_state_stock_security
or product_state_stock_base
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- a seperate commit
- [18.0][ADD] product_state_stock_base #1819
- [18.0][ADD] product_state_sale #1818
They're ready for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependency to fix
f813f33
to
3ae6a13
Compare
No description provided.