diff options
| author | Cedric Snauwaert <csn@openerp.com> | 2016-03-31 10:31:25 +0200 |
|---|---|---|
| committer | Cedric Snauwaert <csn@openerp.com> | 2016-03-31 10:31:29 +0200 |
| commit | 90650245d0e62706bb0d0e1dc809b8e10ec537f4 (patch) | |
| tree | ffe650cf8b09b7bda99dbfa0566e38301643cbf3 /addons/account/models/account_analytic_line.py | |
| parent | fd8570770ddc6546a07a1b9876acf58510d31679 (diff) | |
[FIX] account: update-check should allow aml with debit=credit=0
Problem: if we try to validate an invoice with a line with a discount of 100%,
this will create an aml with debit=credit=0 and reconciled flag as True.
So when trying to cancel invoice, it is not possible because the check tell us
that there is an entry which is reconciled and we can't unreconcile that entry,
so the check should just ignore line with debit-credit=0.
Also add readonly to general_account_id related field on account.analytic.line.
This is to prevent a write while creating the account_move_line in the case of an
invoice with analytic account.
Diffstat (limited to 'addons/account/models/account_analytic_line.py')
| -rw-r--r-- | addons/account/models/account_analytic_line.py | 2 |
1 files changed, 1 insertions, 1 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) |
