[19.0][MIG] product_set: Migration to 19.0#2263
Conversation
[UPD] Update product_set.pot [UPD] README.rst Translated using Weblate (Spanish) Currently translated at 100.0% (23 of 23 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/es/ [UPD] README.rst Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (23 of 23 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/pt_BR/ 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_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/ Translated using Weblate (Italian) Currently translated at 100.0% (23 of 23 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/it/
[UPD] Update product_set.pot [BOT] post-merge updates 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_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/ Translated using Weblate (Spanish) Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/es/ Translated using Weblate (Italian) Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/it/
… in the module sale_product_set. The reason to move this logic is that there are other modules that extend product_set as for example stock_product_set but at the same time make use of the transient model to define a wizard. For this reason it is better to have the logic available in this base module and avoid duplicating code or inheriting from sale_product_set and what this implies in their respective dependencies with the only need to extend the transient model. In addition, the transient model is renamed to make it clearer to identify that it is this type of model. TT48100 [UPD] Update product_set.pot [BOT] post-merge updates 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_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/ Translated using Weblate (Italian) Currently translated at 100.0% (32 of 32 strings) Translation: product-attribute-16.0/product-attribute-16.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_set/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/
Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/de/
Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/es/
Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/it/
Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/sv/
Currently translated at 93.9% (31 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/zh_TW/
Currently translated at 100.0% (33 of 33 strings) Translation: product-attribute-17.0/product-attribute-17.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_set/it/
Currently translated at 100.0% (36 of 36 strings) Translation: product-attribute-18.0/product-attribute-18.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_set/it/
In v18 the archive/unarchive action is visible only if the field is not readonly hence we cannot use a related field anymore.
* ease filtering on set and set line views * allow viewing and toggling archived lines on set form
Currently translated at 100.0% (37 of 37 strings) Translation: product-attribute-18.0/product-attribute-18.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_set/it/
Currently translated at 18.9% (7 of 37 strings) Translation: product-attribute-18.0/product-attribute-18.0-product_set Translate-URL: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_set/tr/
With the changes introduced in odoo/odoo@de056cc#diff-b37c7fd5520c97a29ddc59495779e7be61a66e15e85603928e27b3affb9dc31f, an error was occurring because the change validation on the model was being performed before tearDownClass was executed. Therefore, it has been modified so that the mock changes are applied in each test and cleaned up after each test. This way, the error will no longer appear and the test will run normally.
c9fd859 to
5813d5f
Compare
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
Code review LGTM!
5813d5f to
76d5f2b
Compare
76d5f2b to
648f91a
Compare
|
@pedrobaeza could you have a look and merge? |
|
/ocabot migration product_set |
|
/ocabot migration product_set |
| "res.company", related="product_set_id.company_id", store=True, readonly=True | ||
| ) | ||
| name = fields.Char() | ||
| product_packaging_id = fields.Many2one( |
There was a problem hiding this comment.
Why removing the package part?
There was a problem hiding this comment.
Because there is no product.packaging anymore.
(but take your time if you want to have a closer look into this change)
There was a problem hiding this comment.
OK, then you would need to add migration scripts to get uom_id filled according OpenUpgrade changes. And what about testing this new field?
There was a problem hiding this comment.
Could you have a look at the migration script. I currently have no setup how to test it.
9a78e9c to
ccfe644
Compare
|
This PR has the |
| inverse="_inverse_product_packaging_qty", | ||
| digits="Product Unit of Measure", | ||
| uom_id = fields.Many2one( | ||
| "uom.uom", |
There was a problem hiding this comment.
Now looking better at the migration script, this should be product.uom not uom.uom.
There was a problem hiding this comment.
should we rename the field from uom_id to product_uom_id?
There was a problem hiding this comment.
If it's the usual nomenclature for this relation (and it seems it is), yes.
| cr.execute( | ||
| """ | ||
| UPDATE product_set_line psl | ||
| SET uom_id = pt.uom_id |
There was a problem hiding this comment.
As the product_uom is the same as the product_packaging one, you only need to copy its value.
ccfe644 to
bd8886c
Compare
bd8886c to
2c3e26d
Compare
|
@MohamedOsman7 @BhaveshHeliconia could you retest? Due to pedros valid feedback, there has been some changes in the implementation. |
2c3e26d to
aaa1461
Compare
|
@CRogos I am encountering now the same issue as here: OCA/sale-workflow#4283 (comment)
|

supersede: #2098
includes: #2201
odoo_test_helperdependency —tests/models.pydeletedproduct.set.wizardfromAbstractModeltoTransientModeltest_product_set.py— replace all demo dataenv.ref()with programmatic record creation (includingbase.res_partner_1)test_product_set_line.py— UoM refs retained (module data, always available)test_product_set_wizard.py— fully programmatic, no demo refs@Saran440, @rousseldenis. @mmrondon Could you please review?
There were a few (breaking) changes necessary. Could you have a close look on the changes and test.