summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/account/models/account_analytic_line.py2
-rw-r--r--addons/account/models/account_move.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py
index 39ea202796c..83faccaa15c 100644
--- a/addons/account/models/account_analytic_line.py
+++ b/addons/account/models/account_analytic_line.py
@@ -11,7 +11,7 @@ class AccountAnalyticLine(models.Model):
amount = fields.Monetary(currency_field='company_currency_id')
product_uom_id = fields.Many2one('product.uom', string='Unit of Measure')
product_id = fields.Many2one('product.product', string='Product')
- general_account_id = fields.Many2one('account.account', string='Financial Account', ondelete='restrict',
+ general_account_id = fields.Many2one('account.account', string='Financial Account', ondelete='restrict', readonly=True,
related='move_id.account_id', store=True, domain=[('deprecated', '=', False)])
move_id = fields.Many2one('account.move.line', string='Move Line', ondelete='cascade', index=True)
code = fields.Char(size=8)
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 59ae9883a9c..fcc0460691a 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -1074,7 +1074,7 @@ class AccountMoveLine(models.Model):
err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id))
if line.move_id.state != 'draft':
raise UserError(_('You cannot do this modification on a posted journal entry, you can just change some non legal fields. You must revert the journal entry to cancel it.\n%s.') % err_msg)
- if line.reconciled:
+ if line.reconciled and not (line.debit == 0 and line.credit == 0):
raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)
if line.move_id.id not in move_ids:
move_ids.add(line.move_id.id)