summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-11-03 10:28:12 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-11-03 10:28:12 +0700
commitef84c9cb7e25f1a45c1a8534b6d58feb6a8d7079 (patch)
tree7b9cbf21a0bd6630a7713cd7a929b3745cc9466f
parentf9db64cedebcc292cbaf7d074b066cc6f8f19ea0 (diff)
parentc5e1a624c8cc015d8fe457a90cd5bc3c7571b5eb (diff)
Merge branch 'master' of bitbucket.org:altafixco/indoteknik-addons
-rw-r--r--indoteknik_custom/models/account_move.py4
-rwxr-xr-xindoteknik_custom/models/product_template.py8
2 files changed, 9 insertions, 3 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index aa4b0b1e..1e0c56cf 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -15,6 +15,8 @@ class AccountMove(models.Model):
@api.onchange('date_kirim_tukar_faktur')
def change_date_kirim_tukar_faktur(self):
for invoice in self:
+ if not invoice.date_kirim_tukar_faktur:
+ return
tukar_date = invoice.date_kirim_tukar_faktur
term = invoice.invoice_payment_term_id
add_days = 0
@@ -26,6 +28,8 @@ class AccountMove(models.Model):
@api.onchange('date_terima_tukar_faktur')
def change_date_terima_tukar_faktur(self):
for invoice in self:
+ if not invoice.date_terima_tukar_faktur:
+ return
tukar_date = invoice.date_terima_tukar_faktur
term = invoice.invoice_payment_term_id
add_days = 0
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 13654ab3..a812fc28 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -35,7 +35,8 @@ class ProductTemplate(models.Model):
solr_flag = fields.Integer(string='Solr Flag', default=0)
def write(self, vals):
- vals['solr_flag'] = 2
+ if 'solr_flag' not in vals and self.solr_flag == 1:
+ vals['solr_flag'] = 2
return super().write(vals)
def _compute_qty_stock_vendor(self):
@@ -150,8 +151,9 @@ class ProductProduct(models.Model):
solr_flag = fields.Integer(string='Solr Flag', default=0)
def write(self, vals):
- self.product_tmpl_id.solr_flag = 2
- vals['solr_flag'] = 2
+ if 'solr_flag' not in vals and self.solr_flag == 1:
+ self.product_tmpl_id.solr_flag = 2
+ vals['solr_flag'] = 2
return super().write(vals)
def _compute_web_price(self):