From 2ef42e311c7da31875f2013ebb0bb6ceda4f1233 Mon Sep 17 00:00:00 2001 From: Andrea Stirpe Date: Mon, 27 Nov 2017 08:58:25 +0100 Subject: [PATCH] [FIX] sale: add force_save to make sure SO is correct This commit implements the same fix already made in commit https://github.com/odoo/odoo/commit/a5ca63c83beafd9a060ac58d3b4c6a9a987b28df, but this time applied to the tree view of the sale order lines, instead of the form view. Without this fix, if you add new lines in the sale order by using the tree view (instead of the form) you can get the following error: ``` Odoo Server Error - Validation Error The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set [object with reference: product_id - product.id] ``` The error is because the "product_id" value is not sent to the server. The "product_id" value is mandatory for sale order lines. To reproduce the issue, you need to reproduce the following scenario: - create a new sale order and save it - edit the sale order; you should be able to edit inline the sale order lines (by the tree view) - create a new product, being sure that the field 'product_id' is readonly (field 'product_updatable' is False). - try save the sale order See detailed explanation of the issue in description of commit https://github.com/odoo/odoo/commit/a5ca63c83beafd9a060ac58d3b4c6a9a987b28df. PR #21211 --- addons/sale/views/sale_views.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 872d1890ee5..d5d33d72f37 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -262,6 +262,7 @@