Merge lp:~midwest/e-commerce-addons/e-commerce-addons into lp:~extra-addons-commiter/e-commerce-addons/oerp6.1-stable

Proposed by Kyle Waid
Status: Merged
Merged at revision: 232
Proposed branch: lp:~midwest/e-commerce-addons/e-commerce-addons
Merge into: lp:~extra-addons-commiter/e-commerce-addons/oerp6.1-stable
Diff against target: 19 lines (+2/-2)
1 file modified
base_sale_multichannels/account.py (+2/-2)
To merge this branch: bzr merge lp:~midwest/e-commerce-addons/e-commerce-addons
Reviewer Review Type Date Requested Status
Sébastien BEAU - http://www.akretion.com Pending
Review via email: mp+107113@code.launchpad.net

Description of the change

Allow 'all' tax type for external tax lookup

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_sale_multichannels/account.py'
2--- base_sale_multichannels/account.py 2011-12-29 10:53:06 +0000
3+++ base_sale_multichannels/account.py 2012-05-23 20:21:19 +0000
4@@ -28,13 +28,13 @@
5 def get_tax_from_rate(self, cr, uid, rate, is_tax_included=False, context=None):
6 #TODO improve, if tax are not correctly mapped the order should be in exception (integration with sale_execption)
7 tax_ids = self.pool.get('account.tax').search(cr, uid, [('price_include', '=', is_tax_included),
8- ('type_tax_use', '=', 'sale'), ('amount', '>=', rate - 0.001), ('amount', '<=', rate + 0.001)])
9+ ('type_tax_use', 'in', ['sale', 'all']), ('amount', '>=', rate - 0.001), ('amount', '<=', rate + 0.001)])
10 if tax_ids and len(tax_ids) > 0:
11 return tax_ids[0]
12 else:
13 #try to find a tax with less precision
14 tax_ids = self.pool.get('account.tax').search(cr, uid, [('price_include', '=', is_tax_included),
15- ('type_tax_use', '=', 'sale'), ('amount', '>=', rate - 0.01), ('amount', '<=', rate + 0.01)])
16+ ('type_tax_use', 'in', ['sale', 'all']), ('amount', '>=', rate - 0.01), ('amount', '<=', rate + 0.01)])
17 if tax_ids and len(tax_ids) > 0:
18 return tax_ids[0]
19 return False

Subscribers

People subscribed via source and target branches