diff --git a/account_statement_so_completion/statement.py b/account_statement_so_completion/statement.py index f41fd906..dcf2378f 100644 --- a/account_statement_so_completion/statement.py +++ b/account_statement_so_completion/statement.py @@ -28,9 +28,18 @@ from tools.translate import _ from openerp.addons.account_statement_base_completion.statement import ErrorTooManyPartner -class account_statement_profile(orm.Model): +class account_statement_completion_rule(orm.Model): - _inherit = "account.statement.profile" + _name = "account.statement.completion.rule" + _inherit = "account.statement.completion.rule" + + def _get_functions(self, cr, uid, context=None): + res = super(account_statement_completion_rule, self)._get_functions( + cr, uid, context=context) + res.append( + ('get_from_ref_and_so', 'From line reference (based on SO number)') + ) + return res # Should be private but data are initialised with no update XML def get_from_ref_and_so(self, cr, uid, st_line, context=None): @@ -80,20 +89,6 @@ class account_statement_profile(orm.Model): res.update(st_vals) return res - -class account_statement_completion_rule(orm.Model): - - _name = "account.statement.completion.rule" - _inherit = "account.statement.completion.rule" - - def _get_functions(self, cr, uid, context=None): - res = super(account_statement_completion_rule, self)._get_functions( - cr, uid, context=context) - res.append( - ('get_from_ref_and_so', 'From line reference (based on SO number)') - ) - return res - _columns = { 'function_to_call': fields.selection(_get_functions, 'Method'), }