[18.0][MIG] product_price_category#3618
Conversation
e9feec7 to
e86a5ed
Compare
7e05e71 to
59bf845
Compare
|
Just tested, fix done by @florian-dacosta works nicely I approve it |
|
FYI as last contributor / reviewers, it may be of your interest |
|
/ocabot migration product_price_category |
| selection_add=[("2b_product_price_category", "Price Category")], | ||
| ondelete={"2b_product_price_category": "set default"}, | ||
| ) | ||
| display_applied_on = fields.Selection( |
There was a problem hiding this comment.
@bealdav No need of migration script for this ?
There was a problem hiding this comment.
Hum, true, it is for a new project, and I did not even think about it...
I'll provide one
There was a problem hiding this comment.
Thanks for your vigilance @rousseldenis
I've added a migration script.I could not test it on a real migrated database though, but I did test that it runs without crashing
|
|
||
| def _compute_name_and_price(self): | ||
| result = super()._compute_name_and_price() | ||
| def _compute_name(self): |
There was a problem hiding this comment.
api.depends should be maintained from the original method
There was a problem hiding this comment.
I did the change.
I hardly believed it was not necessary although it does not hurt.
There was a problem hiding this comment.
@JordiMForgeFlow For depends(), Odoo will append new dependencies in further modules that decorates same function. That's why you don't need to put original fields in it. @florian-dacosta This is why it worked without. This is not necessary.
I'm wondering if price_category_id should not be in depends ?
There was a problem hiding this comment.
I've just rebased this old PR.
@rousseldenis , concerning if price_category_id should trigger this method, on my side I think not.
I've tested here
On save computed name is refreshed when you change the price category
It seems to me we have answered all questions.
A merge can be done ?
There was a problem hiding this comment.
Please @rousseldenis are these screens anwser to your questions ?
Could you merge if it's ok ?
There was a problem hiding this comment.
@florian-dacosta can you remove the useless depends field added
I confirm that it's useless and also it propagate a wrong believe that you need to add all the depends
The code in V18 here : https://github.com/odoo/odoo/blob/dc9dc90dd99f1f7dfb4a781ad2bec7378548d95b/odoo/fields.py#L585 will aggregate the depends. It's the case since version 13 at least and maybe even before (but I do not remember)
Regarding the fact of add "price_category_id" it's needed. The rule is simple if the result of computation of the field depend on "price_category_id", you have to add it.
Right now the onchange is broken (the name only change when you save it). I am pretty sure that if you do an import (an update) it will not update the name if there is not depends on "price_category_id"
So please add it
There was a problem hiding this comment.
@rousseldenis we finally found you're right about depends on price_category_id.
e0a4997 to
355c4e7
Compare
[UPD] Update product_price_category.pot [ADD] icon.png
Currently translated at 73.3% (11 of 15 strings) Translation: sale-workflow-10.0/sale-workflow-10.0-product_price_category Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-product_price_category/it/
Currently translated at 100.0% (15 of 15 strings) Translation: sale-workflow-10.0/sale-workflow-10.0-product_price_category Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-product_price_category/ca/
Currently translated at 100.0% (15 of 15 strings) Translation: sale-workflow-10.0/sale-workflow-10.0-product_price_category Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-product_price_category/es/ [UPD] Switch to Github Actions / Copier update
[FIX] - fix ui Co-authored-by: Laurent Mignon (ACSONE) <laurent.mignon@acsone.eu>
Prior to this commit `name` was not correctly computed when `applied_on` value is `2b_product_price_category`.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-16.0/sale-workflow-16.0-product_price_category Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-product_price_category/
355c4e7 to
812cb68
Compare
b3753ee to
3d6aa3e
Compare
There was a problem hiding this comment.
Functional test + new review
All seems good, thanks @bealdav
|
|
||
| def _compute_name_and_price(self): | ||
| result = super()._compute_name_and_price() | ||
| def _compute_name(self): |
|
What a great day to merge this nice PR. Let's do it! |
|
/ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
@sebastienbeau your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-3618-by-sebastienbeau-bump-patch. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
|
This PR has the |
|
Congratulations, your PR was merged at 5155df7. Thanks a lot for contributing to OCA. ❤️ |
No description provided.