From 8c0717db2f5c4a329ece976d425dfc83feb58b93 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 13 Oct 2017 16:52:28 +0200 Subject: [PATCH] Fix bug #5 fix dependency for account_invoice_picking_label Also clean-up the code of that module --- account_invoice_picking_label/__openerp__.py | 5 +---- account_invoice_picking_label/account_invoice.py | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/account_invoice_picking_label/__openerp__.py b/account_invoice_picking_label/__openerp__.py index 3ef98b0..fa71027 100644 --- a/account_invoice_picking_label/__openerp__.py +++ b/account_invoice_picking_label/__openerp__.py @@ -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, } - diff --git a/account_invoice_picking_label/account_invoice.py b/account_invoice_picking_label/account_invoice.py index c150191..609d278 100644 --- a/account_invoice_picking_label/account_invoice.py +++ b/account_invoice_picking_label/account_invoice.py @@ -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