diff --git a/attribute_set/README.rst b/attribute_set/README.rst index 7491ee130..2cac28a72 100644 --- a/attribute_set/README.rst +++ b/attribute_set/README.rst @@ -68,17 +68,17 @@ Attributes**. An Attribute is related to both an Attribute Group and an Attribute Set : -- The **Attribute Set** is related to the *"model's category"*, i.e. - all the model's instances which will display the same Attributes. +- The **Attribute Set** is related to the *"model's category"*, i.e. all + the model's instances which will display the same Attributes. -- The **Attribute Group** is related to the *"attribute's category"*. - All the attributes from the same Attribute Set and Attribute Group - will be displayed under the same field's Group in the model's view. +- The **Attribute Group** is related to the *"attribute's category"*. + All the attributes from the same Attribute Set and Attribute Group + will be displayed under the same field's Group in the model's view. - 🔎 In order to create a custom Attribute many2one or many2many - related to **other Odoo model**, you need to activate the - Technical Setting **"Advanced Attribute Set settings"** - (``group_advanced_attribute_set``). + 🔎 In order to create a custom Attribute many2one or many2many + related to **other Odoo model**, you need to activate the Technical + Setting **"Advanced Attribute Set settings"** + (``group_advanced_attribute_set``). -------------- @@ -121,12 +121,13 @@ Authors Contributors ------------ -- Sébastien BEAU -- Clément Mombereau -- Benoît Guillot -- Akretion Raphaël VALYI -- David Dufresne -- Denis Roussel +- Sébastien BEAU +- Clément Mombereau +- Benoît Guillot +- Akretion Raphaël VALYI +- David Dufresne +- Denis Roussel +- Mohamed Alkobrosli Maintainers ----------- diff --git a/attribute_set/__manifest__.py b/attribute_set/__manifest__.py index 1183c4b01..50f60fa13 100644 --- a/attribute_set/__manifest__.py +++ b/attribute_set/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Attribute Set", - "version": "16.0.1.1.0", + "version": "17.0.1.0.0", "category": "Generic Modules/Others", "license": "AGPL-3", "author": "Akretion,Odoo Community Association (OCA)", diff --git a/attribute_set/i18n/attribute_set.pot b/attribute_set/i18n/attribute_set.pot index 04ce538ab..c90d03b1a 100644 --- a/attribute_set/i18n/attribute_set.pot +++ b/attribute_set/i18n/attribute_set.pot @@ -119,11 +119,6 @@ msgstr "" msgid "Can't change the type of an attribute. Please create a new one." msgstr "" -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "Cancel" -msgstr "" - #. module: attribute_set #: model:ir.model.fields.selection,name:attribute_set.selection__attribute_attribute__attribute_type__char msgid "Char" @@ -180,7 +175,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__create_uid -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__create_uid msgid "Created by" msgstr "" @@ -193,7 +187,6 @@ msgstr "" #. module: attribute_set #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__create_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__create_date -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__create_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__create_date msgid "Created on" msgstr "" @@ -203,11 +196,6 @@ msgstr "" msgid "Custom" msgstr "" -#. module: attribute_set -#: model:ir.model,name:attribute_set.model_attribute_option_wizard -msgid "Custom Attributes Option" -msgstr "" - #. module: attribute_set #: model:ir.model.fields.selection,name:attribute_set.selection__attribute_attribute__attribute_type__date msgid "Date" @@ -235,7 +223,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__display_name -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__display_name msgid "Display Name" msgstr "" @@ -313,7 +300,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__id -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__id msgid "ID" msgstr "" @@ -404,7 +390,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_group____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_option____last_update -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_set____last_update msgid "Last Modified on" msgstr "" @@ -413,7 +398,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__write_uid -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__write_uid msgid "Last Updated by" msgstr "" @@ -422,7 +406,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__write_date -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__write_date msgid "Last Updated on" msgstr "" @@ -477,17 +460,8 @@ msgstr "" msgid "On delete property for many2one fields" msgstr "" -#. module: attribute_set -#. odoo-python -#: code:addons/attribute_set/models/attribute_attribute.py:0 -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -#, python-format -msgid "Options Wizard" -msgstr "" - #. module: attribute_set #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__attribute_id -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__attribute_id msgid "Product Attribute" msgstr "" @@ -717,11 +691,6 @@ msgid "" "Used for custom many2many fields to define a custom relation table name" msgstr "" -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "Validate" -msgstr "" - #. module: attribute_set #: model:ir.model.fields,help:attribute_set.field_attribute_attribute__copied msgid "Whether the value is copied when duplicating a record." @@ -753,13 +722,3 @@ msgid "" "Specify a Python expression defining a list of triplets.\n" "For example : `[('color', '=', 'red')]`" msgstr "" - -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "options_placeholder" -msgstr "" - -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "or" -msgstr "" diff --git a/attribute_set/i18n/es.po b/attribute_set/i18n/es.po index 19770e1ae..d90d41ded 100644 --- a/attribute_set/i18n/es.po +++ b/attribute_set/i18n/es.po @@ -126,11 +126,6 @@ msgstr "" msgid "Can't change the type of an attribute. Please create a new one." msgstr "No se puede cambiar el tipo de un atributo. Por favor, cree uno nuevo." -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "Cancel" -msgstr "Cancelar" - #. module: attribute_set #: model:ir.model.fields.selection,name:attribute_set.selection__attribute_attribute__attribute_type__char msgid "Char" @@ -194,7 +189,6 @@ msgstr "Copiado" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__create_uid -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__create_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__create_uid msgid "Created by" msgstr "Creado por" @@ -207,7 +201,6 @@ msgstr "Fecha de creación" #. module: attribute_set #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__create_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__create_date -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__create_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__create_date msgid "Created on" msgstr "Creado el" @@ -217,11 +210,6 @@ msgstr "Creado el" msgid "Custom" msgstr "Personalizar" -#. module: attribute_set -#: model:ir.model,name:attribute_set.model_attribute_option_wizard -msgid "Custom Attributes Option" -msgstr "Opción Atributos personalizados" - #. module: attribute_set #: model:ir.model.fields.selection,name:attribute_set.selection__attribute_attribute__attribute_type__date msgid "Date" @@ -253,7 +241,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__display_name -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__display_name #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__display_name msgid "Display Name" msgstr "Mostrar Nombre" @@ -333,7 +320,6 @@ msgstr "Grupos" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__id -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__id #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__id msgid "ID" msgstr "ID" @@ -455,7 +441,6 @@ msgstr "" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_group____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_option____last_update -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard____last_update #: model:ir.model.fields,field_description:attribute_set.field_attribute_set____last_update msgid "Last Modified on" msgstr "Última actualización el" @@ -464,7 +449,6 @@ msgstr "Última actualización el" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__write_uid -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__write_uid #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__write_uid msgid "Last Updated by" msgstr "Última actualización por" @@ -473,7 +457,6 @@ msgstr "Última actualización por" #: model:ir.model.fields,field_description:attribute_set.field_attribute_attribute__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_group__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__write_date -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__write_date #: model:ir.model.fields,field_description:attribute_set.field_attribute_set__write_date msgid "Last Updated on" msgstr "Última Actualización el" @@ -528,17 +511,8 @@ msgstr "En Eliminar" msgid "On delete property for many2one fields" msgstr "En la propiedad eliminar para campos many2one" -#. module: attribute_set -#. odoo-python -#: code:addons/attribute_set/models/attribute_attribute.py:0 -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -#, python-format -msgid "Options Wizard" -msgstr "Asistente para Opciones" - #. module: attribute_set #: model:ir.model.fields,field_description:attribute_set.field_attribute_option__attribute_id -#: model:ir.model.fields,field_description:attribute_set.field_attribute_option_wizard__attribute_id msgid "Product Attribute" msgstr "Atributo de Producto" @@ -784,11 +758,6 @@ msgstr "" "Se utiliza en los campos many2many personalizados para definir un nombre de " "tabla de relación personalizado" -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "Validate" -msgstr "Validar" - #. module: attribute_set #: model:ir.model.fields,help:attribute_set.field_attribute_attribute__copied msgid "Whether the value is copied when duplicating a record." @@ -825,13 +794,3 @@ msgstr "" "`%(domain)s` es un nombre de dominio inválido.\n" "Especifica una expresión Python que define una lista de tripletas.\n" "Por ejemplo: `[('color', '=', 'red')]`" - -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "options_placeholder" -msgstr "options_placeholder" - -#. module: attribute_set -#: model_terms:ir.ui.view,arch_db:attribute_set.attribute_option_wizard_form_view -msgid "or" -msgstr "o" diff --git a/attribute_set/models/attribute_attribute.py b/attribute_set/models/attribute_attribute.py index 62b93e091..47ba596c8 100644 --- a/attribute_set/models/attribute_attribute.py +++ b/attribute_set/models/attribute_attribute.py @@ -130,7 +130,7 @@ def _build_attribute_field(self, attribute_egroup): Conditional invisibility based on its attribute sets. """ self.ensure_one() - kwargs = {"name": "%s" % self.name} + kwargs = {"name": f"{self.name}"} kwargs["attrs"] = str(self._get_attrs()) if self.widget: kwargs["widget"] = self.widget @@ -154,7 +154,7 @@ def _build_attribute_field(self, attribute_egroup): else: # Display only options linked to an existing object ids = [op.value_ref.id for op in self.option_ids if op.value_ref] - kwargs["domain"] = "[('id', 'in', %s)]" % ids + kwargs["domain"] = f"[('id', 'in', {ids})]" # Add color options if the attribute's Relational Model # has a color field relation_model_obj = self.env[self.relation_model_id.model] @@ -163,8 +163,8 @@ def _build_attribute_field(self, attribute_egroup): elif self.nature == "custom": # Define field's domain and context with attribute's id to go along with # Attribute Options search and creation - kwargs["domain"] = "[('attribute_id', '=', %s)]" % (self.id) - kwargs["context"] = "{'default_attribute_id': %s}" % (self.id) + kwargs["domain"] = f"[('attribute_id', '=', {self.id})]" + kwargs["context"] = f"{{'default_attribute_id': {self.id}}}" elif self.nature != "custom": kwargs["context"] = self._get_native_field_context() @@ -215,10 +215,11 @@ def _build_attribute_eview(self): attrs=f"{{'invisible' : {hide_domain} }}", ) groups.append(att_group) - setup_modifiers(attribute_egroup) attribute_with_env = ( - attribute.sudo() if attribute.check_access_rights("read") else self + attribute.sudo() + if not attribute.check_access_rights("read") + else attribute ) attribute_with_env._build_attribute_field(attribute_egroup) @@ -237,7 +238,7 @@ def onchange_field_description(self): def onchange_name(self): name = self.name if not name.startswith("x_"): - self.name = "x_%s" % name + self.name = f"x_{name}" @api.onchange("attribute_type") def onchange_attribute_type(self): @@ -277,7 +278,7 @@ def button_add_options(self): # Then open the Options Wizard which will display an 'opt_ids' m2m field related # to the 'relation_model_id' model return { - "context": dict(self.env.context, attribute_id=self.id), + "context": {"default_attribute_id": self.id}, "name": _("Options Wizard"), "view_type": "form", "view_mode": "form", @@ -325,7 +326,8 @@ def create(self, vals_list): vals["ttype"] = "many2many" vals["relation"] = relation # Specify the relation_table's name in case of m2m not serialized - # to avoid creating the same default relation_table name for any attribute + # to avoid creating the same default + # relation_table name for any attribute # linked to the same attribute.option or relation_model_id's model. if not vals.get("serialized"): att_model_id = self.env["ir.model"].browse(vals["model_id"]) @@ -450,9 +452,6 @@ def write(self, vals): if att.relation_model_id: options = self.env[att.relation_model_id.model] if "option_ids" in list(vals.keys()): - # Delete related attribute.option.wizard if an attribute.option - # has been deleted - att._delete_related_option_wizard(vals["option_ids"]) # If there is still some attribute.option available, override # 'options' with the objects they are refering to. options = options.search( diff --git a/attribute_set/models/attribute_option.py b/attribute_set/models/attribute_option.py index 90ad0e668..3b3ba4a9b 100644 --- a/attribute_set/models/attribute_option.py +++ b/attribute_set/models/attribute_option.py @@ -22,7 +22,6 @@ def _selection_model_list(self): value_ref = fields.Reference( selection="_selection_model_list", string="Reference", - groups="base.group_erp_manager", ) attribute_id = fields.Many2one( diff --git a/attribute_set/readme/CONTRIBUTORS.md b/attribute_set/readme/CONTRIBUTORS.md index 9a0083a6a..b271d61ef 100644 --- a/attribute_set/readme/CONTRIBUTORS.md +++ b/attribute_set/readme/CONTRIBUTORS.md @@ -4,3 +4,4 @@ - Akretion Raphaël VALYI \<\> - David Dufresne \<\> - Denis Roussel \<\> +- Mohamed Alkobrosli \<\> diff --git a/attribute_set/static/description/index.html b/attribute_set/static/description/index.html index d0ac75dd4..5612f080c 100644 --- a/attribute_set/static/description/index.html +++ b/attribute_set/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -412,16 +412,16 @@

