Merge lp:~camptocamp/prestashoperpconnect/tax-included-on-shipping-line into lp:~arthru/prestashoperpconnect/tax-included-in-prices

Proposed by Romain Deheele - Camptocamp
Status: Merged
Merged at revision: 277
Proposed branch: lp:~camptocamp/prestashoperpconnect/tax-included-on-shipping-line
Merge into: lp:~arthru/prestashoperpconnect/tax-included-in-prices
Diff against target: 30 lines (+10/-7)
1 file modified
prestashoperpconnect/unit/mapper.py (+10/-7)
To merge this branch: bzr merge lp:~camptocamp/prestashoperpconnect/tax-included-on-shipping-line
Reviewer Review Type Date Requested Status
arthru Pending
Review via email: mp+193015@code.launchpad.net

Description of the change

Hi Arthur,

This branch manages shipping line price unit in tax included context.
I propose you to merge this branch in yours to manage entirely tax_included topic.

Regards,

Romain

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 'prestashoperpconnect/unit/mapper.py'
2--- prestashoperpconnect/unit/mapper.py 2013-10-25 13:46:43 +0000
3+++ prestashoperpconnect/unit/mapper.py 2013-10-29 08:42:13 +0000
4@@ -384,16 +384,19 @@
5
6 def _after_mapping(self, result):
7 sess = self.session
8+ backend = self.backend_record
9 order_line_ids = []
10 if 'prestashop_order_line_ids' in result:
11 order_line_ids = result['prestashop_order_line_ids']
12- result = sess.pool['sale.order']._convert_special_fields(
13- sess.cr,
14- sess.uid,
15- result,
16- order_line_ids,
17- sess.context
18- )
19+ taxes_included = backend.taxes_included
20+ with self.session.change_context({'is_tax_included': taxes_included}):
21+ result = sess.pool['sale.order']._convert_special_fields(
22+ sess.cr,
23+ sess.uid,
24+ result,
25+ order_line_ids,
26+ sess.context
27+ )
28 onchange = self.get_connector_unit_for_model(SaleOrderOnChange)
29 order_line_ids = []
30 if 'prestashop_order_line_ids' in result:

Subscribers

People subscribed via source and target branches

to all changes: