mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
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:
committed by
Connor Christian
parent
ef4a00ba95
commit
5fe32edd5c
1
product_variant_so_always/models/__init__.py
Normal file
1
product_variant_so_always/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import product
|
||||
13
product_variant_so_always/models/product.py
Normal file
13
product_variant_so_always/models/product.py
Normal 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()
|
||||
Reference in New Issue
Block a user