mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_invoice_reference: Fix PEP8
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user