diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-02-10 14:22:01 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-02-10 14:22:01 +0700 |
| commit | dec973e8e6b8647e8762ab6ce32d90df371cd24b (patch) | |
| tree | 40a466a17d77e340ea515e30e36f9b3f6415fe5b | |
| parent | 5381de8a6be24465f33a44ae8c33ab9f4832d44d (diff) | |
| parent | a695077283db234296e79c392638211dfb7fc263 (diff) | |
Merge branch 'can_create_invoice' into release
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 6 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 2f3d2ec4..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: diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 59c46e5f..1b6f31aa 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -7,6 +7,10 @@ <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <button id="action_confirm" position="after"> + <button name="calculate_line_no" + string="Create No" + type="object" + /> <button name="sale_order_approve" string="Ask Approval" type="object" |
