Levi Siuzdak (sile) bcc86ad4b0 [FIX] product: don't remove product_tmpl_id from supplierinfo
Versions
--------
- 15.0+

Steps
-----
1. Go to product variants;
2. select a product;
3. add a new Vendor line in the Purchase tab;
4. save;
5. add another Vendor line;
6. save.

Issue
-----
Previous line disappears from view.

Cause
-----
In 93bc96047ff684cb66b69186822493815cf37982 I added logic which sets
the `product_tmpl_id` in `product.supplierinfo` if a `product_id`
gets written without accompanying `product_tmpl_id`. Adding lines from
the Product Variant views add  `{'product_id': False}` to the values for
every vendor in the list without a Product Variant, so their
`product_tmpl_id` gets overwritten with the `product_tmpl_id` of an
empty product.

Solution
--------
Only overwrite `product_tmpl_id` iff `product_id` gets written to a
non-falsy value by changing `if 'product_id' in vals` to
`if vals.get('product_id')`.

opw-3664524

closes odoo/odoo#153168

X-original-commit: 03d4be7b8804863a7e7e9af29a8ec61c65d6dab3
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2024-02-08 09:23:02 +00:00
2023-11-02 21:02:44 +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%