mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[14.0][ADD] New module web_custom_modifier
[14.0][ADD] New module web_custom_modifier
This commit is contained in:
committed by
Abdellatif Benzbiria
parent
fc63411fa1
commit
3917886453
19
web_custom_modifier/models/base.py
Normal file
19
web_custom_modifier/models/base.py
Normal 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
|
||||
Reference in New Issue
Block a user