Add view location type, update domain restrictions.

This commit is contained in:
Ian Wilson committed 2009-02-03 21:26:05 -08:00
1 parent 1e9c9635db
commit fd49cd57b6
3 files changed
+8 -5

No files matched your search

+2 -1
View File
@@ -30,6 +30,7 @@ class Location(OSV):
('warehouse', 'Warehouse'),
('storage', 'Storage'),
('production', 'Production'),
('view', 'View'),
], 'Location type', states=STATES)
parent = fields.Many2One("stock.location", "Parent", select=1,
left="left", right="right")
@@ -82,7 +83,7 @@ class Location(OSV):
def check_type_for_moves(self, cursor, user, ids):
""" Check locations with moves have types compatible with moves. """
invalid_move_types = ['warehouse',]
invalid_move_types = ['warehouse', 'view']
move_obj = self.pool.get('stock.move')
for location in self.browse(cursor, user, ids):
if location.type in invalid_move_types and \
+4 -2
View File
@@ -31,10 +31,12 @@ class Move(OSV):
digits="(16, unit_digits)", states=STATES)
from_location = fields.Many2One("stock.location", "From Location", select=1,
required=True, states=STATES,
domain=[('type', '!=', 'warehouse')])
domain="[('type', 'not in', " \
"('warehouse', 'view'))]")
to_location = fields.Many2One("stock.location", "To Location", select=1,
required=True, states=STATES,
domain=[('type', '!=', 'warehouse')])
domain="[('type', 'not in', " \
"('warehouse', 'view'))]")
packing_in = fields.Many2One('stock.packing.in', 'Supplier Packing',
readonly=True, select=1)
packing_out = fields.Many2One('stock.packing.out', 'Customer Packing',
+2 -2
View File
@@ -1192,12 +1192,12 @@ class PackingInternal(OSV):
'stock.location', "From Location", required=True,
states={ 'readonly': "state != 'draft' or bool(moves)", },
domain="[('type', 'not in', " \
"('supplier', 'customer', 'warehouse'))]")
"('supplier', 'customer', 'warehouse', 'view'))]")
to_location = fields.Many2One('stock.location', "To Location",
required=True, states={
'readonly': "state != 'draft' or bool(moves)",
}, domain="[('type', 'not in', " \
"('supplier', 'customer', 'warehouse'))]")
"('supplier', 'customer', 'warehouse', 'view'))]")
moves = fields.One2Many(
'stock.move', 'packing_internal', 'Moves',
states={'readonly': "state != 'draft' or "\