diff --git a/account_statement_bankaccount_completion/statement.py b/account_statement_bankaccount_completion/statement.py index e09e2a35..48b81942 100644 --- a/account_statement_bankaccount_completion/statement.py +++ b/account_statement_bankaccount_completion/statement.py @@ -38,10 +38,6 @@ class AccountStatementCompletionRule(Model): 'From bank account number (Normal or IBAN)')) return res - _columns = { - 'function_to_call': fields.selection(_get_functions, 'Method'), - } - def get_from_bank_account(self, cr, uid, st_line, context=None): """ Match the partner based on the partner account number field diff --git a/account_statement_base_completion/statement.py b/account_statement_base_completion/statement.py index ce478a2b..c084ff59 100644 --- a/account_statement_base_completion/statement.py +++ b/account_statement_base_completion/statement.py @@ -139,6 +139,12 @@ class AccountStatementCompletionRule(orm.Model): ('get_from_label_and_partner_field', 'From line label (based on partner field)'), ('get_from_label_and_partner_name', 'From line label (based on partner name)')] + def __get_functions(self, cr, uid, context=None): + """ + Call method which can be inherited + """ + return self._get_functions(cr, uid, context=context) + _columns = { 'sequence': fields.integer('Sequence', help="Lower means parsed first."), 'name': fields.char('Name', size=128), @@ -146,7 +152,7 @@ class AccountStatementCompletionRule(orm.Model): 'account.statement.profile', rel='as_rul_st_prof_rel', string='Related statement profiles'), - 'function_to_call': fields.selection(_get_functions, 'Method'), + 'function_to_call': fields.selection(__get_functions, 'Method'), } def _find_invoice(self, cr, uid, st_line, inv_type, context=None): diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index b1497f48..4e9357c3 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -32,12 +32,15 @@ from openerp.tools.config import config class AccountStatementProfil(Model): _inherit = "account.statement.profile" - def get_import_type_selection(self, cr, uid, context=None): + def _get_import_type_selection(self, cr, uid, context=None): """This is the method to be inherited for adding the parser""" return [('generic_csvxls_so', 'Generic .csv/.xls based on SO Name')] - def _get_import_type_selection(self, cr, uid, context=None): - return self.get_import_type_selection(cr, uid, context=context) + def __get_import_type_selection(self, cr, uid, context=None): + """ + Call method which can be inherited + """ + return self._get_import_type_selection(cr, uid, context=context) _columns = { 'launch_import_completion': fields.boolean( @@ -48,7 +51,7 @@ class AccountStatementProfil(Model): # we remove deprecated as it floods logs in standard/warning level sob... 'rec_log': fields.text('log', readonly=True), # Deprecated 'import_type': fields.selection( - _get_import_type_selection, + __get_import_type_selection, 'Type of import', required=True, help="Choose here the method by which you want to import bank" diff --git a/account_statement_ofx_import/statement.py b/account_statement_ofx_import/statement.py index 15060360..56647f30 100644 --- a/account_statement_ofx_import/statement.py +++ b/account_statement_ofx_import/statement.py @@ -24,12 +24,12 @@ from openerp.osv import fields, orm class AccountStatementProfil(orm.Model): _inherit = "account.statement.profile" - def get_import_type_selection(self, cr, uid, context=None): + def _get_import_type_selection(self, cr, uid, context=None): """ Inherited from parent to add parser. """ selection = super(AccountStatementProfil, self - ).get_import_type_selection(cr, uid, + )._get_import_type_selection(cr, uid, context=context) selection.append(('ofx_so', _('OFX - Open Financial Exchange'))) return selection diff --git a/account_statement_regex_account_completion/statement.py b/account_statement_regex_account_completion/statement.py index e54f136e..a3fdd581 100644 --- a/account_statement_regex_account_completion/statement.py +++ b/account_statement_regex_account_completion/statement.py @@ -47,7 +47,6 @@ class AccountStatementCompletionRule(Model): return res _columns = { - 'function_to_call': fields.selection(_get_functions, 'Method'), 'regex': fields.char('Regular Expression', size=128), 'account_id': fields.many2one('account.account', string="Account to set"), } diff --git a/account_statement_so_completion/statement.py b/account_statement_so_completion/statement.py index dcf2378f..94b3a91c 100644 --- a/account_statement_so_completion/statement.py +++ b/account_statement_so_completion/statement.py @@ -88,7 +88,3 @@ class account_statement_completion_rule(orm.Model): context=context) res.update(st_vals) return res - - _columns = { - 'function_to_call': fields.selection(_get_functions, 'Method'), - } diff --git a/account_statement_transactionid_completion/statement.py b/account_statement_transactionid_completion/statement.py index a44d20a0..1c42ca68 100644 --- a/account_statement_transactionid_completion/statement.py +++ b/account_statement_transactionid_completion/statement.py @@ -41,10 +41,6 @@ class AccountStatementCompletionRule(Model): ] return res - _columns = { - 'function_to_call': fields.selection(_get_functions, 'Method'), - } - def get_from_transaction_id_and_so(self, cr, uid, st_line, context=None): """ Match the partner based on the transaction ID field of the SO. diff --git a/account_statement_transactionid_import/statement.py b/account_statement_transactionid_import/statement.py index 31258983..460e7321 100644 --- a/account_statement_transactionid_import/statement.py +++ b/account_statement_transactionid_import/statement.py @@ -26,22 +26,12 @@ from openerp.osv import fields class AccountStatementProfil(Model): _inherit = "account.statement.profile" - def get_import_type_selection(self, cr, uid, context=None): + def _get_import_type_selection(self, cr, uid, context=None): """ Has to be inherited to add parser """ - res = super(AccountStatementProfil, self).get_import_type_selection( + res = super(AccountStatementProfil, self)._get_import_type_selection( cr, uid, context=context) res.append(('generic_csvxls_transaction', 'Generic .csv/.xls based on SO transaction ID')) return res - - _columns = { - 'import_type': fields.selection( - get_import_type_selection, - 'Type of import', - required=True, - help="Choose here the method by which you want to import " - "bank statement for this profile."), - - }