Fix bug #5 fix dependency for account_invoice_picking_label

Also clean-up the code of that module
This commit is contained in:
Alexis de Lattre
2017-10-13 16:52:28 +02:00
parent 3888495071
commit 8c0717db2f
2 changed files with 4 additions and 10 deletions

View File

@@ -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,
}

View File

@@ -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