[IMP] account_invoice_reference: Fix PEP8

This commit is contained in:
Pedro M. Baeza
2014-08-04 18:12:14 +02:00
parent 602d39da87
commit aebcbfdd5d
2 changed files with 10 additions and 8 deletions

View File

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

View File

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