diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index fb44df3dbed..66019eaa59e 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -263,9 +263,6 @@ class AccountMove(models.Model):
journal_id=journal_id,
auto=auto)
reversed_moves |= reversed_move
- #unreconcile all lines reversed
- aml = ac_move.line_ids.filtered(lambda x: x.account_id.reconcile or x.account_id.internal_type == 'liquidity')
- aml.remove_move_reconcile()
#reconcile together the reconcilable (or the liquidity aml) and their newly created counterpart
for account in set([x.account_id for x in aml]):
to_rec = aml.filtered(lambda y: y.account_id == account)
@@ -283,6 +280,18 @@ class AccountMove(models.Model):
def open_reconcile_view(self):
return self.line_ids.open_reconcile_view()
+ # FIXME: Clarify me and change me in master
+ @api.multi
+ def action_duplicate(self):
+ self.ensure_one()
+ action = self.env.ref('account.action_move_journal_line').read()[0]
+ action['target'] = 'inline'
+ action['context'] = dict(self.env.context)
+ action['context']['view_no_maturity'] = False
+ action['views'] = [(self.env.ref('account.view_move_form').id, 'form')]
+ action['res_id'] = self.copy().id
+ return action
+
@api.model
def _run_reverses_entries(self):
''' This method is called from a cron job. '''
@@ -467,7 +476,7 @@ class AccountMoveLine(models.Model):
index=True, store=True, copy=False) # related is required
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, required=True,
+ date_maturity = fields.Date(string='Due date', index=True, required=True, copy=False,
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='Date', index=True, store=True, copy=False) # related is required
analytic_line_ids = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines', oldname="analytic_lines")
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py
index 0173c8bafee..b1bcb28e12e 100644
--- a/addons/account/models/partner.py
+++ b/addons/account/models/partner.py
@@ -204,7 +204,7 @@ class ResPartner(models.Model):
@api.multi
def _credit_debit_get(self):
- tables, where_clause, where_params = self.env['account.move.line']._query_get()
+ tables, where_clause, where_params = self.env['account.move.line'].with_context(company_id=self.env.user.company_id.id)._query_get()
where_params = [tuple(self.ids)] + where_params
if where_clause:
where_clause = 'AND ' + where_clause
diff --git a/addons/account/static/src/js/account_payment_field.js b/addons/account/static/src/js/account_payment_field.js
index 1e5171e1f44..7d074a685c5 100644
--- a/addons/account/static/src/js/account_payment_field.js
+++ b/addons/account/static/src/js/account_payment_field.js
@@ -159,4 +159,8 @@ var ShowPaymentLineWidget = AbstractField.extend({
field_registry.add('payment', ShowPaymentLineWidget);
+return {
+ ShowPaymentLineWidget: ShowPaymentLineWidget
+};
+
});
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index 03ebd6038b8..6e453e1eb32 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -1502,10 +1502,11 @@
account.move.form
account.move
-