From 1e8df9917331aba9bcdbb810730f9de1917e7b39 Mon Sep 17 00:00:00 2001 From: "Jordan D. (Joda)" Date: Thu, 5 Jan 2023 15:16:47 +0000 Subject: [PATCH] [FIX] sale_purchase: fix duplication of service with subcontract service When trying to duplicate a service in sale > products with "Subcontract Service" enabled, a error message will appear. This is due to the fact that when you are duplicating a product, every vendor in the purchase tab are not carried over to the copy. To fix this easily, we need to disable the "Subcontract Service" on duplicates entry during their creations. opw-3115827 closes odoo/odoo#111221 X-original-commit: 731e1ec09839129f8d7ab3fa71257974e68263ec Signed-off-by: William Henrotin (whe) --- addons/sale_purchase/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_purchase/models/product_template.py b/addons/sale_purchase/models/product_template.py index d24cfd60e59..b3fb063f1cd 100644 --- a/addons/sale_purchase/models/product_template.py +++ b/addons/sale_purchase/models/product_template.py @@ -9,7 +9,7 @@ class ProductTemplate(models.Model): _inherit = 'product.template' service_to_purchase = fields.Boolean( - "Subcontract Service", company_dependent=True, + "Subcontract Service", company_dependent=True, copy=False, help="If ticked, each time you sell this product through a SO, a RfQ is automatically created to buy the product. Tip: don't forget to set a vendor on the product.") @api.constrains('service_to_purchase', 'seller_ids', 'type')