Merge lp:~camptocamp/openobject-addons/7.0-595239-opw-skh-afe into lp:openobject-addons/7.0

Proposed by Alexandre Fayolle - camptocamp on 2014-01-09
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-addons/7.0-595239-opw-skh-afe
Merge into: lp:openobject-addons/7.0
Diff against target: 77 lines (+50/-1)
3 files modified
delivery/__openerp__.py (+3/-1)
delivery/stock.py (+6/-0)
delivery/test/delivery_tracking_ref_backorder.yml (+41/-0)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/7.0-595239-opw-skh-afe
Reviewer Review Type Date Requested Status
OpenERP Core Team 2014-01-09 Pending
Review via email: mp+201002@code.launchpad.net

Description of the change

fix partial delivery will copy tracking number in the backorder picking

The fix comes from lp:~openerp-dev/openobject-addons/7.0-595239-opw-skh and I added a yaml test.

To post a comment you must log in.
9749. By Alexandre Fayolle - camptocamp on 2014-01-09

try to understand why red on runbot and not on my machine...

9750. By Alexandre Fayolle - camptocamp on 2014-01-09

fix test: really do a partial delivery

9751. By Alexandre Fayolle - camptocamp on 2014-01-09

remove test debugging code

9752. By Alexandre Fayolle - camptocamp on 2014-02-11

[MRG] sync with current stable head

Unmerged revisions

9752. By Alexandre Fayolle - camptocamp on 2014-02-11

[MRG] sync with current stable head

9751. By Alexandre Fayolle - camptocamp on 2014-01-09

remove test debugging code

9750. By Alexandre Fayolle - camptocamp on 2014-01-09

fix test: really do a partial delivery

9749. By Alexandre Fayolle - camptocamp on 2014-01-09

try to understand why red on runbot and not on my machine...

9748. By Alexandre Fayolle - camptocamp on 2014-01-09

[ADD] test for fix

9747. By Somesh Khare(OpenERP) <email address hidden> on 2013-07-30

[FIX]delivery: delivery - partial delivery will copy tracking number in the backorder picking (Case: ref 595239)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'delivery/__openerp__.py'
2--- delivery/__openerp__.py 2012-11-29 22:26:45 +0000
3+++ delivery/__openerp__.py 2014-02-11 09:14:17 +0000
4@@ -41,7 +41,9 @@
5 'delivery_data.xml'
6 ],
7 'demo': ['delivery_demo.xml'],
8- 'test': ['test/delivery_cost.yml'],
9+ 'test': ['test/delivery_cost.yml',
10+ 'test/delivery_tracking_ref_backorder.yml',
11+ ],
12 'installable': True,
13 'auto_install': False,
14 'images': ['images/1_delivery_method.jpeg','images/2_delivery_pricelist.jpeg'],
15
16=== modified file 'delivery/stock.py'
17--- delivery/stock.py 2013-11-19 18:18:55 +0000
18+++ delivery/stock.py 2014-02-11 09:14:17 +0000
19@@ -51,6 +51,12 @@
20 result[line.picking_id.id] = True
21 return result.keys()
22
23+ def write(self, cr, uid, ids, vals, context=None):
24+ if context is None: context = {}
25+ if vals.get('backorder_id'):
26+ vals.update(carrier_tracking_ref = '')
27+ return super(stock_picking, self).write(cr, uid, ids, vals, context=context)
28+
29 _columns = {
30 'carrier_id':fields.many2one("delivery.carrier","Carrier"),
31 'volume': fields.float('Volume'),
32
33=== added file 'delivery/test/delivery_tracking_ref_backorder.yml'
34--- delivery/test/delivery_tracking_ref_backorder.yml 1970-01-01 00:00:00 +0000
35+++ delivery/test/delivery_tracking_ref_backorder.yml 2014-02-11 09:14:17 +0000
36@@ -0,0 +1,41 @@
37+-
38+ In order to partial delivery with tracking number
39+-
40+ I create an outgoing picking
41+-
42+ !record {model: stock.picking, id: outgoing_shipment}:
43+ type: out
44+ carrier_tracking_ref: ABC12345
45+ volume: 2
46+ number_of_packages: 2
47+-
48+ !record {model: stock.move, id: outgoing_move}:
49+ picking_id: outgoing_shipment
50+ product_id: product.product_product_8
51+ product_uom: product.product_uom_unit
52+ product_qty: 2
53+ location_id: stock.stock_location_stock
54+ location_dest_id: stock.stock_location_customers
55+-
56+ I confirm the picking
57+-
58+ !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment}
59+-
60+ I make a partial delivery
61+-
62+ !python {model: stock.partial.picking}: |
63+ pick_ids = [ref("outgoing_shipment")]
64+ partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': pick_ids})
65+ partial = self.browse(cr, uid, partial_id, context=context)
66+ partial.move_ids[0].write({'quantity': 1})
67+ self.do_partial(cr, uid, [partial_id])
68+-
69+ I check backorder shipment after partial delivery.
70+-
71+ !python {model: stock.picking}: |
72+ shipment = self.browse(cr, uid, ref("delivery.outgoing_shipment"))
73+ backorder = shipment.backorder_id
74+ assert backorder, "Backorder should be created after partial shipment."
75+ assert backorder.state == 'done', "Backorder should be close after received"
76+ assert backorder.carrier_tracking_ref == 'ABC12345', 'wrong tracking ref on done picking'
77+ assert not shipment.carrier_tracking_ref, 'remaining picking must have no tracking ref'