Use deactivable mixin
issue4341 review38401002
This commit is contained in:
1 parent
f0388970db
commit
2d496572b4
2 files changed
+2
-8
No files matched your search
+2
-7
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from collections import defaultdict
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, fields, Unique
|
||||
from trytond.model import ModelView, ModelSQL, DeactivableMixin, fields, Unique
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
@@ -10,11 +10,10 @@ from trytond.transaction import Transaction
|
||||
__all__ = ['Fee', 'Level', 'Dunning', 'FeeDunningLevel', 'Letter']
|
||||
|
||||
|
||||
class Fee(ModelSQL, ModelView):
|
||||
class Fee(DeactivableMixin, ModelSQL, ModelView):
|
||||
'Account Dunning Fee'
|
||||
__name__ = 'account.dunning.fee'
|
||||
name = fields.Char('Name', required=True, translate=True)
|
||||
active = fields.Boolean('Active', select=True)
|
||||
product = fields.Many2One('product.product', 'Product', required=True,
|
||||
domain=[
|
||||
('type', '=', 'service'),
|
||||
@@ -33,10 +32,6 @@ class Fee(ModelSQL, ModelView):
|
||||
},
|
||||
depends=['compute_method'])
|
||||
|
||||
@classmethod
|
||||
def default_active(cls):
|
||||
return True
|
||||
|
||||
def get_amount(self, dunning):
|
||||
'Return fee amount and currency'
|
||||
amount, currency = None, None
|
||||
|
||||
@@ -6,5 +6,4 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="product"/>
|
||||
<field name="journal"/>
|
||||
<field name="compute_method"/>
|
||||
<field name="active" tree_invisible="1"/>
|
||||
</tree>
|
||||
Reference in new issue
Block a user