From 443e02df87f0444628b4dd6121a6092e72b638f8 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Wed, 28 Nov 2018 18:20:35 +0100 Subject: [PATCH] SST-10 do not create product when inactive but update if existent --- ext/custom-addons/dp_custom/models/product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index 2faecc3e..3d27fc27 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -80,7 +80,8 @@ class ProductTemplate(models.Model): if product_template: product_template.write(vals) else: - self.create(vals) + if vals['active']: + self.create(vals) return True @api.model