Merge lp:~openerp-dev/openobject-addons/6.0-opw-50878-pso into lp:openobject-addons/6.0

Proposed by Priyesh (OpenERP)
Status: Rejected
Rejected by: nel
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-50878-pso
Merge into: lp:openobject-addons/6.0
Diff against target: 28 lines (+6/-4)
1 file modified
account/account_move_line.py (+6/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-50878-pso
Reviewer Review Type Date Requested Status
nel (community) Disapprove
Naresh(OpenERP) (community) Approve
Review via email: mp+84459@code.launchpad.net

Description of the change

Hello,

To reproduce the issue:

1. Configure a tax included in price with amount 0.2 also assign tax invoice tax accounts,account tax code
2. Go to accounting -> journal entries -> journal entries
3. Create a move line with credit = 100 and tax = the previously created tax
4. Save

You get 2 lines:
tax line with credit = 16.67 (correct)
base line with credit = 100 (wrong)

base line should be 83.33

Can you please share your views ?

Thanks,
Priyesh

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
nel (nel-tinyerp) wrote :

This will give a strange behavior to the system. Suppose a user, that doesn't know about this feature, enters a value 100(like in your example). This user expects the system to keep this value and not to calculate it. So that's why, we suppose that accountant or users that create vouchers basing on tax included, should enter right amounts in all cases.
We prefer avoid making such calculation on fillable fields because it could cause many problems.

review: Disapprove

Unmerged revisions

4945. By Lorenzo Battistini - Agile BG - Domsense

[IMP] account: Improved create method of move line to create the correct entries(case:50878)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2011-11-22 10:49:26 +0000
+++ account/account_move_line.py 2011-12-05 11:39:35 +0000
@@ -1319,7 +1319,9 @@
1319 tmp_cnt += 11319 tmp_cnt += 1
1320 self.write(cr, uid,[result], {1320 self.write(cr, uid,[result], {
1321 'tax_code_id': tax[base_code],1321 'tax_code_id': tax[base_code],
1322 'tax_amount': tax[base_sign] * abs(total)1322 'tax_amount': tax[base_sign] * abs(tax['price_unit']),
1323 'credit': tax['price_unit']<0 and -tax['price_unit'] or 0.0,
1324 'debit': tax['price_unit']>0 and tax['price_unit'] or 0.0,
1323 })1325 })
1324 else:1326 else:
1325 data = {1327 data = {
@@ -1332,10 +1334,10 @@
1332 'ref': vals.get('ref',False),1334 'ref': vals.get('ref',False),
1333 'account_tax_id': False,1335 'account_tax_id': False,
1334 'tax_code_id': tax[base_code],1336 'tax_code_id': tax[base_code],
1335 'tax_amount': tax[base_sign] * abs(total),1337 'tax_amount': tax[base_sign] * abs(tax['price_unit']),
1336 'account_id': vals['account_id'],1338 'account_id': vals['account_id'],
1337 'credit': 0.0,1339 'credit': tax['price_unit']<0 and -tax['price_unit'] or 0.0,
1338 'debit': 0.0,1340 'debit': tax['price_unit']>0 and tax['price_unit'] or 0.0,
1339 }1341 }
1340 if data['tax_code_id']:1342 if data['tax_code_id']:
1341 self.create(cr, uid, data, context)1343 self.create(cr, uid, data, context)