Guidelines

This commit is contained in:
Bertrand Chenal committed 2008-06-11 20:18:37 +02:00
1 parent 9d2baa24b7
commit aac22b0cd2
4 files changed
+15 -15

No files matched your search

+7 -7
View File
@@ -16,18 +16,18 @@ class Inventory(OSV):
location = fields.Many2One(
'stock.location', 'Location', required=True,
domain="[('type', '=', 'storage')]", states=STATES,)
domain="[('type', '=', 'storage')]", states=STATES)
date = fields.DateTime('Date', readonly=True)
lost_found = fields.Many2One(
'stock.location', 'Lost and Found', required=True,
domain="[('type', '=', 'lost_found')]", states=STATES,)
domain="[('type', '=', 'lost_found')]", states=STATES)
lines = fields.One2Many(
'stock.inventory.line', 'inventory', 'Inventory Lines', states=STATES,)
'stock.inventory.line', 'inventory', 'Inventory Lines', states=STATES)
moves = fields.Many2Many(
'stock.move', 'inventory_move_rel', 'inventory', 'move',
'Generated moves')
company = fields.Many2One(
'company.company', 'Company', required=True, states=STATES,)
'company.company', 'Company', required=True, states=STATES)
state = fields.Selection(
@@ -169,9 +169,9 @@ class InventoryLine(OSV):
_rec_name = 'product'
product = fields.Many2One(
'product.product', 'Product', required=True, on_change=['product'],)
uom = fields.Many2One('product.uom', 'Uom', required=True, select=1,)
quantity = fields.Float('Quantity', digits=(12, 6),)
'product.product', 'Product', required=True, on_change=['product'])
uom = fields.Many2One('product.uom', 'Uom', required=True, select=1)
quantity = fields.Float('Quantity', digits=(12, 6))
inventory = fields.Many2One('stock.inventory', 'Inventory')
def __init__(self):
+3 -3
View File
@@ -29,7 +29,7 @@ class Location(OSV):
('production', 'Production'),
], 'Location type', states=STATES)
parent = fields.Many2One("stock.location", "Parent", select=1)
childs = fields.One2Many("stock.location", "parent", "Childs",)
childs = fields.One2Many("stock.location", "parent", "Childs")
input_location = fields.Many2One(
"stock.location", "Input", states=STATES_WH,
domain="[('type','=','storage'), ('parent', 'child_of', [active_id])]")
@@ -39,9 +39,9 @@ class Location(OSV):
storage_location = fields.Many2One(
"stock.location", "Storage", states=STATES_WH,
domain="[('type','=','storage'), ('parent', 'child_of', [active_id])]")
quantity = fields.Function('get_quantity', type='float', string='Quantity',)
quantity = fields.Function('get_quantity', type='float', string='Quantity')
forecast_quantity = fields.Function('get_quantity', type='float',
string='Forecast Quantity',)
string='Forecast Quantity')
def __init__(self):
super(Location, self).__init__()
+1 -1
View File
@@ -18,7 +18,7 @@ class Move(OSV):
product = fields.Many2One("product.product", "Product", required=True,
select=1, states=STATES,
on_change=['product', 'type', 'currency', 'uom', 'company'],
domain=[('type', '!=', 'service')],)
domain=[('type', '!=', 'service')])
uom = fields.Many2One("product.uom", "Uom", required=True, states=STATES)
quantity = fields.Float("Quantity", digits=(12, 6), required=True,
states=STATES)
+4 -4
View File
@@ -19,10 +19,10 @@ class PackingIn(OSV):
effective_date =fields.DateTime('Effective Date', readonly=True)
planned_date = fields.DateTime(
'Planned Date', states={'readonly': "state != 'draft'",},)
'Planned Date', states={'readonly': "state != 'draft'",})
reference = fields.Char(
"Reference", size=None, select=1,
states={'readonly': "state != 'draft'",},)
states={'readonly': "state != 'draft'",})
supplier = fields.Many2One('relationship.party', 'Supplier',
states={
'readonly': "state != 'draft'",
@@ -247,7 +247,7 @@ class PackingOut(OSV):
_description = __doc__
_rec_name = 'code'
effective_date =fields.DateTime('Effective Date', readonly=True,)
effective_date =fields.DateTime('Effective Date', readonly=True)
planned_date = fields.DateTime('Planned Date', readonly=True,
states={
'readonly': "state != 'draft'",
@@ -567,7 +567,7 @@ class PackingOut(OSV):
cursor, user, move.uom.id,
processed_data.get(
(location, move.product.id), []),
uom_index, context=context,)
uom_index, context=context)
if qty != 0.0:
location_qties.append((location, qty))