Skip to content

Commit

Permalink
[MIG] attribute_set: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dnplkndll committed Feb 5, 2025
1 parent d250c19 commit e0880c9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions attribute_set/utils/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def transfer_field_to_modifiers(field, modifiers):


# Don't deal with groups, it is done by check_group().
# Need the context to evaluate the invisible attribute on tree views.
# Need the context to evaluate the invisible attribute on list views.
# For non-tree views, the context shouldn't be given.
def transfer_node_to_modifiers(node, modifiers, context=None, in_tree_view=False):
if node.get("attrs"):
Expand All @@ -47,7 +47,7 @@ def transfer_node_to_modifiers(node, modifiers, context=None, in_tree_view=False
if node.get(a):
v = bool(safe_eval(node.get(a), {"context": context or {}}))
if in_tree_view and a == "invisible":
# Invisible in a tree view has a specific meaning, make it a
# Invisible in a list view has a specific meaning, make it a
# new key in the modifiers attribute.
modifiers["column_invisible"] = v
elif v or (a not in modifiers or not isinstance(modifiers[a], list)):
Expand Down Expand Up @@ -77,7 +77,7 @@ def setup_modifiers(node, field=None, context=None, in_tree_view=False):
:param dict context: execution context used to evaluate node attributes
:param bool in_tree_view: triggers the ``column_invisible`` code
path (separate from ``invisible``): in
tree view there are two levels of
list view there are two levels of
invisibility, cell content (a column is
present but the cell itself is not
displayed) with ``invisible`` and column
Expand Down
12 changes: 6 additions & 6 deletions attribute_set/views/attribute_attribute_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</group>
<group col="4" colspan="4">
<field name="option_ids" string="Attribute Options" colspan="4">
<tree editable="top">
<list editable="top">
<field
name="relation_model_id"
column_invisible="True"
Expand All @@ -105,7 +105,7 @@
name="name"
invisible="relation_model_id and not value_ref"
/>
</tree>
</list>
</field>
</group>
</group>
Expand All @@ -116,7 +116,7 @@
<field name="name">attribute.attribute.tree</field>
<field name="model">attribute.attribute</field>
<field name="arch" type="xml">
<tree>
<list>
<field
name="sequence"
widget="handle"
Expand All @@ -127,7 +127,7 @@
<field name="attribute_group_id" />
<field name="attribute_set_ids" widget="many2many_tags" />
<field name="nature" />
</tree>
</list>
</field>
</record>
<record id="view_attribute_attribute_search" model="ir.ui.view">
Expand All @@ -143,15 +143,15 @@
<record id="attribute_attribute_form_action" model="ir.actions.act_window">
<field name="name">Attributes</field>
<field name="res_model">attribute.attribute</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_attribute_attribute_search" />
<field name="context">{}</field>
<field name="help" />
</record>
<record id="attribute_attribute_sort_action" model="ir.actions.act_window">
<field name="name">Attributes</field>
<field name="res_model">attribute.attribute</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_attribute_attribute_search" />
<field name="context">
{"search_default_attribute_group_id": id, "active_attribute_sort":
Expand Down
6 changes: 3 additions & 3 deletions attribute_set/views/attribute_group_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<record id="attribute_group_tree_view" model="ir.ui.view">
<field name="model">attribute.group</field>
<field name="arch" type="xml">
<tree editable="bottom">
<list editable="bottom">
<field name="sequence" widget="handle" />
<field name="name" />
<field
Expand All @@ -27,7 +27,7 @@
type="action"
icon="fa-sort-amount-asc"
/>
</tree>
</list>
</field>
</record>
<record id="attribute_group_search_view" model="ir.ui.view">
Expand All @@ -41,7 +41,7 @@
<record id="attribute_group_action" model="ir.actions.act_window">
<field name="name">Attribute Groups</field>
<field name="res_model">attribute.group</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="attribute_group_search_view" />
<field name="context">{}</field>
<field name="help" />
Expand Down
8 changes: 4 additions & 4 deletions attribute_set/views/attribute_option_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
<field name="model">attribute.option</field>
<field eval="20" name="priority" />
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="sequence" />
<field
name="value_ref"
groups="attribute_set.group_advanced_attribute_set"
/>
<field name="attribute_id" />
</tree>
</list>
</field>
</record>
<record id="view_attribute_option_search" model="ir.ui.view">
Expand All @@ -73,7 +73,7 @@
<record id="attribute_option_form_action" model="ir.actions.act_window">
<field name="name">Attribute Options</field>
<field name="res_model">attribute.option</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="view_id" ref="attribute_option_tree_view" />
<field name="search_view_id" ref="view_attribute_option_search" />
<field name="context">{"search_default_user_id":uid}</field>
Expand All @@ -83,7 +83,7 @@
<field name="sequence" eval="1" />
<field name="act_window_id" ref="attribute_option_form_action" />
<field name="view_id" ref="attribute_option_tree_view" />
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
</record>
<record id="attribute_option_form_action_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2" />
Expand Down
10 changes: 5 additions & 5 deletions attribute_set/views/attribute_set_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
domain="[('model_id', '=', model_id)]"
nolabel="1"
>
<tree>
<list>
<field name="name" />
<field name="field_description" />
<field name="attribute_type" />
<field name="required" />
<field name="sequence" />
<field name="attribute_group_id" />
</tree>
</list>
</field>
</group>
</form>
Expand All @@ -38,10 +38,10 @@
<field name="name">attribute.set.tree</field>
<field name="model">attribute.set</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="model_id" />
</tree>
</list>
</field>
</record>
<record id="view_attribute_set_search" model="ir.ui.view">
Expand All @@ -57,7 +57,7 @@
<record id="attribute_set_form_action" model="ir.actions.act_window">
<field name="name">Attribute Sets</field>
<field name="res_model">attribute.set</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_attribute_set_search" />
<field name="context">{"search_default_user_id":uid}</field>
<field name="help" />
Expand Down

0 comments on commit e0880c9

Please sign in to comment.