Change string domain into list

This commit is contained in:
Cédric Krier committed 2009-06-23 18:49:55 +02:00
1 parent 7044ef2de3
commit 05f7726569
3 files changed
+26 -23

No files matched your search

+12 -9
View File
@@ -44,27 +44,30 @@ class Location(ModelSQL, ModelView):
'readonly': "not active",
'required': "type == 'warehouse'",
},
domain="[('type','=','storage'), ['OR', " \
"('parent', 'child_of', [active_id]), " \
"('parent', '=', False)]]")
domain=["('type','=','storage')",
['OR',
"('parent', 'child_of', [active_id])",
"('parent', '=', False)"]])
output_location = fields.Many2One(
"stock.location", "Output", states={
'invisible': "type != 'warehouse'",
'readonly': "not active",
'required': "type == 'warehouse'",
},
domain="[('type','=','storage'), ['OR', " \
"('parent', 'child_of', [active_id]), " \
"('parent', '=', False)]]")
domain=["('type','=','storage')",
['OR',
"('parent', 'child_of', [active_id])",
"('parent', '=', False)"]])
storage_location = fields.Many2One(
"stock.location", "Storage", states={
'invisible': "type != 'warehouse'",
'readonly': "not active",
'required': "type == 'warehouse'",
},
domain="[('type','=','storage'), ['OR', " \
"('parent', 'child_of', [active_id]), " \
"('parent', '=', False)]]")
domain=["('type','=','storage')",
['OR',
"('parent', 'child_of', [active_id])",
"('parent', '=', False)"]])
quantity = fields.Function('get_quantity', type='float', string='Quantity')
forecast_quantity = fields.Function('get_quantity', type='float',
string='Forecast Quantity')
+7 -7
View File
@@ -20,8 +20,8 @@ class Move(ModelSQL, ModelView):
'from_location', 'to_location'],
domain=[('type', '!=', 'service')])
uom = fields.Many2One("product.uom", "Uom", required=True, states=STATES,
domain="[('category', '=', " \
"(product, 'product.default_uom.category'))]",
domain=["('category', '=', " \
"(product, 'product.default_uom.category'))"],
context="{'category': (product, 'product.default_uom.category')}",
on_change=['product', 'currency', 'uom', 'company',
'from_location', 'to_location'])
@@ -31,12 +31,12 @@ class Move(ModelSQL, ModelView):
digits="(16, unit_digits)", states=STATES)
from_location = fields.Many2One("stock.location", "From Location", select=1,
required=True, states=STATES,
domain="[('type', 'not in', " \
"('warehouse', 'view'))]")
domain=["('type', 'not in', " \
"('warehouse', 'view'))"])
to_location = fields.Many2One("stock.location", "To Location", select=1,
required=True, states=STATES,
domain="[('type', 'not in', " \
"('warehouse', 'view'))]")
domain=["('type', 'not in', " \
"('warehouse', 'view'))"])
packing_in = fields.Many2One('stock.packing.in', 'Supplier Shipment',
readonly=True, select=1, ondelete='CASCADE')
packing_out = fields.Many2One('stock.packing.out', 'Customer Shipment',
@@ -60,7 +60,7 @@ class Move(ModelSQL, ModelView):
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': "state != 'draft'",
}, domain="[('id', '=', context.get('company', 0))]")
}, domain=["('id', '=', context.get('company', 0))"])
unit_price = fields.Numeric('Unit Price', digits=(16, 4),
states={
'invisible': "not unit_price_required",
+7 -7
View File
@@ -31,7 +31,7 @@ class PackingIn(ModelWorkflow, ModelSQL, ModelView):
contact_address = fields.Many2One('party.address', 'Contact Address',
states={
'readonly': "state != 'draft'",
}, domain="[('party', '=', supplier)]")
}, domain=["('party', '=', supplier)"])
warehouse = fields.Many2One('stock.location', "Warehouse",
required=True, domain=[('type', '=', 'warehouse')],
states={
@@ -469,7 +469,7 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView):
'Delivery Address', required=True,
states={
'readonly': "state != 'draft'",
}, domain="[('party', '=', customer)]")
}, domain=["('party', '=', customer)"])
reference = fields.Char("Reference", size=None, select=1,
states={
'readonly': "state != 'draft'",
@@ -859,7 +859,7 @@ class PackingOutReturn(ModelWorkflow, ModelSQL, ModelView):
'Delivery Address', required=True,
states={
'readonly': "state != 'draft'",
}, domain="[('party', '=', customer)]")
}, domain=["('party', '=', customer)"])
reference = fields.Char("Reference", size=None, select=1,
states={
'readonly': "state != 'draft'",
@@ -1205,13 +1205,13 @@ class PackingInternal(ModelWorkflow, ModelSQL, ModelView):
from_location = fields.Many2One(
'stock.location', "From Location", required=True,
states={ 'readonly': "state != 'draft' or bool(moves)", },
domain="[('type', 'not in', " \
"('supplier', 'customer', 'warehouse', 'view'))]")
domain=["('type', 'not in', " \
"('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', 'view'))]")
}, domain=["('type', 'not in', " \
"('supplier', 'customer', 'warehouse', 'view'))"])
moves = fields.One2Many(
'stock.move', 'packing_internal', 'Moves',
states={'readonly': "state != 'draft' or "\