Merge lp:~savoirfairelinux-openerp/openobject-addons/fix_l10n_ca_70_tvq into lp:openobject-addons/7.0

Proposed by Jonatan Cloutier
Status: Rejected
Rejected by: Martin Trigaux (OpenERP)
Proposed branch: lp:~savoirfairelinux-openerp/openobject-addons/fix_l10n_ca_70_tvq
Merge into: lp:openobject-addons/7.0
Diff against target: 55 lines (+12/-8)
2 files modified
l10n_ca/account_tax_en.xml (+6/-4)
l10n_ca/account_tax_fr.xml (+6/-4)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openobject-addons/fix_l10n_ca_70_tvq
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Needs Information
Review via email: mp+163013@code.launchpad.net

This proposal supersedes a proposal from 2013-05-08.

Description of the change

Fix the quebec, canada tax calculation

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,
Could you please explain why you made these changes, I don't see the difference.
Regards,

review: Needs Information
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

When we use the amount field to set the rate, the value is rounded to 0.998, which leads to wrong computation.

Using the python_compute field solves this issue.

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,
I understand your problem. This was due to an constant precision in the tax templates of 4 digits.
I fixed this in addons v7 (revision number: 9165, revision-id: <email address hidden>). The new behaviour is : Accounting decimal precision + 3
You can change the decimal precision in Settings > Accounting if needed.

In the trunk version, the new behaviour will be to store the percentage (9.975 instead of 0.09975). This should prevent most rounding issues once the next version is released.

I reject this patch as no longer required for your problem.

Regards

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ca/account_tax_en.xml'
2--- l10n_ca/account_tax_en.xml 2012-12-06 21:54:24 +0000
3+++ l10n_ca/account_tax_en.xml 2013-05-08 17:08:56 +0000
4@@ -132,8 +132,9 @@
5 <field name="name">TVQ for sales - 9.975%</field>
6 <field name="description">TVQ</field>
7 <field name="type_tax_use">sale</field>
8- <field name="amount">0.099750</field>
9- <field name="type">percent</field>
10+ <field name="python_compute">result = price_unit * 0.09975</field>
11+ <field name="python_compute_inv">result = price_unit * 0.09975</field>
12+ <field name="type">code</field>
13 <field name="sequence">2</field>
14 <field name="account_collected_id" ref="chart2132_en"/>
15 <field name="account_paid_id" ref="chart2132_en"/>
16@@ -401,8 +402,9 @@
17 <field name="name">TVQ for purchases - 9.975%</field>
18 <field name="description">TVQ</field>
19 <field name="type_tax_use">purchase</field>
20- <field name="amount">0.099750</field>
21- <field name="type">percent</field>
22+ <field name="python_compute">result = price_unit * 0.09975</field>
23+ <field name="python_compute_inv">result = price_unit * 0.09975</field>
24+ <field name="type">code</field>
25 <field name="sequence">2</field>
26 <field name="account_collected_id" ref="chart1182_en"/>
27 <field name="account_paid_id" ref="chart1182_en"/>
28
29=== modified file 'l10n_ca/account_tax_fr.xml'
30--- l10n_ca/account_tax_fr.xml 2012-12-06 21:54:24 +0000
31+++ l10n_ca/account_tax_fr.xml 2013-05-08 17:08:56 +0000
32@@ -132,8 +132,9 @@
33 <field name="name">TVQ sur les ventes - 9.975%</field>
34 <field name="description">TVQ</field>
35 <field name="type_tax_use">sale</field>
36- <field name="amount">0.099750</field>
37- <field name="type">percent</field>
38+ <field name="python_compute">result = price_unit * 0.09975</field>
39+ <field name="python_compute_inv">result = price_unit * 0.09975</field>
40+ <field name="type">code</field>
41 <field name="sequence">2</field>
42 <field name="account_collected_id" ref="chart2132_fr"/>
43 <field name="account_paid_id" ref="chart2132_fr"/>
44@@ -401,8 +402,9 @@
45 <field name="name">TVQ sur les achats - 9.975%</field>
46 <field name="description">TVQ</field>
47 <field name="type_tax_use">purchase</field>
48- <field name="amount">0.099750</field>
49- <field name="type">percent</field>
50+ <field name="python_compute">result = price_unit * 0.09975</field>
51+ <field name="python_compute_inv">result = price_unit * 0.09975</field>
52+ <field name="type">code</field>
53 <field name="sequence">2</field>
54 <field name="account_collected_id" ref="chart1182_fr"/>
55 <field name="account_paid_id" ref="chart1182_fr"/>