Corrections on stock
bzr revid: jvo@tinyerp.com-20090224064209-d3330ew80v4pfu75
This commit is contained in:
parent
939a981520
commit
4b6b198182
|
@ -665,15 +665,15 @@ class stock_picking(osv.osv):
|
|||
invoice_id = invoices_group[partner.id]
|
||||
invoice=invoice_obj.browse(cursor, user,invoice_id)
|
||||
invoice_vals = {
|
||||
'name': invoice.name +', '+picking.name,
|
||||
'origin': invoice.origin+', '+picking.name+(picking.origin and (':' + picking.origin) or ''),
|
||||
'name': invoice.name +', '+str(picking.name or ''),
|
||||
'origin': invoice.origin+', '+str(picking.name or '')+(picking.origin and (':' + picking.origin) or ''),
|
||||
'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
|
||||
}
|
||||
invoice_obj.write(cursor, user, [invoice_id],invoice_vals,context=context)
|
||||
else:
|
||||
invoice_vals = {
|
||||
'name': picking.name,
|
||||
'origin': picking.name + (picking.origin and (':' + picking.origin) or ''),
|
||||
'origin': str(picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
|
||||
'type': type,
|
||||
'account_id': account_id,
|
||||
'partner_id': partner.id,
|
||||
|
@ -697,7 +697,7 @@ class stock_picking(osv.osv):
|
|||
if move_line.picking_id.origin:
|
||||
origin+=':' + move_line.picking_id.origin
|
||||
if group:
|
||||
name = picking.name + '-' + move_line.name
|
||||
name = str(picking.name or '') + '-' + move_line.name
|
||||
else:
|
||||
name = move_line.name
|
||||
|
||||
|
@ -911,7 +911,7 @@ class stock_move(osv.osv):
|
|||
['prodlot_id'])]
|
||||
def _default_location_destination(self, cr, uid, context={}):
|
||||
if context.get('move_line', []):
|
||||
return context['move_line'][0][2]['location_dest_id']
|
||||
return context['move_line'][0][2] and context['move_line'][0][2]['location_dest_id'] or False
|
||||
if context.get('address_out_id', False):
|
||||
return self.pool.get('res.partner.address').browse(cr, uid, context['address_out_id'], context).partner_id.property_stock_customer.id
|
||||
return False
|
||||
|
|
|
@ -67,9 +67,9 @@ def _get_type(obj, cr, uid, data, context):
|
|||
usage = 'customer'
|
||||
pick = picking_obj.browse(cr, uid, data['id'], context)
|
||||
if pick.invoice_state=='invoiced':
|
||||
raise wizard.except_wizard('UserError','Invoice is already created')
|
||||
raise wizard.except_wizard('UserError','Invoice is already created.')
|
||||
if pick.invoice_state=='none':
|
||||
raise wizard.except_wizard('UserError','Invoice can not create from Packing')
|
||||
raise wizard.except_wizard('UserError','Invoice cannot be created from Packing.')
|
||||
|
||||
if pick.move_lines:
|
||||
usage=pick.move_lines[0].location_id.usage
|
||||
|
|
Loading…
Reference in New Issue