88008a824721f796b977359cc723aeaa95bde752
Refactor the whole sale price computation logic in `product` & `sale` to improve code quality, maintainability, ... ### Drop/reduce as much as possible context-based logic * Drop magic `price` and `pricelist_id` fields on `product.product`/`product.template` * Keep one unique `_get_contextual_price()` to provide the old logic where it's still needed/difficult to remove atm. * Do not rely on context fallbacks on the lower level of price computation (aka `price_compute` method) It is way too dangerous to have such magic fallbacks so deeply in the logic, inducing potentially unexpected/wrong results ### Clean `product.pricelist` API * Clear parameters and fallbacks * Do not provide unused parameter(s) anymore (`partner`) * Stop providing products & quantities as a list of tuples, it was never used with different quantities in the existing code anyway * Removed unused methods * Split methods logic to ease and allow clean overrides and customizations * Convert the old hardcoded SQL query to a clear domain, using ORM querying and formatting logic instead * Improved documentation (docstrings, ...) ### Side cleanups in related/impacted modules * Update to use the new clean pricelist API * Code cleanup in sale prices computation (`sale_*`, `website_sale`, ...) * Some onchanges -> computes conversion in `sale_*` scope * Cache applied pricelist rule on SOL (avoid recomputing the pricelist rule in the price AND in the discount computation) Task ID - 2688106 Community PR: https://github.com/odoo/odoo/pull/79605 Enterprise PR: https://github.com/odoo/enterprise/pull/22211 <!-- Keep both authorship for the merge commit (author=robodoo) --> -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr closes odoo/odoo#79605 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Co-authored-by: Victor Feyens <vfe@odoo.com> Co-authored-by: Yannick Tivisse <yti@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%