Merge lp:~numerigraphe-team/ocb-addons/7.0-inventory-dummy-moves-test into lp:ocb-addons

Proposed by Lionel Sausin - Initiatives/Numérigraphe
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~numerigraphe-team/ocb-addons/7.0-inventory-dummy-moves-test
Merge into: lp:ocb-addons
Diff against target: 63 lines (+48/-0)
2 files modified
stock/ (+1/-0)
stock/test/stock_inventory_dummy_moves.yml (+47/-0)
To merge this branch: bzr merge lp:~numerigraphe-team/ocb-addons/7.0-inventory-dummy-moves-test
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Stefan Rijnhart (Opener) Needs Information
Loïc Bellier - Numérigraphe (community) code review Approve
Review via email:
To post a comment you must log in.
Revision history for this message
Loïc Bellier - Numérigraphe (lb-b) :
review: Approve (code review)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Looks good in general, but I'm slightly puzzled the exception handling. Is it know when it raises and when it doesn't? Doesn't the occurrence of the exception render the test meaningless? And does that not make the whole excercise moot?

review: Needs Information
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Stefan you're probably right, I'll look into this and let you know.

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Fixed, still green in runbot.

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10084. By Numérigraphe

[FIX] don't ignore exceptions in the test, that would render the test useless.

10083. By Numérigraphe

[MERGE] latest ocb branch

10082. By Numérigraphe

[MERGE] update test to demo dataset in v7

10081. By Numérigraphe

[MERGE] Add a test for bug 1228156: Wizard "Fill inventory" creates wrong lines for moves where source=destination

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/'
2--- stock/ 2014-04-04 18:52:40 +0000
3+++ stock/ 2014-05-16 08:48:48 +0000
4@@ -96,6 +96,7 @@
5 'test/shipment.yml',
6 'test/stock_report.yml',
7 'test/stock_move_chain_validation.yml',
8+ 'test/stock_inventory_dummy_moves.yml',
9 ],
10 'installable': True,
11 'application': True,
13=== added file 'stock/test/stock_inventory_dummy_moves.yml'
14--- stock/test/stock_inventory_dummy_moves.yml 1970-01-01 00:00:00 +0000
15+++ stock/test/stock_inventory_dummy_moves.yml 2014-05-16 08:48:48 +0000
16@@ -0,0 +1,47 @@
18+ This file test will verify the bug reported at
19+ In order to test the bug fix, I will create stock move with same location for source and destination location,
20+ create inventory, import inventory lines
22+ I create stock move with same source and destination location for product_pc2.
24+ !record {model: stock.move, id: same_location_move}:
25+ name: 'Test move with same source and destination location'
26+ location_id: stock_location_14
27+ location_dest_id: stock_location_14
28+ product_id: product.product_product_9
29+ product_qty: 12.0
30+ product_uom: product.product_uom_unit
31+ state: 'done'
33+ I create inventory.
35+ !record {model: stock.inventory, id: stock_inventory_same_location}:
36+ company_id: base.main_company
37+ date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
38+ date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
39+ name: Physical inventory
40+ state: draft
42+ I create a stock.fill.inventory wizard .
44+ !record {model: stock.fill.inventory, id: stock_fill_inventory_1}:
45+ location_id: stock.stock_location_14
47+ I fill the inventory for location stock_location_14.
49+ !python {model: stock.fill.inventory}: |
50+ from osv import osv
51+ self.fill_inventory(cr, uid, [ref("stock_fill_inventory_1")], {"lang": 'en_US',
52+ "full": "1", "tz": False, "active_model": "stock.inventory", "active_ids":
53+ [ref("stock_inventory_same_location")], "active_id": ref("stock_inventory_same_location"), })
55+ I confirm and validate inventory - the quantity available must not change
57+ !python {model: stock.inventory}: |
58+ prod_obj = self.pool.get("product.product")
59+ old_qty =, uid, [ref('product.product_product_9')], ['qty_available'])[0]['qty_available']
60+ self.action_confirm(cr,uid,[ref('stock_inventory_same_location')])
61+ self.action_done(cr,uid,[ref('stock_inventory_same_location')])
62+ new_qty =, uid, [ref('product.product_product_9')], ['qty_available'])[0]['qty_available']
63+ assert old_qty == new_qty, "The quantity available should not change (%s -> %s)." % (old_qty, new_qty)