diff options
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 53e5a8e8..bf7e2d68 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -94,6 +94,23 @@ 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 + ) + + if payment: + move.payment_date = payment[0].date + elif move.reklas_misc_id: + move.payment_date = move.reklas_misc_id.date + else: + move.payment_date = False + # def name_get(self): # result = [] # for move in self: |
