mirror of
https://gitlab.com/flectra-community/server-ux.git
synced 2024-07-04 01:20:30 +00:00
32 lines
942 B
Python
32 lines
942 B
Python
|
# Migrated to v14.0 by Ashish Hirpara (https://www.ashish-hirpara.com)
|
||
|
# Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
|
||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||
|
|
||
|
from flectra import fields, models
|
||
|
|
||
|
|
||
|
class IrFilters(models.Model):
|
||
|
_inherit = "ir.filters"
|
||
|
_order = "model_id, sequence, name, id desc"
|
||
|
|
||
|
def _selection_type(self):
|
||
|
return [
|
||
|
("favorite", "Favorite"),
|
||
|
("filter", "Standard Filter"),
|
||
|
("groupby", "Standard Group By"),
|
||
|
]
|
||
|
|
||
|
sequence = fields.Integer()
|
||
|
type = fields.Selection(
|
||
|
selection="_selection_type",
|
||
|
string="Type",
|
||
|
required=True,
|
||
|
default="favorite",
|
||
|
)
|
||
|
groupby_field = fields.Many2one(
|
||
|
comodel_name="ir.model.fields",
|
||
|
string="Group By Field",
|
||
|
ondelete="cascade",
|
||
|
)
|
||
|
group_id = fields.Many2one(comodel_name="ir.filters.group", string="Filter Group")
|