Skip to content

Commit

Permalink
[IMP] fermente_product. Improve actions and views
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Nov 26, 2024
1 parent 57ec887 commit b8e7a41
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
1 change: 1 addition & 0 deletions fermente_product/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"depends": ["product"],
"data": [
"views/view_product_template.xml",
"views/view_product_product.xml",
],
}
4 changes: 3 additions & 1 deletion fermente_product/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ Customize Odoo / odoo / ``product`` module.
category.

* Set default ``list`` view for product, and not ``kanban`` (save planet and ressources).
(A product image is one server call)
(A product image is one server call)

* Refactor ``product.product`` and ``product.template`` list views.
40 changes: 40 additions & 0 deletions fermente_product/views/view_product_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>


<record id="view_product_product_form" model="ir.ui.view">
<field name="model">product.product</field>
<field name="priority" eval="100" />
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">

<!-- HIDE fields by default -->
<field name="priority" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="product_template_variant_value_ids" position="attributes">
<attribute name="optional">hide</attribute>
</field>

<!-- SHOW fields by default -->
<field name="categ_id" position="attributes">
<attribute name="optional">show</attribute>
</field>

<!-- MOVE fields -->
<field name="name" position="after">
<field name="categ_id" position="move"/>
</field>
<field name="lst_price" position="before">
<field name="standard_price" position="move"/>
</field>

</field>
</record>

</odoo>
33 changes: 33 additions & 0 deletions fermente_product/views/view_product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,37 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="view_mode">tree,kanban,form,activity</field>
</record>


<record id="view_product_template_form" model="ir.ui.view">
<field name="model">product.template</field>
<field name="priority" eval="100" />
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">

<!-- HIDE fields by default -->
<field name="priority" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="product_tag_ids" position="attributes">
<attribute name="optional">hide</attribute>
</field>

<!-- SHOW fields by default -->
<field name="categ_id" position="attributes">
<attribute name="optional">show</attribute>
</field>

<!-- MOVE fields -->
<field name="name" position="before">
<field name="default_code" position="move"/>
</field>
<field name="name" position="after">
<field name="categ_id" position="move"/>
</field>
<field name="list_price" position="before">
<field name="standard_price" position="move"/>
</field>
</field>
</record>

</odoo>

0 comments on commit b8e7a41

Please sign in to comment.