Usage

An Attribute is related to both an Attribute Group and an Attribute Set :

    -
  • The Attribute Set is related to the “model’s category”, i.e. -all the model’s instances which will display the same Attributes.

    +
  • The Attribute Set is related to the “model’s category”, i.e. all +the model’s instances which will display the same Attributes.

  • The Attribute Group is related to the “attribute’s category”. All the attributes from the same Attribute Set and Attribute Group will be displayed under the same field’s Group in the model’s view.

    🔎 In order to create a custom Attribute many2one or many2many -related to other Odoo model, you need to activate the -Technical Setting “Advanced Attribute Set settings” +related to other Odoo model, you need to activate the Technical +Setting “Advanced Attribute Set settings” (group_advanced_attribute_set).

  • @@ -469,12 +469,15 @@

    Contributors

  • Akretion Raphaël VALYI <raphael.valyi@akretion.com>
  • David Dufresne <david.dufresne@savoirfairelinux.com>
  • Denis Roussel <denis.roussel@acsone.eu>
  • +
  • Mohamed Alkobrosli <malkobrosly@kencove.com>

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

diff --git a/attribute_set/tests/test_build_view.py b/attribute_set/tests/test_build_view.py index b22f7fdc4..cfb74d251 100644 --- a/attribute_set/tests/test_build_view.py +++ b/attribute_set/tests/test_build_view.py @@ -34,7 +34,8 @@ def setUpClass(cls): cls.demo = cls.env.ref("base.user_demo") # This user will have access to - cls.attribute_manager_user = cls.env["res.users"].create( + cls.attribute_manager_user = cls.env.ref("base.user_admin") + cls.attribute_manager_user.write( { "name": "Attribute Manager", "login": "attribute_manager", @@ -163,7 +164,7 @@ def setUpClass(cls): @classmethod def tearDownClass(cls): cls.loader.restore_registry() - return super(BuildViewCase, cls).tearDownClass() + return super().tearDownClass() # TEST write on attributes @users("demo") @@ -276,9 +277,7 @@ def test_render_all_field_type(self): "attribute_set_ids": [(6, 0, [self.set_1.id])], } ) - new_self = self - new_self.env = self.env(user=self.demo, su=False) - attr = new_self._get_attr_element(name) + attr = self._get_attr_element(name) self.assertIsNotNone(attr) if attr_type == "text": self.assertTrue(attr.get("nolabel")) @@ -344,18 +343,20 @@ def test_unlink_native_attribute(self): ) # TEST form views rendering - @users("demo") + @users("attribute_manager") def test_model_form(self): # Test attributes modifications through form self.assertFalse(self.partner.x_attr_3) with Form( - self.partner.with_user(self.demo).with_context(load_all_views=True) + self.partner.with_user(self.attribute_manager_user).with_context( + load_all_views=True + ) ) as partner_form: partner_form.attribute_set_id = self.set_1 partner_form.x_attr_3 = True partner_form.x_attr_select = self.attr_select_option partner_form.x_multi_attribute.add(self.multi_attribute.option_ids[0]) - partner = partner_form.save().with_user(self.demo) + partner = partner_form.save().with_user(self.attribute_manager_user) self.assertTrue(partner.x_attr_3) self.assertTrue(partner.x_attr_select) # As options are Many2many, Form() is not able to render the sub form @@ -369,7 +370,7 @@ def test_models_fields_for_get_views(self): # and added to the view are correctly added to the list of fields # to load for the view result = self.env["res.partner"].get_views([(self.view.id, "form")]) - fields = result["models"].get("res.partner") + fields = result["models"].get("res.partner").get("fields") self.assertIn("x_attr_1", fields) self.assertIn("x_attr_2", fields) self.assertIn("x_attr_3", fields) diff --git a/attribute_set/tests/test_custom_attribute.py b/attribute_set/tests/test_custom_attribute.py index e21dbd222..1af8bb0f7 100644 --- a/attribute_set/tests/test_custom_attribute.py +++ b/attribute_set/tests/test_custom_attribute.py @@ -25,8 +25,10 @@ def _create_attribute(self, vals): { "nature": "custom", "model_id": self.model_id, - "field_description": "Attribute %s" % vals["attribute_type"], - "name": "x_%s" % vals["attribute_type"], + "field_description": "Attribute {key}".format( + key=vals["attribute_type"] + ), + "name": "x_{key}".format(key=vals["attribute_type"]), "attribute_group_id": self.group.id, } ) diff --git a/attribute_set/views/attribute_attribute_view.xml b/attribute_set/views/attribute_attribute_view.xml index c1bb7042a..6bedd8503 100644 --- a/attribute_set/views/attribute_attribute_view.xml +++ b/attribute_set/views/attribute_attribute_view.xml @@ -7,7 +7,7 @@
- - - + + + + - - + + - + @@ -60,11 +46,9 @@ name="field_id" string="Related native field" options="{'no_create_edit': 1}" - attrs="{ - 'required': [('nature', '=', 'native')], - 'invisible': [('nature', '=', 'custom')], - 'readonly': [('model_id', '=', False)], - }" + required="nature == 'native'" + invisible="nature == 'custom'" + readonly="not model_id" /> @@ -94,23 +78,14 @@ col="4" > - - + + - +