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

[WIP][FIX] product: Price on pricelist with pricelists inside of it #372

Conversation

CarmenMiranda
Copy link

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.

@CarmenMiranda CarmenMiranda force-pushed the 12.0-Pricelist-Global-Fix-CarmenMiranda branch from b60b289 to 337087a Compare October 13, 2020 00:57
@luisg123v
Copy link

@CarmenMiranda maybe you should remove commits intended to be patches.

@CarmenMiranda
Copy link
Author

@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

@luisg123v
Copy link

Yes, because patches will fail to be applied otherwise, as they will be already applied.

@CarmenMiranda CarmenMiranda force-pushed the 12.0-Pricelist-Global-Fix-CarmenMiranda branch 6 times, most recently from 019266c to 9902e31 Compare October 19, 2020 22:23
@nhomar
Copy link
Member

nhomar commented Nov 2, 2020

@CarmenMiranda @JulioSerna

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)'
Copy link

@moylop260 moylop260 Nov 2, 2020

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.
@hbto
Copy link

hbto commented Mar 4, 2021

ping @hbto

@hbto
Copy link

hbto commented Mar 4, 2021

@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.
@CarmenMiranda CarmenMiranda force-pushed the 12.0-Pricelist-Global-Fix-CarmenMiranda branch from d45a2d5 to 60c6576 Compare March 4, 2021 15:28
@luisg123v luisg123v closed this Jul 14, 2022
@luisg123v luisg123v deleted the 12.0-Pricelist-Global-Fix-CarmenMiranda branch July 14, 2022 00:55
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.

5 participants