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

[18.0][MIG] product_pricelist_revision: Migration to 18.0 #1791

Open
wants to merge 25 commits into
base: 18.0
Choose a base branch
from

Conversation

BhaveshHeliconia
Copy link

No description provided.

@BhaveshHeliconia BhaveshHeliconia mentioned this pull request Dec 17, 2024
44 tasks
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_pricelist_revision branch from 1245f4d to a1f6631 Compare December 27, 2024 10:28
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_pricelist_revision branch from a1f6631 to 947160c Compare January 8, 2025 11:54
@rousseldenis
Copy link
Contributor

/ocabot migration product_pricelist_revision

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jan 8, 2025
sergio-teruel and others added 24 commits February 25, 2025 16:27
[UPD] Update product_pricelist_revision.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-12.0/product-attribute-12.0-product_pricelist_revision
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_pricelist_revision/
…t filter

TT28144

[UPD] Update product_pricelist_revision.pot
Currently translated at 100.0% (30 of 30 strings)

Translation: product-attribute-13.0/product-attribute-13.0-product_pricelist_revision
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_pricelist_revision/ca/
Before this change on runbot we caught a Warning about deprecated call to decimal_precision.get_precision(<application>)

[UPD] README.rst

product_pricelist_revision 13.0.1.1.0
Fix website key in the manifests
Currently translated at 31.0% (9 of 29 strings)

Translation: product-attribute-14.0/product-attribute-14.0-product_pricelist_revision
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_pricelist_revision/it/
Currently translated at 100.0% (29 of 29 strings)

Translation: product-attribute-16.0/product-attribute-16.0-product_pricelist_revision
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_pricelist_revision/it/
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (29 of 29 strings)

Translation: product-attribute-16.0/product-attribute-16.0-product_pricelist_revision
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_pricelist_revision/fr/
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_pricelist_revision branch from 947160c to d30d7fb Compare February 25, 2025 10:59
Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

Tested and working. Just a minor change to update the README. Please let me know if you have any questions.

TT54468

Comment on lines 3 to 4
1. Go to *Sales \> Configuration \> Settings* and check "Pricelists"
option and "Advanced price rules" after that.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the README, as the Advanced price rules no longer exist. You just need to activate the Pricelist check.

image

@@ -0,0 +1,3 @@
This module adds a 'Pricelist items' tree view that allows to select
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This module adds a 'Pricelist items' tree view that allows to select
This module adds a 'Pricelist items' list view that allows to select

Comment on lines 4 to 5
2. Add a Pricelist Items to that Price List. Set 'Fix Price' value on
the field 'Compute Price' and set a fixed price.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. Add a Pricelist Items to that Price List. Set 'Fix Price' value on
the field 'Compute Price' and set a fixed price.
2. Add a Pricelist Items to that Price List. Set 'Fixed Price' value on
the field 'Price type' and set a fixed price.

image

Comment on lines 8 to 15
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT


class TestProductPricelistRevision(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please inherit from BaseCommon? and remove DISABLED_MAIL_CONTEXT

item.date_end = self.date_start - relativedelta(seconds=1)

xmlid = "product_pricelist_revision.product_pricelist_item_action"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Once the new rules are created, they show the new records, but the action has a context that activates the Current filter. If the pricelist is in the future, it can confuse the user since nothing will be displayed. Please remove this key from the context to avoid confusion.

image

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Just here, try something like:

Suggested change
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action["context"] = {}

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_pricelist_revision branch from d30d7fb to d513073 Compare March 18, 2025 05:19
@BhaveshHeliconia
Copy link
Author

@carlos-lopez-tecnativa, Please Review.all requested changes are fixed let me know if i missed anything.Thank you!

]
"
/>
<field name="context">{}</field>
Copy link
Contributor

Choose a reason for hiding this comment

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

In my previous comment, I didn’t mean to always remove the context from this action. I meant to remove only the specific key, but only when the wizard reads this action. Please restore this context in the action and remove only the specific key from the wizard.

item.date_end = self.date_start - relativedelta(seconds=1)

xmlid = "product_pricelist_revision.product_pricelist_item_action"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just here, try something like:

Suggested change
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action["context"] = {}

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_pricelist_revision branch from d513073 to 8c90201 Compare March 19, 2025 05:32
@BhaveshHeliconia
Copy link
Author

@carlos-lopez-tecnativa, Please Review.

Comment on lines +11 to +13
Set new start date and variation percent to duplicate.
This process set start date previous day as end date of
origin record.
Copy link
Contributor

Choose a reason for hiding this comment

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

This wizard updates the new price according to variations, but only when the pricelist item is based on a fixed price. Is it possible to add a message here to clarify this behavior for the user? Currently, it is only explained in the module README. What do you think?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.