diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-23 15:57:03 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-23 15:57:03 +0700 |
| commit | b6d4737a8db5607172ac4f9a683cccb1e6c633cd (patch) | |
| tree | 3ad1e8ee066f6ca51a8382ec4d61c108dac995aa /fixco_custom | |
| parent | c0781114ae9c1e1616b6ccbff22d43452e7e1fcc (diff) | |
| parent | d108fdcf6994664bf7475f1e7fdce76e2597a2a2 (diff) | |
Merge branch 'main' of https://bitbucket.org/altafixco/fixco-addons
merge
Diffstat (limited to 'fixco_custom')
| -rw-r--r-- | fixco_custom/models/account_move_line.py | 12 | ||||
| -rw-r--r-- | fixco_custom/models/sale_order_multi_invoices.py | 6 | ||||
| -rw-r--r-- | fixco_custom/views/account_move.xml | 4 |
3 files changed, 16 insertions, 6 deletions
diff --git a/fixco_custom/models/account_move_line.py b/fixco_custom/models/account_move_line.py index d84c802..9cd5d85 100644 --- a/fixco_custom/models/account_move_line.py +++ b/fixco_custom/models/account_move_line.py @@ -6,7 +6,17 @@ class AccountMoveLine(models.Model): qty_outstanding = fields.Float(string='Qty Outstanding', compute='_compute_qty_outstanding') invoice_marketplace = fields.Text("Invoice Mearketplace", compute='_compute_invoice_marketplace') - faktur_pajak = fields.Char(string='Faktur Pajak', related='move_id.faktur_pajak') + faktur_pajak = fields.Char(string='Faktur Pajak', compute='_compute_faktur_pajak') + + def _compute_faktur_pajak(self): + for line in self: + line.faktur_pajak = False + move = line.move_id + + if not move: + continue + + line.faktur_pajak = move.efaktur_id.name if move.efaktur_id else False def action_gl_reconcile(self): lines = self diff --git a/fixco_custom/models/sale_order_multi_invoices.py b/fixco_custom/models/sale_order_multi_invoices.py index e6b0b98..de53797 100644 --- a/fixco_custom/models/sale_order_multi_invoices.py +++ b/fixco_custom/models/sale_order_multi_invoices.py @@ -9,9 +9,9 @@ class SaleOrderMultiInvoices(models.TransientModel): so_ids = self._context.get('so_ids', []) sale_orders = self.env['sale.order'].browse(so_ids) for sale in sale_orders: - queue_job = self.env['queue.job'].search([('res_id', '=', sale.id), ('method_name', '=', 'create_invoices')], limit=1) - if queue_job: - continue + # queue_job = self.env['queue.job'].search([('res_id', '=', sale.id), ('method_name', '=', 'create_invoices')], limit=1) + # if queue_job: + # continue self.env['queue.job'].create({ 'name': f'Create Invoice {sale.name}', 'model_name': 'sale.order', diff --git a/fixco_custom/views/account_move.xml b/fixco_custom/views/account_move.xml index ee3cd20..3618ec7 100644 --- a/fixco_custom/views/account_move.xml +++ b/fixco_custom/views/account_move.xml @@ -65,7 +65,7 @@ </xpath> <field name="payment_reference" position="after"> - <field name="invoice_marketplace" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> + <field name="invoice_marketplace" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('out_invoice','out_refund'))]}"/> <field name="faktur_pajak" readonly="1" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/> <field name="transaction_type" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> </field> @@ -87,7 +87,7 @@ </field> <field name="invoice_date" position="after"> <field name="approval_refund" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('entry'))]}"/> - <field name="sale_id" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('out_invoice','entry'))]}"/> + <field name="sale_id" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('out_invoice','entry', 'out_refund'))]}"/> <field name="purchase_order_id" readonly="1" attrs="{'invisible': [('move_type', 'not in', ('in_invoice','entry'))]}"/> <field name="soo_number" readonly="1"/> <field name="picking_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> |
