Fix test incompatibility with stock_reserve_rule

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.
This commit is contained in:
Guewen Baconnier
2020-07-06 14:58:55 +02:00
parent 3f68e5caaf
commit 912a3e9239
3 changed files with 5 additions and 2 deletions

View File

@@ -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" />

View File

@@ -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

View File

@@ -17,6 +17,8 @@ class TestReserveRule(common.SavepointCase):
"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")