From 3bf7b3faa5b8c63e2f2081feb4c09dca7b002db6 Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Mon, 13 Apr 2015 11:27:05 +0200 Subject: [PATCH] [FIX] Style improvements in move_period_from_transaction_date. --- move_period_from_transaction_date/README.rst | 35 +++++++++++++++++-- .../__openerp__.py | 3 +- .../model/account_bank_statement_line.py | 4 +-- .../model/account_move_line.py | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/move_period_from_transaction_date/README.rst b/move_period_from_transaction_date/README.rst index 5db2e0c4..89348eca 100644 --- a/move_period_from_transaction_date/README.rst +++ b/move_period_from_transaction_date/README.rst @@ -1,4 +1,33 @@ -Make sure that when reconciliation moves are generated for a bank -transaction, that the period for the moves is determined from the transaction -(bank statement line), and not from the bank statement period. +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Module name +=========== + +This module was written to make sure that when reconciliation moves are +generated for a bank transaction, that the period for the moves is determined +from the transaction (bank statement line), and not from the bank statement +period. + +Contributors +------------ + +* Stefan Rijnhart +* Ronald Portier + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. + diff --git a/move_period_from_transaction_date/__openerp__.py b/move_period_from_transaction_date/__openerp__.py index 7cc83500..ff48ae91 100644 --- a/move_period_from_transaction_date/__openerp__.py +++ b/move_period_from_transaction_date/__openerp__.py @@ -21,9 +21,8 @@ { 'name': 'Use bank transaction (line) date to determine move period', 'version': '1.0', - 'author': 'Therp BV', + 'author': 'Therp BV, Odoo Community Association (OCA)', 'category': 'Banking addons', - 'complexity': 'easy', 'depends': [ 'account', ], diff --git a/move_period_from_transaction_date/model/account_bank_statement_line.py b/move_period_from_transaction_date/model/account_bank_statement_line.py index 7d1aff20..849b2a40 100644 --- a/move_period_from_transaction_date/model/account_bank_statement_line.py +++ b/move_period_from_transaction_date/model/account_bank_statement_line.py @@ -27,11 +27,11 @@ class AccountBankStatementLine(orm.Model): _inherit = 'account.bank.statement.line' def process_reconciliation( - self, cr, uid, id, mv_line_dicts, context=None): + self, cr, uid, statement_line_id, mv_line_dicts, context=None): """Put marker in context to use period from date in move line.""" ctx = context and context.copy() or {} ctx['override_period_from_date'] = True return super(AccountBankStatementLine, self).process_reconciliation( - cr, uid, id, mv_line_dicts, context=ctx) + cr, uid, statement_line_id, mv_line_dicts, context=ctx) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/move_period_from_transaction_date/model/account_move_line.py b/move_period_from_transaction_date/model/account_move_line.py index 2766e05f..5e7cb32f 100644 --- a/move_period_from_transaction_date/model/account_move_line.py +++ b/move_period_from_transaction_date/model/account_move_line.py @@ -32,7 +32,7 @@ class AccountMoveLine(orm.Model): if (('override_period_from_date' in context or 'period_id' not in vals) and 'date' in vals): period_model = self.pool['account.period'] - search_date = 'date' in vals and vals['date'] or None + search_date = vals.get('date') period_ids = period_model.find( cr, uid, dt=search_date, context=context) if period_ids: