summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-03-05 14:02:13 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-03-05 14:02:13 +0700
commit006c1171970a3ade5033d8bb112b7f6094b35d11 (patch)
treeff11743c553ebb6682b0640171318d9b322d427c /indoteknik_custom/models/account_move.py
parent660913a45a1efe08f308d405e1011efc9744c553 (diff)
parent92b6da28414fed56732f86e1f04ea2fac3464d7d (diff)
Merge branch 'odoo-production' into dev/wms
# Conflicts: # indoteknik_custom/models/__init__.py # indoteknik_custom/models/stock_immediate_transfer.py # indoteknik_custom/models/stock_picking.py
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 4553e446..9aa0743b 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -63,6 +63,20 @@ 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)
+ purchase_order_id = fields.Many2one('purchase.order', string='Purchase Order')
+
+ 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 +116,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):
@@ -353,7 +368,7 @@ class AccountMove(models.Model):
def export_faktur_to_xml(self):
- valid_invoices = self.validate_faktur_for_export()
+ valid_invoices = self
# Panggil model coretax.faktur untuk menghasilkan XML
coretax_faktur = self.env['coretax.faktur'].create({})