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

[16.0][IMP] product_pricelist_direct_print add hooks #1782

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

mmequignon
Copy link
Member

This pull requests add hooks to the following modules:

  • product_pricelist_direct_print
  • product_pricelist_direct_print_xlsx

This is meant to make overrides of the reports easier.

@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain, @CarlosRoca13,
some modules you are maintaining are being modified, check this out!

@mmequignon mmequignon force-pushed the 16.0-product_pricelist_direct_print-add_hooks branch 2 times, most recently from 6600a87 to bcf594a Compare November 27, 2024 10:41
@mmequignon mmequignon marked this pull request as ready for review November 27, 2024 10:57
@mmequignon mmequignon force-pushed the 16.0-product_pricelist_direct_print-add_hooks branch from bcf594a to 049b53f Compare November 27, 2024 10:59
Copy link
Contributor

@sebalix sebalix left a comment

Choose a reason for hiding this comment

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

LG, always nice to get additional tests

@mmequignon
Copy link
Member Author

@legalsylvain @CarlosRoca13
Hi! Could I please get your insights on this?
Thanks!

@@ -95,6 +96,20 @@ def _compute_product_price(self):
else:
self.product_price = price

def get_price_for_pricelist(self, pricelist, product):
# TODO enable this instead
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it wip ?

Copy link
Member Author

Choose a reason for hiding this comment

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

More like an open question for reviewers.
Is there a benefit for using a computed field depending on the context rather than using a 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 think your right. I'm not sure to understand the current design.
however, changing the code could break possible module overloading this module. Not sure what to think here.
In all cases, if you want to introduce questions, please add better a note in the ROADMAP.rst file that mention "replace computed function xxx by yyy when porting this module". i think it's better than adding commented code with TODO.
What do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @legalsylvain, adding these changes to the module at this stage could cause inheritance issues in other modules that rely on them.

Copy link
Contributor

@CarlosRoca13 CarlosRoca13 left a comment

Choose a reason for hiding this comment

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

The definition of the methods is being changed, which will cause errors in modules that use this one.

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.

7 participants