Files
suite/product_variant_so_always/models/product.py
Jared Kipe f259f9a017 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.
2020-11-10 20:45:48 +00:00

14 lines
389 B
Python

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()