[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

This commit is contained in:
qdp-odoo
2015-05-20 11:56:51 +02:00
committed by Quentin De Paoli
parent 72dba4f051
commit f366bda9a7
+2 -1
View File
@@ -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: