Skip to content

Commit

Permalink
Fix test incompatibility with stock_reserve_rule
Browse files Browse the repository at this point in the history
The rules created in demo data of stock_reserve_rule make the tests of
stock_vertical_lift (and possibly other modules) fail because the
transfers can't be made available.

Deactivate the rule in stock_reserve_rule and activate it only in its
tests. Users can still activate the rule manually to test.
  • Loading branch information
guewen committed Jul 6, 2020
1 parent 25542c0 commit f1c4afc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions stock_reserve_rule/demo/stock_reserve_rule_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<field name="sequence">1</field>
<field name="location_id" ref="stock.stock_location_stock" />
<field name="company_id" ref="base.main_company" />
<field name="active" eval="False" />
</record>
<record id="stock_reserve_rule_removal_1_demo" model="stock.reserve.rule.removal">
<field name="rule_id" ref="stock_reserve_rule_1_demo" />
Expand Down
4 changes: 2 additions & 2 deletions stock_reserve_rule/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ A product: Funky Socks
Scenario:

* Activate Storage Locations and Multi-Warehouses
* You can open Inventory > Configuration > Stock Reservation Rules to see the
rules
* You can open Inventory > Configuration > Stock Reservation Rules to activate
and see the rules (by default in demo, the rules are created inactive)
* Open Transfer: Outgoing shipment (reservation rules demo 1)
* Check availability: it has 150 units, as it will not empty Zone A, it will not
take products there, it should take 100 in B and 50 in C (following the rules
Expand Down
2 changes: 2 additions & 0 deletions stock_reserve_rule/tests/test_reserve_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def setUpClass(cls):
"code": "WHTEST",
}
)
cls.rule = cls.env.ref("stock_reserve_rule.stock_reserve_rule_1_demo")
cls.rule.active = True

cls.customer_loc = cls.env.ref("stock.stock_location_customers")

Expand Down

0 comments on commit f1c4afc

Please sign in to comment.