NEW product_variant_so_always for 11.0

Adds boolean on the `product.template` form to force the 'dynamic' mode for NOT creating variants on `product.template` save, but rather when added to sale orders.
This commit is contained in:
Jared Kipe
2019-07-26 10:27:13 -07:00
committed by Connor Christian
parent ef4a00ba95
commit 5fe32edd5c
7 changed files with 100 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import product

View File

@@ -0,0 +1,13 @@
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
always_variant_on_so = fields.Boolean(string='Always create variants on SO Lines')
def has_dynamic_attributes(self):
self.ensure_one()
if self.always_variant_on_so:
return True
return super(ProductTemplate, self).has_dynamic_attributes()