summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqdp-odoo <qdp@odoo.com>2015-05-20 10:39:00 +0200
committerQuentin De Paoli <qdp@odoo.com>2015-05-20 11:56:51 +0200
commitf366bda9a7edbcd7e7a8d791278d98ea57b15f31 (patch)
tree6aa59aa215d4bd47af2475d391b05ec90b871d7e
parent72dba4f051190d75682600b0956a355393c98cbf (diff)
[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
-rw-r--r--addons/account/account_move.py3
1 files changed, 2 insertions, 1 deletions
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: