diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-09 15:05:17 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-09 15:05:17 +0700 |
| commit | 48e5f880d0587964c15c88827ba21cf932928a44 (patch) | |
| tree | 47dcd1f6fa4316e4b2dbec65dbee59967f1f21fc /indoteknik_custom/models | |
| parent | a48ae105c865e710227e12b666fa601a326d12a7 (diff) | |
add field date_completed on account_move and sort default_order by date_order asc
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index c3cd7ef9..207ccee1 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -1,6 +1,7 @@ from odoo import models, api, fields from odoo.exceptions import AccessError, UserError, ValidationError -from datetime import timedelta, date +from datetime import timedelta, date, datetime +from pytz import timezone, utc import logging import base64 import PyPDF2 @@ -28,6 +29,7 @@ class AccountMove(models.Model): 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') + date_completed = fields.Datetime(string='Date Completed') @api.onchange('efaktur_id') def change_efaktur_id(self): @@ -90,8 +92,10 @@ class AccountMove(models.Model): # raise UserError('Hanya Accounting yang bisa Posting') # if self._name == 'account.move': for entry in self: + entry.date_completed = datetime.utcnow() for line in entry.line_ids: line.date_maturity = entry.date + return res def _compute_invoice_day_to_due(self): |
