Merge lp:~openerp-dev/openobject-addons/trunk-bug-1084822-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1084822-bde
Merge into: lp:openobject-addons
Diff against target: 28 lines (+9/-2)
1 file modified
account/account_invoice.py (+9/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1084822-bde
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+200068@code.launchpad.net

Description of the change

Hello,

I have checked and applied code of Laetitia Gangloff (Acsone)
which fixes the issue of Global taxes warning on tax analytic account.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
9029. By Bharat Devnani (Open ERP)

[ADD] added comment

Unmerged revisions

9029. By Bharat Devnani (Open ERP)

[ADD] added comment

9028. By Laetitia Gangloff (Acsone)

[FIX] [Account] : Global taxes warning on tax analytic account

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2013-10-27 12:31:04 +0000
3+++ account/account_invoice.py 2013-12-26 13:11:51 +0000
4@@ -1681,7 +1681,7 @@
5 'invoice_id': fields.many2one('account.invoice', 'Invoice Line', ondelete='cascade', select=True),
6 'name': fields.char('Tax Description', size=64, required=True),
7 'account_id': fields.many2one('account.account', 'Tax Account', required=True, domain=[('type','<>','view'),('type','<>','income'), ('type', '<>', 'closed')]),
8- 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic account'),
9+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic account', readonly=True),
10 'base': fields.float('Base', digits_compute=dp.get_precision('Account')),
11 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
12 'manual': fields.boolean('Manual'),
13@@ -1758,7 +1758,14 @@
14 val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False)
15 val['account_id'] = tax['account_paid_id'] or line.account_id.id
16 val['account_analytic_id'] = tax['account_analytic_paid_id']
17-
18+
19+ # If the taxes generate moves on the same financial account as the invoice line
20+ # and no default analytic account is defined at the tax level, propagate the
21+ # analytic account from the invoice line to the tax line. This is necessary
22+ # in situations were (part of) the taxes cannot be reclaimed,
23+ # to ensure the tax move is allocated to the proper analytic account.
24+ if not val.get('account_analytic_id') and line.account_analytic_id and val['account_id'] == line.account_id.id:
25+ val['account_analytic_id'] = line.account_analytic_id.id
26 key = (val['tax_code_id'], val['base_code_id'], val['account_id'], val['account_analytic_id'])
27 if not key in tax_grouped:
28 tax_grouped[key] = val

Subscribers

People subscribed via source and target branches

to all changes: