- Mailing Lists
- Contributors
- Pricelist based on max purchase cost
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Pricelist based on max purchase cost
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,
Francesco Ballerini
Inviato da Posta per Windows
by Francesco Ballerini - 08:17 - 28 Jan 2023
Follow-Ups
-
Fwd: Pricelist based on max purchase cost
Good morning OCA Contributors,I was doing some analysis on models 'product.pricelist', 'product.pricelist.item', 'product.supplierinfo' (never checked those models before) and product.product and I'd like to add some technical info to my previous message.This message doesn't really add many functional infos to the previous message, it's more a technical example to explain from code point of view what I would like to achieve, hoping it helps either to give better indications to find what I'm looking for or, in the worst case, I hope I can have some feedback for developing a 'decent looking' solution.Before joining the 'funny part' I would like to correct myself since I realized that "standard_price" field is not related to seller_ids.That doesn't change much in the general sense since I probably need a loop/search on "price" field of model "product.supplierinfo" to retrieve the higher seller price and use it in the pricelist formula (TLTR) but it wasn't very accurate.That said, if I only speak from my perspective/needs, so in a 'vertical' way of thinking, I probably need something that, before calling the _compute_price method in model 'product.pricelist.item' will check the seller_ids (or a stored value for the max seller id price) and takes max seller id price value instead of "standard_price" (or "list_price"), so the formula:"price = (price - (price * (self.price_discount / 100))) or 0.0" -- where price is taken as " standard_price" in product.product model
will become"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 → seller pricesIf 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 _compute_price 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:Variant 11) 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_averageTo 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!Cheers,Francesco Ballerini---------- Forwarded message ---------
Da: Francesco Ballerini <francescobl.lavoro@gmail.com>
Date: sab 28 gen 2023 alle ore 20:09
Subject: Pricelist based on max purchase cost
To: contributors@odoo-community.org <contributors@odoo-community.org>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,
Francesco Ballerini
Inviato da Posta per Windows
by Francesco Ballerini - 07:31 - 29 Jan 2023