diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-08-31 13:40:38 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-08-31 13:40:38 +0700 |
| commit | 3f9ee6e5297afbd7aad670eb061c069621af888e (patch) | |
| tree | 0a91a9c5e55adeda13e337f313b6552b2a33edce | |
| parent | 5e85d3f86366018546dab425a8c41eb8a4f3056e (diff) | |
refactor validate product
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 6 | ||||
| -rw-r--r-- | indoteknik_custom/views/cost_centre.xml | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 707a8381..e9d57dc3 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -51,7 +51,6 @@ class ProductTemplate(models.Model): is_new_product = fields.Boolean(string='Produk Baru', help='Centang jika ingin ditammpilkan di website sebagai segment Produk Baru') seq_new_product = fields.Integer(string='Seq New Product', help='Urutan Sequence New Product') - is_edit = fields.Boolean(string="Update Counter", default=True) # def write(self, vals): # if not self.env.user.is_purchasing_manager: @@ -69,7 +68,7 @@ class ProductTemplate(models.Model): # raise UserError("Hanya Pak Tyas yang bisa mengedit product") # return super(ProductTemplate, self).write(vals) - @api.constrains('name','default_code',) + @api.constrains('name','default_code') def _check_duplicate_product(self): if not self.env.user.is_purchasing_manager: for product in self: @@ -332,7 +331,6 @@ class ProductProduct(models.Model): qty_onhand_bandengan = fields.Float(string='Qty Incoming Bandengan', compute='_get_qty_onhand_bandengan') qty_incoming_bandengan = fields.Float(string='Qty Incoming Bandengan', compute='_get_qty_incoming_bandengan') sla_version = fields.Integer(string="SLA Version", default=0) - is_edit = fields.Boolean(string="Update Counter", default=True) # def write(self, vals): # if not self.env.user.is_purchasing_manager: @@ -349,7 +347,7 @@ class ProductProduct(models.Model): # raise UserError("Hanya Pak Tyas yang bisa mengedit product") # return super(ProductProduct, self).write(vals) - @api.constrains('name','default_code',) + @api.constrains('name','default_code') def _check_duplicate_product(self): if not self.env.user.is_purchasing_manager: for product in self: diff --git a/indoteknik_custom/views/cost_centre.xml b/indoteknik_custom/views/cost_centre.xml index 665b0025..3e4d2736 100644 --- a/indoteknik_custom/views/cost_centre.xml +++ b/indoteknik_custom/views/cost_centre.xml @@ -19,7 +19,7 @@ <sheet string="Cost Centre"> <group> <group> - <field name="name"/> + <field name="name" required="1"/> <field name="description"/> </group> </group> |
