[IMP] account_statement_ext_voucher: Fix PEP8

This commit is contained in:
Pedro M. Baeza
2014-08-04 17:35:54 +02:00
parent b3c1aa9b34
commit 5e98a81052
2 changed files with 12 additions and 14 deletions

View File

@@ -30,23 +30,20 @@
'account_voucher'
],
'description': """
This module is deprecated. It was only needed when using account_bank_statement_ext with voucher in order to compute the period
correctly. This is mainly because with account_bank_statement_ext, the period is computed for each line.
Now, we include this in the account_statement_ext module and added a dependencies on account_voucher (mainly cause we can't get
rid of the voucher in version 7.0).
This module is deprecated. It was only needed when using
account_bank_statement_ext with voucher in order to compute the period
correctly. This is mainly because with account_bank_statement_ext, the period
is computed for each line.
Now, we include this in the account_statement_ext module and added a
dependencies on account_voucher (mainly cause we can't get rid of the voucher
in version 7.0).
""",
'website': 'http://www.camptocamp.com',
'init_xml': [],
'update_xml': [
'data': [
"statement_voucher_view.xml",
],
'demo_xml': [],
'test': [],
'installable': False,
'images': [],
'auto_install': False,
'license': 'AGPL-3',
}

View File

@@ -32,10 +32,11 @@ class AccountVoucher(Model):
context = {}
if not context.get('period_id') and context.get('move_line_ids'):
res = self.pool.get('account.move.line').browse(
cr, uid, context.get('move_line_ids'), context=context)[0].period_id.id
cr, uid, context.get('move_line_ids'),
context=context)[0].period_id.id
context['period_id'] = res
elif context.get('date'):
periods = self.pool.get('account.period').find(
periods = self.pool['account.period'].find(
cr, uid, dt=context['date'], context=context)
if periods:
context['period_id'] = periods[0]