Victor Feyens ba4f0679e8 [FIX] sale: correct product price when created inline
When sale_product_configurator is installed, products created/chosen on
sales order lines are product template and not product.product.

When creating a product on the fly, the context on the product_template_id
field is wrong because applied to the product.template AND the product.product.

Contrary to the automatic creation of a template when a product.product is created (orm-side),
we have custom code in product ensuring that when a template is created, product.product(s)
are created.  But this step doesn't clear the context like the orm does.

This means that the default_lst_price=0 in the context won't be applied for the
product.template creation, but will be for the product.product creation:

1) product.template created
2) product.product creation, based on product.template vals
  * in the create, the call to _add_missing_default_values will give a
  default value for lst_price.
  * this will trigger the inverse_related for the field, resetting the
  template price.

To avoid this problem, we modify the view to specify list_price instead of lst_price in the context,
because this field will be protected by the orm because it is inherited from the product.template.

closes odoo/odoo#49959

X-original-commit: 42fe38015796b1973245103c877357c14889bacc
Related: odoo/enterprise#10108
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 11:06:20 +00:00
2020-04-21 12:44:07 +00:00
2020-04-20 11:41:39 +00:00
…
2019-10-03 12:48:09 +00:00
…
…
…
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

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

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%