Merge lp:~camptocamp/openerp-connector-ecommerce/7.0-related_backorder_ids_copy-rde into lp:~openerp-connector-core-editors/openerp-connector-ecommerce/7.0

Proposed by Romain Deheele - Camptocamp
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 350
Merged at revision: 351
Proposed branch: lp:~camptocamp/openerp-connector-ecommerce/7.0-related_backorder_ids_copy-rde
Merge into: lp:~openerp-connector-core-editors/openerp-connector-ecommerce/7.0
Diff against target: 38 lines (+12/-2)
1 file modified
connector_ecommerce/stock.py (+12/-2)
To merge this branch: bzr merge lp:~camptocamp/openerp-connector-ecommerce/7.0-related_backorder_ids_copy-rde
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Leonardo Pistone (community) code review Approve
Review via email: mp+214494@code.launchpad.net

Description of the change

Hello,

This MP is linked with https://bugs.launchpad.net/openerp-connector-ecommerce/+bug/1303655
It proposes to do not link related_backorder_ids from an original picking to a new picking copy.

Regards,

Romain

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

lgtm

review: Approve (code review)
351. By Guewen Baconnier @ Camptocamp

do not build a new dict when default is an empty dict, not necessary to build a context dict (not used)

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'connector_ecommerce/stock.py'
2--- connector_ecommerce/stock.py 2013-03-19 09:42:19 +0000
3+++ connector_ecommerce/stock.py 2014-04-24 08:18:47 +0000
4@@ -24,6 +24,7 @@
5 from openerp.addons.connector.session import ConnectorSession
6 from .event import on_picking_out_done, on_tracking_number_added
7
8+
9 class stock_picking(orm.Model):
10 _inherit = 'stock.picking'
11
12@@ -39,8 +40,8 @@
13 session = ConnectorSession(cr, uid, context=context)
14 # Look if it exists a backorder, in that case call for partial
15 picking_records = self.read(cr, uid, ids,
16- ['id', 'related_backorder_ids', 'type'],
17- context=context)
18+ ['id', 'related_backorder_ids', 'type'],
19+ context=context)
20 for picking_vals in picking_records:
21 if picking_vals['type'] != 'out':
22 continue
23@@ -52,6 +53,15 @@
24 picking_vals['id'], picking_method)
25 return res
26
27+ def copy(self, cr, uid, id, default=None, context=None):
28+ if default is None:
29+ default = {}
30+ else:
31+ default = default.copy()
32+ default['related_backorder_ids'] = False
33+ return super(stock_picking, self).copy(cr, uid,
34+ id, default, context=context)
35+
36
37 class stock_picking_out(orm.Model):
38 _inherit = 'stock.picking.out'

Subscribers

People subscribed via source and target branches