|
|
@ -81,5 +81,15 @@ class ProductTemplate(models.Model): |
|
|
|
@api.onchange('to_make_mrp') |
|
|
|
def onchange_to_make_mrp(self): |
|
|
|
if self.to_make_mrp: |
|
|
|
if not self.bom_temp: |
|
|
|
if not self.bom_count: |
|
|
|
raise Warning('Please set Bill of Material for this product.') |
|
|
|
|
|
|
|
|
|
|
|
class ProductProduct(models.Model): |
|
|
|
_inherit = 'product.product' |
|
|
|
|
|
|
|
@api.onchange('to_make_mrp') |
|
|
|
def onchange_to_make_mrp(self): |
|
|
|
if self.to_make_mrp: |
|
|
|
if not self.bom_count: |
|
|
|
raise Warning('Please set Bill of Material for this product.') |
|
|
|