"price = (price - (max_seller_price* (self.price_discount / 100))) or 0.0"
Side note: This will also require an additional key in field "base
" to setup a different workflow for pricelist based on formula →
If calculated 'on the fly' it can is almost surely bad in terms of performance so I think it's better to store the maximum seller price somewhere in the product record, I'm not sure about the right moment to calculate and store the value though, maybe when a new purchase is performed, but still have to think about this detail.
This way, the max seller price can be passed in the function
and there should not be performance issues on the sale order.
To achieve this a new field should be added to product.template model, so I can store the value and pass to the formula if the conditions are met.
Is this feature somehow achievable, or maybe there is even a better way to achieve it? If not or partially achieved, I could also consider some more extensible variants if the community is interested to this feature:
1) Add 3 field to product.template model: "seller_cost_max", "seller_cost_min", "seller_cost_average" and compute the values (still not sure when)
2) add a Selection field to model 'product.pricelist.item' to choose if you want to apply
- apply standard_price
- apply seller_cost_max
- apply seller_cost_min
- apply seller_cost_average
To the formula
"price = (price - (chosen_value* (self.price_discount / 100))) or 0.0"
Variant 2 (save some DB columns)
1) Store only 1 value between max/min/average cost in a new field, "seller_price_computed", you can decide which calculation method to use thanks to a select field in res.config.settings.
2) Add a flag to 'product.pricelist.item' to choose if you want to apply the 'standard_price' or "seller_price_computed" to the formula.
I added this last part in case you like the idea and this feature is not or partially implemented, please for now just consider it as an idea on the table. I'm also pretty confident that that this feature, or part of it is already implemented in odoo14, so I'll wait for your feedback!
Hello OCA contributors, I am looking at pricelist in Odoo14. Firstly I have checked in the brand repository https://github.com/OCA/brand/tree/14.0 and found an awsome PR that integrates brand with product pricelist. Thanks for the awsome work you make for Odoo. About the brand I’d like to know if there is something that allows to filter products by brand in website as well.
But mostly I’d like to ask for a feature that I did not find in Odoo14. Basically we need a pricelist that apply a % discount based on the maximum purchase price.
The closest thing I manage to reach is to apply a pricelist based on formula that applies % discount based on product cost but we need much more than this. I did not found any repository for pricelists, so I’d like to ask if there is something module or way to achieve this feature, or what do you advice to achieve it.
Thank you very much,
Inviato da Posta per Windows