diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-10 14:45:54 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-10 14:45:54 +0700 |
| commit | 3de9e2a7e2b9b455fa85e33231612996538830f4 (patch) | |
| tree | c31cd2576cc20a1655af84eda29335d67b216c90 /indoteknik_custom/models/purchase_order.py | |
| parent | 519d2466e550ccf382466b8bb46af84169f3267b (diff) | |
| parent | dec973e8e6b8647e8762ab6ce32d90df371cd24b (diff) | |
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 8 |
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): |
