Guidelines
This commit is contained in:
1 parent
b0c3b38faa
commit
8a51eb53f2
3 files changed
+15
-12
No files matched your search
@@ -87,7 +87,7 @@ class Move(OSV):
|
||||
!= move.from_location.id:
|
||||
return False
|
||||
if move.to_location.type and \
|
||||
move.to_location.type not in ('supplier','customer'):
|
||||
move.to_location.type not in ('supplier', 'customer'):
|
||||
return False
|
||||
for packing_move in move.outgoing_packing_out.outgoing_moves:
|
||||
if packing_move.to_location.id != move.to_location.id:
|
||||
@@ -161,7 +161,7 @@ class Move(OSV):
|
||||
def set_state_draft(self, cursor, user, ids, context=None):
|
||||
self.set_by_state(
|
||||
cursor, user, ids, ['cancel', 'waiting'],
|
||||
{'state':'draft',})
|
||||
{'state': 'draft',})
|
||||
|
||||
def set_state_cancel(self, cursor, user, ids, context=None):
|
||||
self.set_by_state(
|
||||
@@ -174,7 +174,7 @@ class Move(OSV):
|
||||
|
||||
def unlink(self, cursor, user, ids, context=None):
|
||||
move_ids = self.search(
|
||||
cursor, user, [('id', 'in',ids),('state', 'in',
|
||||
cursor, user, [('id', 'in', ids), ('state', 'in',
|
||||
['done', 'waiting', 'cancel'])], context)
|
||||
|
||||
if move_ids:
|
||||
@@ -229,7 +229,7 @@ class CreatePacking(Wizard):
|
||||
cursor, user,
|
||||
[('input_location', 'in',
|
||||
[l for l in moves_by_location]),
|
||||
('type','=','warehouse')], context=context)
|
||||
('type', '=', 'warehouse')], context=context)
|
||||
wh_locations = location_obj.browse(
|
||||
cursor, user, warehouse_ids, context=context)
|
||||
loc2wh = dict([( whl.input_location.id, whl.id) for whl in wh_locations])
|
||||
@@ -259,7 +259,7 @@ class CreatePacking(Wizard):
|
||||
context=context)
|
||||
res = act_window_obj.read(cursor, user, model_data.db_id,
|
||||
context=context)
|
||||
res["domain"]= str([('id', 'in',packing_ids)])
|
||||
res["domain"]= str([('id', 'in', packing_ids)])
|
||||
|
||||
return res
|
||||
|
||||
|
||||
@@ -99,7 +99,9 @@
|
||||
<field name="name">Moves from suppliers to proceed</field>
|
||||
<field name="res_model">stock.move</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('from_location.usage', '=', 'supplier'),('state','in',['draft','waiting']),('incoming_packing_in','=',False),('inventory_packing_in','=',False)]</field>
|
||||
<field name="domain">[('from_location.type', '=', 'supplier'),
|
||||
('state','in',['draft','waiting']),('incoming_packing_in','=',False),
|
||||
('inventory_packing_in','=',False)]</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_move_form_supp_proceed_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
@@ -139,7 +141,8 @@
|
||||
<field name="name">Moves to customers to proceed</field>
|
||||
<field name="res_model">stock.move</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('to_location.usage', '=', 'customer'),('state','in',['draft','waiting'])]</field>
|
||||
<field name="domain">[('to_location.type', '=', 'customer'),
|
||||
('state','in',['draft','waiting'])]</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_move_form_cust_proceed_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
|
||||
+5
-5
@@ -16,20 +16,20 @@ class PackingIn(OSV):
|
||||
effective_date =fields.DateTime('Effective Date', readonly=True)
|
||||
planned_date = fields.DateTime('Planned Date', readonly=True)
|
||||
warehouse = fields.Many2One(
|
||||
'stock.location',"Warehouse", required=True, states=STATES,
|
||||
'stock.location', "Warehouse", required=True, states=STATES,
|
||||
domain="[('type', '=', 'warehouse')]",)
|
||||
incoming_moves = fields.One2Many(
|
||||
'stock.move', 'incoming_packing_in', 'Incoming Moves',
|
||||
states={'readonly':"state in ('received','done')",},
|
||||
states={'readonly': "state in ('received', 'done')",},
|
||||
context="{'warehouse': warehouse, 'packing_state': state, 'type':'incoming'}")
|
||||
inventory_moves = fields.One2Many(
|
||||
'stock.move', 'inventory_packing_in', 'Inventory Moves',
|
||||
states={'readonly':"state in ('draft','waiting')",},
|
||||
states={'readonly': "state in ('draft', 'waiting')",},
|
||||
context="{'warehouse': warehouse, 'packing_state': state, 'type':'inventory_in'}")
|
||||
code = fields.Char("Code", size=None, select=1, readonly=True,)
|
||||
state = fields.Selection(
|
||||
[('draft','Draft'),('done','Done'),('cancel','Cancel'),
|
||||
('waiting','Waiting'),('received','Received')], 'State', readonly=True)
|
||||
[('draft', 'Draft'), ('done', 'Done'), ('cancel', 'Cancel'),
|
||||
('waiting', 'Waiting'), ('received', 'Received')], 'State', readonly=True)
|
||||
|
||||
def __init__(self):
|
||||
super(PackingIn, self).__init__()
|
||||
|
||||
Reference in new issue
Block a user