Files
suite/product_variant_so_always/models/product.py
Jared Kipe bc12ae874d 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.
2019-07-26 10:27:13 -07: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()