From b6cb19e401f9bc3256c5cc289a084ae5631a9ea0 Mon Sep 17 00:00:00 2001 From: Sebastien Beau Date: Wed, 4 Dec 2013 14:41:23 +0100 Subject: [PATCH 1/9] [FIX] fix api and put the incorrect method in deprecated --- account_statement_base_import/statement.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index 97e8e8ab..d8badee2 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -85,7 +85,12 @@ class AccountStatementProfil(Model): context=context) return True - def prepare_statetement_lines_vals( + #Deprecated remove on V8 + def prepare_statetement_lines_vals(self, *args, **kwargs): + return super(self, AccountStatementProfil).\ + prepare_statetement_lines_vals(*args, **kwargs) + + def prepare_statement_lines_vals( self, cr, uid, parser_vals, account_payable, account_receivable, statement_id, context): """ @@ -172,7 +177,7 @@ class AccountStatementProfil(Model): statement_store = [] for line in result_row_list: parser_vals = parser.get_st_line_vals(line) - values = self.prepare_statetement_lines_vals( + values = self.prepare_statement_lines_vals( cr, uid, parser_vals, account_payable, account_receivable, statement_id, context) statement_store.append(values) From 4933e28d0670572805857d8a56fcd74352740e4d Mon Sep 17 00:00:00 2001 From: Sebastien Beau Date: Wed, 4 Dec 2013 17:13:46 +0100 Subject: [PATCH 2/9] [REF] remove useless unlink as the raise osv will roolback the cursor --- account_statement_base_import/statement.py | 1 - 1 file changed, 1 deletion(-) diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index d8badee2..56fad9c0 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -212,7 +212,6 @@ class AccountStatementProfil(Model): context) except Exception: - statement_obj.unlink(cr, uid, [statement_id], context=context) error_type, error_value, trbk = sys.exc_info() st = "Error: %s\nDescription: %s\nTraceback:" % (error_type.__name__, error_value) st += ''.join(traceback.format_tb(trbk, 30)) From d1e1c06364139d6c2c51563b447a93d33adc7c1f Mon Sep 17 00:00:00 2001 From: Sebastien Beau Date: Wed, 4 Dec 2013 17:25:04 +0100 Subject: [PATCH 3/9] [REF] rename OpenERP class AccountBankSatement into AccountBankStatement --- .../account.py | 4 ++-- account_statement_base_completion/statement.py | 2 +- account_statement_ext/statement.py | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/account_advanced_reconcile_transaction_ref/account.py b/account_advanced_reconcile_transaction_ref/account.py index 0525de31..b3e2cd24 100644 --- a/account_advanced_reconcile_transaction_ref/account.py +++ b/account_advanced_reconcile_transaction_ref/account.py @@ -30,7 +30,7 @@ class AccountMoveLine(Model): 'transaction_ref': fields.char('Transaction Ref.', size=128), } -class AccountBankSatement(Model): +class AccountBankStatement(Model): """ Inherit account.bank.statement class in order to set transaction_ref info on account.move.line """ @@ -43,7 +43,7 @@ class AccountBankSatement(Model): if context is None: context = {} - res = super(AccountBankSatement, self)._prepare_move_line_vals( + res = super(AccountBankStatement, self)._prepare_move_line_vals( cr, uid, st_line, move_id, debit, credit, currency_id=currency_id, amount_currency=amount_currency, diff --git a/account_statement_base_completion/statement.py b/account_statement_base_completion/statement.py index 96ab741b..d9782252 100644 --- a/account_statement_base_completion/statement.py +++ b/account_statement_base_completion/statement.py @@ -511,7 +511,7 @@ class AccountStatementLine(orm.Model): sql_err.pgerror) -class AccountBankSatement(orm.Model): +class AccountBankStatement(orm.Model): """ We add a basic button and stuff to support the auto-completion of the bank statement once line have been imported or manually fullfill. diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index f8762054..48667715 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -113,7 +113,7 @@ class AccountStatementProfile(Model): ] -class AccountBankSatement(Model): +class AccountBankStatement(Model): """ We improve the bank statement class mostly for : - Removing the period and compute it from the date of each line. @@ -202,7 +202,7 @@ class AccountBankSatement(Model): profile_obj = self.pool.get('account.statement.profile') profile = profile_obj.browse(cr, uid, vals['profile_id'], context=context) vals['journal_id'] = profile.journal_id.id - return super(AccountBankSatement, self).create(cr, uid, vals, context=context) + return super(AccountBankStatement, self).create(cr, uid, vals, context=context) def _get_period(self, cr, uid, date, context=None): """ @@ -243,7 +243,7 @@ class AccountBankSatement(Model): """ if context is None: context = {} - res = super(AccountBankSatement, self)._prepare_move( + res = super(AccountBankStatement, self)._prepare_move( cr, uid, st_line, st_line_number, context=context) ctx = context.copy() ctx['company_id'] = st_line.company_id.id @@ -273,7 +273,7 @@ class AccountBankSatement(Model): """ if context is None: context = {} - res = super(AccountBankSatement, self)._prepare_move_line_vals( + res = super(AccountBankStatement, self)._prepare_move_line_vals( cr, uid, st_line, move_id, debit, credit, currency_id=currency_id, amount_currency=amount_currency, @@ -297,7 +297,7 @@ class AccountBankSatement(Model): create the move from. :return: int/long of the res.partner to use as counterpart """ - bank_partner_id = super(AccountBankSatement, self)._get_counter_part_partner(cr, + bank_partner_id = super(AccountBankStatement, self)._get_counter_part_partner(cr, uid, st_line, context=context) @@ -530,7 +530,7 @@ class AccountBankSatement(Model): """ st = self.browse(cr, uid, st_id, context=context) if st.balance_check: - return super(AccountBankSatement, self).balance_check( + return super(AccountBankStatement, self).balance_check( cr, uid, st_id, journal_type, context=context) else: return True @@ -555,7 +555,7 @@ class AccountBankSatement(Model): 'credit_partner_id': credit_partner_id}} -class AccountBankSatementLine(Model): +class AccountBankStatementLine(Model): """ Override to compute the period from the date of the line, add a method to retrieve the values for a line from the profile. Override the on_change method to take care of @@ -684,7 +684,7 @@ class AccountBankSatementLine(Model): Keep the same features as in standard and call super. If an account is returned, call the method to compute line values. """ - res = super(AccountBankSatementLine, self).onchange_type(cr, uid, + res = super(AccountBankStatementLine, self).onchange_type(cr, uid, line_id, partner_id, line_type, From 0f7fa422b458800dd1b9d035d7232ffaf8dd28da Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Mon, 3 Feb 2014 10:16:01 +0100 Subject: [PATCH 4/9] [FIX] Clean data --- account_statement_base_import/statement.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index 56fad9c0..e85b7c8e 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -87,8 +87,7 @@ class AccountStatementProfil(Model): #Deprecated remove on V8 def prepare_statetement_lines_vals(self, *args, **kwargs): - return super(self, AccountStatementProfil).\ - prepare_statetement_lines_vals(*args, **kwargs) + return self.prepare_statement_lines_vals(*args, **kwargs) def prepare_statement_lines_vals( self, cr, uid, parser_vals, account_payable, account_receivable, From 106294d36367d6aab319c974dba0e466bda250f4 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 21 Feb 2014 19:18:26 +0100 Subject: [PATCH 5/9] UPD account_advanced_reconcile_transaction_ref version --- account_advanced_reconcile_transaction_ref/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_advanced_reconcile_transaction_ref/__openerp__.py b/account_advanced_reconcile_transaction_ref/__openerp__.py index d806ba9e..bd1586cf 100644 --- a/account_advanced_reconcile_transaction_ref/__openerp__.py +++ b/account_advanced_reconcile_transaction_ref/__openerp__.py @@ -25,7 +25,7 @@ Advanced reconciliation method for the module account_easy_reconcile Reconcile rules with transaction_ref """, - 'version': '1.0', + 'version': '1.0.1', 'author': 'Camptocamp', 'category': 'Finance', 'website': 'http://www.camptocamp.com', From 0cedf1b84dc79d0f38bdce497f9664f85365ac8b Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 21 Feb 2014 19:19:17 +0100 Subject: [PATCH 6/9] UPD account_statement_base_completion version --- account_statement_base_completion/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_base_completion/__openerp__.py b/account_statement_base_completion/__openerp__.py index d868a314..1ff18db7 100644 --- a/account_statement_base_completion/__openerp__.py +++ b/account_statement_base_completion/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## {'name': "Bank statement base completion", - 'version': '1.0', + 'version': '1.0.1', 'author': 'Camptocamp', 'maintainer': 'Camptocamp', 'category': 'Finance', From fc6032597b33960b15f8c292b935d37e035e373a Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 21 Feb 2014 19:19:53 +0100 Subject: [PATCH 7/9] UPD account_statement_base_import version --- account_statement_base_import/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_base_import/__openerp__.py b/account_statement_base_import/__openerp__.py index 086af048..59a5a338 100644 --- a/account_statement_base_import/__openerp__.py +++ b/account_statement_base_import/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## {'name': "Bank statement base import", - 'version': '1.0', + 'version': '1.0.1', 'author': 'Camptocamp', 'maintainer': 'Camptocamp', 'category': 'Finance', From 3875378fc9229d1107f1683854327e998269b618 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 21 Feb 2014 19:25:38 +0100 Subject: [PATCH 8/9] PEP8 on changes --- account_statement_ext/statement.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index 48667715..4fa5b0df 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -202,7 +202,8 @@ class AccountBankStatement(Model): profile_obj = self.pool.get('account.statement.profile') profile = profile_obj.browse(cr, uid, vals['profile_id'], context=context) vals['journal_id'] = profile.journal_id.id - return super(AccountBankStatement, self).create(cr, uid, vals, context=context) + return super(AccountBankStatement, self + ).create(cr, uid, vals, context=context) def _get_period(self, cr, uid, date, context=None): """ @@ -243,8 +244,9 @@ class AccountBankStatement(Model): """ if context is None: context = {} - res = super(AccountBankStatement, self)._prepare_move( - cr, uid, st_line, st_line_number, context=context) + res = super(AccountBankStatement, self + )._prepare_move(cr, uid, st_line, st_line_number, + context=context) ctx = context.copy() ctx['company_id'] = st_line.company_id.id period_id = self._get_period(cr, uid, st_line.date, context=ctx) @@ -297,10 +299,9 @@ class AccountBankStatement(Model): create the move from. :return: int/long of the res.partner to use as counterpart """ - bank_partner_id = super(AccountBankStatement, self)._get_counter_part_partner(cr, - uid, - st_line, - context=context) + bank_partner_id = super(AccountBankStatement, self + )._get_counter_part_partner(cr, uid, st_line, + context=context) # get the right partner according to the chosen profile if st_line.statement_id.profile_id.force_partner_on_bank: bank_partner_id = st_line.statement_id.profile_id.partner_id.id @@ -530,8 +531,9 @@ class AccountBankStatement(Model): """ st = self.browse(cr, uid, st_id, context=context) if st.balance_check: - return super(AccountBankStatement, self).balance_check( - cr, uid, st_id, journal_type, context=context) + return super(AccountBankStatement, self + ).balance_check(cr, uid, st_id, journal_type, + context=context) else: return True @@ -684,11 +686,9 @@ class AccountBankStatementLine(Model): Keep the same features as in standard and call super. If an account is returned, call the method to compute line values. """ - res = super(AccountBankStatementLine, self).onchange_type(cr, uid, - line_id, - partner_id, - line_type, - context=context) + res = super(AccountBankStatementLine, self + ).onchange_type(cr, uid, line_id, partner_id, + line_type, context=context) if 'account_id' in res['value']: result = self.get_values_for_line(cr, uid, profile_id=profile_id, From 25e916cdcbdd0d007f6c742dda30473357f39ae7 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 21 Feb 2014 19:26:17 +0100 Subject: [PATCH 9/9] UPD account_statement_ext version --- account_statement_ext/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_ext/__openerp__.py b/account_statement_ext/__openerp__.py index c6000063..32c518b9 100644 --- a/account_statement_ext/__openerp__.py +++ b/account_statement_ext/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## {'name': "Bank statement extension and profiles", - 'version': '1.3.0', + 'version': '1.3.1', 'author': 'Camptocamp', 'maintainer': 'Camptocamp', 'category': 'Finance',