From e746cf283822f12afe7f7cf11cbf2156b3b689ef Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 25 Apr 2024 15:57:08 +0700 Subject: add tax purchase on matches so apo --- indoteknik_custom/models/automatic_purchase.py | 3 ++- indoteknik_custom/views/automatic_purchase.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index ca64d8b0..dae1c6a4 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -406,6 +406,7 @@ class AutomaticPurchase(models.Model): 'qty_so': sale.outgoing, 'qty_po': line.qty_purchase, 'purchase_price': price_so.purchase_price, + 'purchase_tax_id': price_so.purchase_tax_id.id if price_so.purchase_tax_id.id else None, }]) def _create_sync_purchasing_job(self, jobs): @@ -558,7 +559,7 @@ class AutomaticPurchaseSalesMatch(models.Model): qty_so = fields.Float(string='Qty SO') qty_po = fields.Float(string='Qty PO') purchase_price = fields.Float(string='Purchase Price SO') - + purchase_tax_id = fields.Many2one('account.tax', string='Tax', domain=['|', ('active', '=', False), ('active', '=', True)]) class SyncPurchasingJob(models.Model): _name = 'sync.purchasing.job' diff --git a/indoteknik_custom/views/automatic_purchase.xml b/indoteknik_custom/views/automatic_purchase.xml index 71d292c9..974fbd17 100644 --- a/indoteknik_custom/views/automatic_purchase.xml +++ b/indoteknik_custom/views/automatic_purchase.xml @@ -53,6 +53,7 @@ + -- cgit v1.2.3