Use deactivable mixin
issue4341 review38401002
This commit is contained in:
+2
-7
@@ -1,6 +1,6 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.model import ModelSQL, ModelView, DeactivableMixin, fields
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
from trytond.modules.product_classification.product import (
|
||||
@@ -49,18 +49,13 @@ class Cultivar(ClassificationMixin, ModelSQL, ModelView):
|
||||
'cultivar', 'group', 'Groups')
|
||||
|
||||
|
||||
class CultivarGroup(ModelSQL, ModelView):
|
||||
class CultivarGroup(DeactivableMixin, ModelSQL, ModelView):
|
||||
'Cultivar Group'
|
||||
__name__ = 'product.cultivar.group'
|
||||
name = fields.Char('Name', translate=True)
|
||||
active = fields.Boolean('Active')
|
||||
cultivars = fields.Many2Many('product.cultivar-product.cultivar.group',
|
||||
'group', 'cultivar', 'Cultivars')
|
||||
|
||||
@classmethod
|
||||
def default_active(cls):
|
||||
return True
|
||||
|
||||
|
||||
class Cultivar_CultivarGroup(ModelSQL):
|
||||
'Cultivar-CultivarGroup'
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="active" tree_invisible="1"/>
|
||||
</tree>
|
||||
|
||||
Reference in New Issue
Block a user