-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP][FIX] product: Price on pricelist with pricelists inside of it #372
[WIP][FIX] product: Price on pricelist with pricelists inside of it #372
Conversation
b60b289
to
337087a
Compare
@CarmenMiranda maybe you should remove commits intended to be patches. |
@luisg123v This is intended to be a patch also, the other ones are also patches? I guess I should remove them |
Yes, because patches will fail to be applied otherwise, as they will be already applied. |
019266c
to
9902e31
Compare
Why this change adding fields is not part of an external module? cc @moylop260 |
@@ -153,7 +153,9 @@ def _compute_price_rule(self, products_qty_partner, date=False, uom_id=False): | |||
'AND (item.pricelist_id = %s) ' | |||
'AND (item.date_start IS NULL OR item.date_start<=%s) ' | |||
'AND (item.date_end IS NULL OR item.date_end>=%s)' | |||
'ORDER BY item.applied_on, item.min_quantity desc, categ.complete_name desc, item.id desc', | |||
'AND (item.active = TRUE)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nhomar
Even if you use another module to add the active
field this method is not easy to inherit in order to add the active=True
filter.
If you create a separated module you should copy&paste the 166 lines of this method.
However, if there is a change in the original one you won't be warned and you will loose that new change and the inherit feature since that you should overwrite it completely.
- The patch allows you warn if there is a change from Odoo core in this method (conflicts applying the patch).
- The patch allows you have this method inheritable if there is another place where it is inherited for another feature.
When a you have a global pricelist and inside of it, you have an item 'applied on' 'Global' and a pricelist 'A' with product A, and another item also with 'applied on' 'Global' with a pricelist 'B' with the product B. And you make a sale order with the global pricelist and you add both products, the only product that is going to have the price set with the pricelist B or A it depends which item is first. With this change it will check in all items of the global pricelist until it find the price or it will set the price on the product. Also, adding the field `active` on the model `product.pricelist.item`.
After adding the method `_check_pricelist_rule` we need add the context and return.
9902e31
to
fb8e66e
Compare
fb8e66e
to
d45a2d5
Compare
ping @hbto |
@CarmenMiranda PR #397 will be used from now on in stable, This will be kept to allow you to keep developing the features being tackled here. Regards. |
Allowing the convertion of the prices with a custom rate.
d45a2d5
to
60c6576
Compare
When you have a global pricelist and inside of it, you have an item 'applied on' 'Global' and a pricelist 'A' with product A,
and another item also with 'applied on' 'Global' with a pricelist 'B' with product B.
And you make a sale order with the global pricelist and you add both products, the only product that is going to have the price set with the pricelist B or A it depends which item is first.
With this change, it will check in all items of the global pricelist until it finds the price or it will set the price on the product.