summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-18 11:41:53 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-18 11:41:53 +0700
commit001aa772a6ff8f7eb1cf1688480f32a7d82ec45d (patch)
treed54143a1e420e7ef62b98e14434203051264480e /indoteknik_custom/models/account_move.py
parentb5b115176d5f69f4732c0ad64f24d19c82c7bbdb (diff)
change request multi create uangmuka pembelian
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 45d54209..3df6d888 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -62,6 +62,7 @@ class AccountMove(models.Model):
so_delivery_amt = fields.Char(string="SO Delivery Amount", compute='compute_so_shipping_paid_by')
flag_delivery_amt = fields.Boolean(string="Flag Delivery Amount", compute='compute_flag_delivery_amt')
nomor_kwitansi = fields.Char(string="Nomor Kwitansi")
+ po_id = fields.Many2one('purchase.order', string='purchase Order')
@api.model
def create(self, vals):
@@ -165,6 +166,15 @@ class AccountMove(models.Model):
def button_cancel(self):
res = super(AccountMove, self).button_cancel()
+ if self.move_type == 'entry':
+ po = self.env['purchase.order'].search([
+ ('invoice_ids', 'in', [self.id])
+ ])
+
+ for order in po:
+ if order:
+ order.is_create_uangmuka = False
+
if self.id and not self.env.user.is_accounting:
raise UserError('Hanya Accounting yang bisa Cancel')
return res