[14.0][ADD] New module web_custom_modifier

[14.0][ADD] New module web_custom_modifier
This commit is contained in:
Abdellatif BENZBIRIA
2023-12-29 14:48:44 +01:00
committed by Abdellatif Benzbiria
parent fc63411fa1
commit 3917886453
39 changed files with 1553 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, models
from ..utils import set_custom_modifiers_on_fields
class Base(models.AbstractModel):
_inherit = "base"
@api.model
def fields_get(self, allfields=None, attributes=None):
"""Add the custom modifiers to the fields metadata."""
fields = super().fields_get(allfields, attributes)
modifiers = self.env["web.custom.modifier"].get(self._name)
set_custom_modifiers_on_fields(modifiers, fields)
return fields