summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-09-26 15:07:27 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-09-26 15:07:27 +0700
commitc86979fd504ee06dc19c69797159a13295b0c809 (patch)
treef271661fbc2947073d48cc67c3eb4901692d1643 /indoteknik_custom/models/purchase_order.py
parent01f308991afffaff5eda1b758dbb98d0f3ba8396 (diff)
parentd324fdd8ea3b14c966510bde610a96c8f5c3e3c5 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 08f38afe..6654bfd2 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -46,6 +46,11 @@ class PurchaseOrder(models.Model):
summary_qty_receipt = fields.Float('Summary Qty Receipt', compute='_compute_summary_qty')
count_line_product = fields.Float('Total Item', compute='compute_count_line_product')
note_description = fields.Char(string='Note', help='bisa diisi sebagai informasi indent barang tertentu atau apapun')
+ has_active_invoice = fields.Boolean(string='Has Active Invoice', compute='_compute_has_active_invoice')
+
+ def _compute_has_active_invoice(self):
+ for order in self:
+ order.has_active_invoice = any(invoice.state != 'cancel' for invoice in order.invoice_ids)
def add_product_to_pricelist(self):
for line in self.order_line: