diff --git a/account_invoice_reference/__openerp__.py b/account_invoice_reference/__openerp__.py index 5c9b1592..fc12a9ca 100644 --- a/account_invoice_reference/__openerp__.py +++ b/account_invoice_reference/__openerp__.py @@ -59,13 +59,15 @@ mandatory fields are: * Description * Internal Reference ("our reference") * External Reference ("customer or supplier reference") -* Optionally, a technical transaction reference (credit card payment gateways, SEPA, ...) +* Optionally, a technical transaction reference (credit card payment gateways, + SEPA, ...) Now, on the move lines: * Name * Reference -* Optionally, a technical transaction reference (added by the module `base_transaction_id`) +* Optionally, a technical transaction reference (added by the module + `base_transaction_id`) Let's see how the information will be organized with this module. diff --git a/account_invoice_reference/account_move.py b/account_invoice_reference/account_move.py index f83a085b..56226665 100644 --- a/account_invoice_reference/account_move.py +++ b/account_invoice_reference/account_move.py @@ -70,11 +70,12 @@ class account_invoice(orm.Model): cr.execute('UPDATE account_move_line SET ref=%s ' 'WHERE move_id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) - cr.execute('UPDATE account_analytic_line SET ref=%s ' - 'FROM account_move_line ' - 'WHERE account_move_line.move_id = %s ' - 'AND account_analytic_line.move_id = account_move_line.id', - (ref, move_id)) + cr.execute( + 'UPDATE account_analytic_line SET ref=%s ' + 'FROM account_move_line ' + 'WHERE account_move_line.move_id = %s ' + 'AND account_analytic_line.move_id = account_move_line.id', + (ref, move_id)) return True def create(self, cr, uid, vals, context=None): @@ -89,7 +90,6 @@ class account_invoice(orm.Model): if isinstance(ids, (int, long)): ids = [ids] for invoice in self.browse(cr, uid, ids, context=context): - local_vals = vals if not invoice.reference: locvals = vals.copy() locvals['reference'] = vals['supplier_invoice_reference']