diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-05 11:24:34 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-05 11:24:34 +0700 |
| commit | eb91fb8b9cf3ebc68f6c609acbc85015ce902cab (patch) | |
| tree | e5e3fcaee4dadc01e473b396005f11dd371a59a6 | |
| parent | 519c18161bf658853908ddf7216aab504ac4c743 (diff) | |
add payment date on invoices
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 1a6fad1c..929af949 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -94,6 +94,18 @@ class AccountMove(models.Model): compute='_compute_has_refund_so', ) + payment_date = fields.Date(string="Payment Date", compute='_compute_payment_date') + + def _compute_payment_date(self): + for move in self: + accountPayment = self.env['account.payment'] + + payment = accountPayment.search([]).filtered( + lambda p: move.id in p.reconciled_invoice_ids.ids + ) + + move.payment_date = payment[0].date + # def name_get(self): # result = [] # for move in self: diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 9b1c791b..23f2d931 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -29,6 +29,7 @@ </field> <field name="payment_reference" position="after"> <field name="date_completed" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> + <field name="payment_date" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> <field name="reklas_id" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> </field> <field name="invoice_date" position="after"> |
