Merge lp:~openerp-connector-community/openerp-connector-magento/7.0-magentoerpconnect-carrier-export-1238951 into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0

Proposed by Guewen Baconnier @ Camptocamp on 2013-10-12
Status: Merged
Merged at revision: 929
Proposed branch: lp:~openerp-connector-community/openerp-connector-magento/7.0-magentoerpconnect-carrier-export-1238951
Merge into: lp:~openerp-connector-core-editors/openerp-connector-magento/7.0
Diff against target: 24 lines (+7/-1)
1 file modified
magentoerpconnect/stock_tracking.py (+7/-1)
To merge this branch: bzr merge lp:~openerp-connector-community/openerp-connector-magento/7.0-magentoerpconnect-carrier-export-1238951
Reviewer Review Type Date Requested Status
Allison (community) Approve on 2013-10-15
Brendan Clune (Logic Supply) (community) Approve on 2013-10-14
OpenERP Connector Core Editors 2013-10-12 Pending
Review via email: mp+190813@code.launchpad.net
To post a comment you must log in.

LGTM, haven't tested but Allison Miller will test today and provide a review.

review: Approve
Allison (allison-miller) wrote :

Works great, thanks for the quick work

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/stock_tracking.py'
2--- magentoerpconnect/stock_tracking.py 2013-05-01 12:33:18 +0000
3+++ magentoerpconnect/stock_tracking.py 2013-10-12 19:55:10 +0000
4@@ -80,13 +80,19 @@
5 if not picking.carrier_tracking_ref:
6 return _('No tracking number to send.')
7
8+ sale_binding_id = picking.magento_order_id
9+ if not sale_binding_id:
10+ return FailedJobError("No sales order is linked with the picking "
11+ "%s, can't export the tracking number." %
12+ picking.name)
13+
14 magento_picking_id = picking.magento_id
15 if magento_picking_id is None:
16 raise NoExternalId("No value found for the picking ID on "
17 "Magento side, the job will be retried later.")
18
19 self._validate(picking)
20- self._check_allowed_carrier(picking, magento_picking_id)
21+ self._check_allowed_carrier(picking, sale_binding_id.magento_id)
22 tracking_args = self._get_tracking_args(picking)
23 self.backend_adapter.add_tracking_number(magento_picking_id,
24 *tracking_args)