diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-03 12:44:54 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-03 12:44:54 +0700 |
| commit | 091038b12f8e1cf9b0668110405c385e90a97ad7 (patch) | |
| tree | e4bb9ef3f7bd30017627c5ba794b1bae3bed64d1 | |
| parent | 9fe4b646f1b1cda3d704a66dfbca3e935e38d96b (diff) | |
nomor faktur pajak di invoice
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 18025b32..c3cd7ef9 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -2,6 +2,10 @@ from odoo import models, api, fields from odoo.exceptions import AccessError, UserError, ValidationError from datetime import timedelta, date import logging +import base64 +import PyPDF2 +import os +import re _logger = logging.getLogger(__name__) @@ -23,6 +27,14 @@ class AccountMove(models.Model): cost_centre_id = fields.Many2one('cost.centre', string='Cost Centre') analytic_account_ids = fields.Many2many('account.analytic.account', string='Analytic Account') due_line = fields.One2many('due.extension.line', 'invoice_id', compute='_compute_due_line', string='Due Extension Lines') + no_faktur_pajak = fields.Char(string='No Faktur Pajak') + + @api.onchange('efaktur_id') + def change_efaktur_id(self): + for invoice in self: + if not invoice.efaktur_id: + return + invoice.no_faktur_pajak = invoice.efaktur_id.name def _compute_due_line(self): for invoice in self: diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 11558bf4..c45dab25 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -13,6 +13,12 @@ <field name="invoice_date" position="after"> <field name="payment_schedule" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/> </field> + <field name="efaktur_document" position="before"> + <field name="no_faktur_pajak" readonly="1"/> + </field> + <field name="efaktur_document" position="attributes"> + <attribute name="widget">pdf_viewer</attribute> + </field> <field name="invoice_user_id" position="after"> <field name="date_kirim_tukar_faktur"/> <field name="shipper_faktur_id"/> |
