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.""",
|
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',
|
'author': 'Akretion',
|
||||||
'website': 'http://www.akretion.com/',
|
'website': 'http://www.akretion.com/',
|
||||||
'depends': ['stock_account'],
|
'depends': ['stock_picking_invoice_link'],
|
||||||
'data': [],
|
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,10 @@ class account_invoice(orm.Model):
|
|||||||
pickings = self.pool['stock.picking'].read(
|
pickings = self.pool['stock.picking'].read(
|
||||||
cr, uid, invoice['picking_ids'], ['name'],
|
cr, uid, invoice['picking_ids'], ['name'],
|
||||||
context=context)
|
context=context)
|
||||||
first = True
|
pick_names = []
|
||||||
for picking in pickings:
|
for picking in pickings:
|
||||||
if first:
|
pick_names.append(picking['name'])
|
||||||
label += picking['name']
|
label = ','.join(pick_names)
|
||||||
first = False
|
|
||||||
else:
|
|
||||||
label += ', %s' % picking['name']
|
|
||||||
res[invoice['id']] = label
|
res[invoice['id']] = label
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user