summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/product_template.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index e9d57dc3..b44f585e 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -51,6 +51,7 @@ 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_edited = fields.Boolean(string='Is Edited')
# def write(self, vals):
# if not self.env.user.is_purchasing_manager:
@@ -331,6 +332,7 @@ 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_edited = fields.Boolean(string='Is Edited')
# def write(self, vals):
# if not self.env.user.is_purchasing_manager:
@@ -365,12 +367,15 @@ class ProductProduct(models.Model):
raise UserError(massage)
else:
domain = [
- ('id', '=', product.id)
+ ('id', '=', product.id),
+ ('is_edited', '=', True),
]
- massage="Hanya Pak Tyas Yang Dapat Merubah Data Product"
- existing_purchase = self.search(domain, limit=1)
+ existing_purchase = self.search(domain)
if existing_purchase:
- raise UserError(massage)
+ raise UserError('Hanya Pak Tyas Yang Dapat Merubah Data Product')
+ if not existing_purchase:
+ true = True
+ self.is_edited = true
@api.constrains('name')
def _validate_name(self):