Fix bug #5 fix dependency for account_invoice_picking_label
Also clean-up the code of that module
This commit is contained in:
@@ -34,9 +34,6 @@ Account Invoice Picking Label
|
||||
Adds a function field named *picking_ids_label* on invoices. This field contains the list of pickings related to the invoice as a string. This field is designed to be displayed in the invoice report.""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': ['stock_account'],
|
||||
'data': [],
|
||||
'depends': ['stock_picking_invoice_link'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
|
||||
|
||||
@@ -36,13 +36,10 @@ class account_invoice(orm.Model):
|
||||
pickings = self.pool['stock.picking'].read(
|
||||
cr, uid, invoice['picking_ids'], ['name'],
|
||||
context=context)
|
||||
first = True
|
||||
pick_names = []
|
||||
for picking in pickings:
|
||||
if first:
|
||||
label += picking['name']
|
||||
first = False
|
||||
else:
|
||||
label += ', %s' % picking['name']
|
||||
pick_names.append(picking['name'])
|
||||
label = ','.join(pick_names)
|
||||
res[invoice['id']] = label
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user