summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-10 14:45:54 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-10 14:45:54 +0700
commit3de9e2a7e2b9b455fa85e33231612996538830f4 (patch)
treec31cd2576cc20a1655af84eda29335d67b216c90 /indoteknik_custom/models/purchase_order.py
parent519d2466e550ccf382466b8bb46af84169f3267b (diff)
parentdec973e8e6b8647e8762ab6ce32d90df371cd24b (diff)
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index b4d671b6..0ef6a9f2 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -38,6 +38,12 @@ 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')
+ def action_create_invoice(self):
+ res = super(PurchaseOrder, self).action_create_invoice()
+ if not self.env.user.is_accounting:
+ raise UserError('Hanya Accounting yang bisa membuat Bill')
+ return res
+
def calculate_line_no(self):
line_no = 0
for line in self.order_line:
@@ -169,6 +175,8 @@ class PurchaseOrder(models.Model):
self.approval_status = 'approved'
self.po_status = 'menunggu'
+ self.calculate_line_no()
+
return res
def po_approve(self):