Skip to content
Snippets Groups Projects
Commit 8827789f authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] stock_account: remove traceback introduced by f2108e9e

invoice_vals['name'] may not be defined yet.
parent ed6d9afe
Branches
Tags
No related merge requests found
......@@ -240,7 +240,7 @@ class stock_picking(osv.osv):
@return: object of the partner to invoice
"""
return picking.partner_id and picking.partner_id.id
def action_invoice_create(self, cr, uid, ids, journal_id, group=False, type='out_invoice', context=None):
""" Creates invoice based on the invoice state selected for picking.
@param journal_id: Id of journal
......@@ -315,7 +315,7 @@ class stock_picking(osv.osv):
if not invoice.origin or invoice_vals['origin'] not in invoice.origin.split(', '):
invoice_origin = filter(None, [invoice.origin, invoice_vals['origin']])
merge_vals['origin'] = ', '.join(invoice_origin)
if not invoice.name or invoice_vals['name'] not in invoice.name.split(', '):
if invoice_vals.get('name', False) and (not invoice.name or invoice_vals['name'] not in invoice.name.split(', ')):
invoice_name = filter(None, [invoice.name, invoice_vals['name']])
merge_vals['name'] = ', '.join(invoice_name)
if merge_vals:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment