diff options
Diffstat (limited to 'indoteknik_custom/models/x_manufactures.py')
| -rwxr-xr-x | indoteknik_custom/models/x_manufactures.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indoteknik_custom/models/x_manufactures.py b/indoteknik_custom/models/x_manufactures.py index b32d257d..dae37668 100755 --- a/indoteknik_custom/models/x_manufactures.py +++ b/indoteknik_custom/models/x_manufactures.py @@ -1,4 +1,4 @@ -from odoo import models, fields +from odoo import models, fields, api class XManufactures(models.Model): @@ -35,3 +35,13 @@ class XManufactures(models.Model): ('sparepart', 'Spare Part') ], string="Jenis Produk") x_short_desc = fields.Text(string="Short Description") + + @api.onchange('x_name','image_promotion_1','image_promotion_2') + def update_solr_flag(self): + for manufacture in self: + templates = self.env['product.template'].search([ + ('x_manufacture', '=', manufacture.id) + ]) + for template in templates: + if template.solr_flag == 1: + template.solr_flag = 2 |
