summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index d62f19ae..b2ac47c2 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -63,6 +63,19 @@ class AccountMove(models.Model):
flag_delivery_amt = fields.Boolean(string="Flag Delivery Amount", compute='compute_flag_delivery_amt')
nomor_kwitansi = fields.Char(string="Nomor Kwitansi")
other_subtotal = fields.Float(string="Other Subtotal", compute='compute_other_subtotal')
+ other_taxes = fields.Float(string="Other Taxes", compute='compute_other_taxes')
+ is_hr = fields.Boolean(string="Is HR?", default=False)
+
+ def _update_line_name_from_ref(self):
+ """Update all account.move.line name fields with ref from account.move"""
+ for move in self:
+ if move.move_type == 'entry' and move.ref and move.line_ids:
+ for line in move.line_ids:
+ line.name = move.ref
+
+ def compute_other_taxes(self):
+ for rec in self:
+ rec.other_taxes = rec.other_subtotal * 0.12
def compute_other_subtotal(self):
for rec in self:
@@ -102,6 +115,7 @@ class AccountMove(models.Model):
def create(self, vals):
vals['nomor_kwitansi'] = self.env['ir.sequence'].next_by_code('nomor.kwitansi') or '0'
result = super(AccountMove, self).create(vals)
+ # result._update_line_name_from_ref()
return result
def compute_so_shipping_paid_by(self):