From f366bda9a7edbcd7e7a8d791278d98ea57b15f31 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Wed, 20 May 2015 10:39:00 +0200 Subject: [PATCH] [IMP] account: set the date_maturity field on account.move.line as required for the sake of being more explicit, and having the aged receivable/payable reports that work --- addons/account/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_move.py b/addons/account/account_move.py index ee8ad4e3ed5..47e9db39d74 100644 --- a/addons/account/account_move.py +++ b/addons/account/account_move.py @@ -331,7 +331,7 @@ class AccountMoveLine(models.Model): default=_get_journal, required=True, index=True, store=True, copy=False) blocked = fields.Boolean(string='No Follow-up', default=False, help="You can check this box to mark this journal item as a litigation with the associated partner") - date_maturity = fields.Date(string='Due date', index=True, + date_maturity = fields.Date(string='Due date', index=True, required=True, help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line.") date = fields.Date(related='move_id.date', string='Effective date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False) analytic_lines = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines') @@ -882,6 +882,7 @@ class AccountMoveLine(models.Model): journal = self.env['account.journal'].browse(context['journal_id']) vals['journal_id'] = vals.get('journal_id') or context.get('journal_id') vals['date'] = vals.get('date') or context.get('date') + vals['date_maturity'] = vals.get('date_maturity') if vals.get('date_maturity') else vals['date'] if not move_id: if not vals.get('move_id', False): if journal.sequence_id: