Skip to content

Conversation

@bealdav
Copy link
Member

@bealdav bealdav commented Mar 10, 2025

No description provided.

@bealdav bealdav force-pushed the 18.0-mig-product_price_category branch from e9feec7 to e86a5ed Compare March 10, 2025 15:58
@bealdav bealdav marked this pull request as draft March 11, 2025 14:33
@bealdav bealdav closed this Apr 10, 2025
@bealdav bealdav reopened this May 21, 2025
@florian-dacosta florian-dacosta force-pushed the 18.0-mig-product_price_category branch from 7e05e71 to 59bf845 Compare May 21, 2025 14:45
@bealdav bealdav marked this pull request as ready for review May 22, 2025 07:24
@bealdav
Copy link
Member Author

bealdav commented May 22, 2025

Just tested, fix done by @florian-dacosta works nicely

I approve it

@florian-dacosta
Copy link
Contributor

FYI as last contributor / reviewers, it may be of your interest
@sbejaoui
@rousseldenis
@marielejeune
@flotho
@JordiMForgeFlow

@rousseldenis
Copy link
Contributor

/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(
Copy link
Contributor

Choose a reason for hiding this comment

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

@bealdav No need of migration script for this ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hum, true, it is for a new project, and I did not even think about it...
I'll provide one

Copy link
Contributor

Choose a reason for hiding this comment

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

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):
Copy link
Contributor

Choose a reason for hiding this comment

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

api.depends should be maintained from the original method

Copy link
Contributor

Choose a reason for hiding this comment

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

I did the change.
I hardly believed it was not necessary although it does not hurt.

Copy link
Contributor

Choose a reason for hiding this comment

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

@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 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Image Image

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 ?

grindtildeath and others added 12 commits December 23, 2025 15:32
[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) <[email protected]>
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/
@bealdav bealdav force-pushed the 18.0-mig-product_price_category branch from 355c4e7 to 812cb68 Compare December 23, 2025 14:33
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.