[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) <whe@odoo.com>
This commit is contained in:
Jordan D. (Joda)
2023-01-30 16:45:40 +01:00
committed by William Henrotin
parent 42ca951633
commit 1e8df99173
@@ -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')