[IMP]stock: Improve filed name
bzr revid: mma@tinyerp.com-20120330111000-6kdvit7ycmtuuk84
This commit is contained in:
parent
741d2770eb
commit
4c62cb2086
|
@ -433,7 +433,7 @@ class purchase_order(osv.osv):
|
|||
'origin': order.name + ((order.origin and (':' + order.origin)) or ''),
|
||||
'date': order.date_order,
|
||||
'type': 'in',
|
||||
'force_assign_in': True,
|
||||
'force_assign_picking': True,
|
||||
'address_id': order.dest_address_id.id or order.partner_address_id.id,
|
||||
'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
|
||||
'purchase_id': order.id,
|
||||
|
|
|
@ -663,14 +663,14 @@ class stock_picking(osv.osv):
|
|||
("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)
|
||||
|
@ -683,8 +683,8 @@ class stock_picking(osv.osv):
|
|||
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):
|
||||
|
@ -893,15 +893,6 @@ class stock_picking(osv.osv):
|
|||
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
|
||||
|
@ -909,7 +900,7 @@ class stock_picking(osv.osv):
|
|||
#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
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
location_dest_id: location_delivery_counter
|
||||
-
|
||||
!record {model: stock.picking, id: incomming_shipment}:
|
||||
force_assign_in: True
|
||||
force_assign_picking: True
|
||||
type: in
|
||||
invoice_state: 2binvoiced
|
||||
address_id: base.res_partner_address_9
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<record id="trans_confirmed_assigned" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirmed"/>
|
||||
<field name="act_to" ref="act_assigned"/>
|
||||
<field name="condition">test_assigned_pick_in()</field>
|
||||
<field name="condition">test_assigned()</field>
|
||||
</record>
|
||||
<record id="trans_assigned_move_done" model="workflow.transition">
|
||||
<field name="act_from" ref="act_assigned"/>
|
||||
|
|
Loading…
Reference in New Issue