("none", "Not Applicable")], "Invoice Control",
select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
- 'force_assign_in': fields.boolean('Force Assign'),
+ 'force_assign_picking': fields.boolean('Force Assign'),
}
_defaults = {
'name': lambda self, cr, uid, context: '/',
'state': 'draft',
'move_type': 'direct',
'type': 'in',
- 'force_assign_in': False,
+ 'force_assign_picking': False,
'invoice_state': 'none',
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
res = super(stock_picking, self).default_get(cr, uid, fields, context=context)
type = context.get('default_type', False)
if type == 'in':
- if 'force_assign_in' in fields:
- res.update({'force_assign_in': True})
+ if 'force_assign_picking' in fields:
+ res.update({'force_assign_picking': True})
return res
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
move.write({'state': 'done'})
return True
- def test_assigned_pick_in(self, cr, uid, ids):
- ok = False
- for pick in self.browse(cr, uid, ids):
- if pick.force_assign_in:
- ok = True
- else:
- ok = self.test_assigned(cr, uid, ids)
- return ok
-
def test_assigned(self, cr, uid, ids):
""" Tests whether the move is in assigned state or not.
@return: True or False
#TOFIX: assignment of move lines should be call before testing assigment otherwise picking never gone in assign state
ok = True
for pick in self.browse(cr, uid, ids):
- if pick.force_assign_in:
+ if pick.force_assign_picking:
ok = True
else:
mt = pick.move_type