Adrien Widart ce3798e6ca [FIX] web: remove default_ from parent record
When having a subview for a 2many field, if an onchange is triggered for
that field, the default values of the parent are still in the request
context.

To reproduce the issue:
(Need helpdesk_repair. Use demo data)
1. Helpdesk > Configuration > Helpdesk Teams, edit "Customer Care":
    - Enable "Repairs"
2. Create a storable and tracked-by-usn product P
3. Update the on-hand quantity:
    - 1 x P with serial S
4. Helpdesk > Customer Care (Tickets), create a ticket:
    - Product: P
    - Lot/Serial number: S
5. Click on Repair and save the repair order R
6. Edit R and add a line in "Parts"

Error: on the new line, both Product and Lot/Serial fields are already
filled with values P and S, which does not make sens

On step 5, when clicking on Repair, the form views of a repair order is
loaded with a specific context:
https://github.com/odoo/enterprise/blob/deef3c967d43862edf02dbcfc461fb89b064731e/helpdesk_repair/views/helpdesk_views.xml#L31-L34

Therefore, when editing the form and trying to add a new line in Parts,
an onchange is triggered but the default values are not removed from the
context. As a result, since the model `repair.line` also has two fields
called `product_id` and `lot_id`, the default values of the parent
(`repair.order`) are used.

When computing the context of a subview, the default values of the
parent should be removed.

OPW-2752436

closes odoo/odoo#89366

X-original-commit: db7423a97fd812fe6df95296fd7a6ca18854933b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-04-22 10:59:00 +02:00
2022-04-12 15:48:58 +02:00
2022-04-21 07:59:26 +02:00
…
…
2021-10-07 17:59:53 +00:00
2022-01-14 15:44:52 +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%