[FIX] FeesComputer model specification to act as a abstract class without needing overriding

This commit is contained in:
Nicolas Bessi
2014-04-28 10:42:01 +02:00
parent b37155d3a7
commit 09bfe1afa4

View File

@@ -22,22 +22,22 @@ from openerp.osv import orm
from openerp.tools.translate import _
class FeesComputer(orm.TransientModel):
class FeesComputer(orm.BaseModel):
"""Model that compute dunnig fees.
This class does not need any database storage as
it contains pure logic.
It inherits form `TransientModel` to benefit of orm facility
I could have created a new Class that inherit form BaseModel
but it did not look pertinent on this context
It inherits form ``orm.BaseModel`` to benefit of orm facility
Similar to AbstractModel but log access and actions
"""
_name = 'credit.control.dunning.fees.computer'
_auto = False
_log_access = True
_register = False
_transient = False
def _get_compute_fun(self, level_fees_type):
"""Retrieve function of class that should compute the fees based on type