Use update tag in record for cycling dependencies and remove constraint on

input/output/stock location because with those requirement it is impossible to
create a warehouse.
This commit is contained in:
Cédric Krier committed 2008-04-29 10:56:27 +02:00
1 parent 9847c3baf4
commit e5f39cffa4
2 files changed
+14 -8

No files matched your search

+4 -3
View File
@@ -5,8 +5,8 @@ STATES = {
'readonly': "not active",
}
STATES_WH = {
'readonly': "(not active) or type != 'warehouse'",
'required': "type == 'warehouse' and active",
'invisible': "type != 'warehouse'",
'readonly': "not active",
}
class Location(OSV):
"Stock Location"
@@ -15,7 +15,8 @@ class Location(OSV):
name = fields.Char("Name", size=64, required=True, states=STATES,)
code = fields.Char("Code", size=32, states=STATES, select=True,)
active = fields.Boolean('Active', select=True)
address = fields.Many2One("partner.address", "Address", states=STATES_WH,)
address = fields.Many2One("partner.address", "Address",
states=STATES_WH)
type = fields.Selection([('supplier', 'Supplier'),
('customer', 'Customer'),
('inventory', 'Inventory'),
+10 -5
View File
@@ -21,10 +21,13 @@
<newline/>
<label name="address"/>
<field name="address"/>
<newline/>
<label name="input_location"/>
<field name="input_location"/>
<newline/>
<label name="output_location"/>
<field name="output_location"/>
<newline/>
<label name="storage_location"/>
<field name="storage_location"/>
</form>
@@ -132,22 +135,28 @@
<!-- Default locations -->
<record model="stock.location" id="location_warehouse">
<field name="name">Warehouse</field>
</record>
<record model="stock.location" id="location_input">
<field name="name">Input Zone</field>
<field name="code">IN</field>
<field name="type">storage</field>
<field name="parent" ref="location_warehouse"/>
</record>
<record model="stock.location" id="location_output">
<field name="name">Output Zone</field>
<field name="code">OUT</field>
<field name="type">storage</field>
<field name="parent" ref="location_warehouse"/>
</record>
<record model="stock.location" id="location_storage">
<field name="name">Storage Zone</field>
<field name="code">STO</field>
<field name="type">storage</field>
<field name="parent" ref="location_warehouse"/>
</record>
<record model="stock.location" id="location_warehouse">
<record model="stock.location" id="location_warehouse" update="1">
<field name="name">Warehouse</field>
<field name="code">WH</field>
<field name="type">warehouse</field>
@@ -155,10 +164,6 @@
<field name="output_location" ref="location_output"/>
<field name="storage_location" ref="location_storage"/>
</record>
<!-- <record model="stock.location" id="location_storage"> -->
<!-- <field name="parent" ref="location_warehouse"/> -->
<!-- </record> -->
</data>
</tryton>