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/__openerp__.py (+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: mp+215453@code.launchpad.net
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 https://github.com/OCA/ocb - 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
=== modified file 'stock/__openerp__.py'
--- stock/__openerp__.py 2014-04-04 18:52:40 +0000
+++ stock/__openerp__.py 2014-05-16 08:48:48 +0000
@@ -96,6 +96,7 @@
96 'test/shipment.yml',96 'test/shipment.yml',
97 'test/stock_report.yml',97 'test/stock_report.yml',
98 'test/stock_move_chain_validation.yml',98 'test/stock_move_chain_validation.yml',
99 'test/stock_inventory_dummy_moves.yml',
99 ],100 ],
100 'installable': True,101 'installable': True,
101 'application': True,102 'application': True,
102103
=== added file 'stock/test/stock_inventory_dummy_moves.yml'
--- stock/test/stock_inventory_dummy_moves.yml 1970-01-01 00:00:00 +0000
+++ stock/test/stock_inventory_dummy_moves.yml 2014-05-16 08:48:48 +0000
@@ -0,0 +1,47 @@
1-
2 This file test will verify the bug reported at https://bugs.launchpad.net/openobject-addons/+bug/1228156.
3 In order to test the bug fix, I will create stock move with same location for source and destination location,
4 create inventory, import inventory lines
5-
6 I create stock move with same source and destination location for product_pc2.
7-
8 !record {model: stock.move, id: same_location_move}:
9 name: 'Test move with same source and destination location'
10 location_id: stock_location_14
11 location_dest_id: stock_location_14
12 product_id: product.product_product_9
13 product_qty: 12.0
14 product_uom: product.product_uom_unit
15 state: 'done'
16-
17 I create inventory.
18-
19 !record {model: stock.inventory, id: stock_inventory_same_location}:
20 company_id: base.main_company
21 date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
22 date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
23 name: Physical inventory
24 state: draft
25-
26 I create a stock.fill.inventory wizard .
27-
28 !record {model: stock.fill.inventory, id: stock_fill_inventory_1}:
29 location_id: stock.stock_location_14
30-
31 I fill the inventory for location stock_location_14.
32-
33 !python {model: stock.fill.inventory}: |
34 from osv import osv
35 self.fill_inventory(cr, uid, [ref("stock_fill_inventory_1")], {"lang": 'en_US',
36 "full": "1", "tz": False, "active_model": "stock.inventory", "active_ids":
37 [ref("stock_inventory_same_location")], "active_id": ref("stock_inventory_same_location"), })
38-
39 I confirm and validate inventory - the quantity available must not change
40-
41 !python {model: stock.inventory}: |
42 prod_obj = self.pool.get("product.product")
43 old_qty = prod_obj.read(cr, uid, [ref('product.product_product_9')], ['qty_available'])[0]['qty_available']
44 self.action_confirm(cr,uid,[ref('stock_inventory_same_location')])
45 self.action_done(cr,uid,[ref('stock_inventory_same_location')])
46 new_qty = prod_obj.read(cr, uid, [ref('product.product_product_9')], ['qty_available'])[0]['qty_available']
47 assert old_qty == new_qty, "The quantity available should not change (%s -> %s)." % (old_qty, new_qty)