Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
9925 Zobrazení

In Odoo 8, in purchases, there was a tree view for products by category.


Does this view exist in Odoo 10? I can't find it, and the best I could come up with is to add a group on internal category to a products tree view, but that just groups to a flat level, no drilldown.

Avatar
Zrušit
Autor Nejlepší odpověď

Here's what I came up with. Mostly just a copy of Odoo 8 code, but with an adjustment to where the menu is.


<odoo>
  <record id="product_category_tree_view" model="ir.ui.view">
    <field name="name">product.category.tree</field>
    <field name="model">product.category</field>
    <field name="field_parent">child_id</field>
    <field name="arch" type="xml">
        <tree toolbar="True" string="Product Categories">
            <field name="name"/>
        </tree>
    </field>
  </record>
  
  <record id="product_category_action" model="ir.actions.act_window">
    <field name="name">Products by Category</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">product.category</field>
    <field name="domain">[('parent_id','=',False)]</field>
    <field name="view_type">tree</field>
    <field name="view_id" ref="product_category_tree_view"/>
    <field name="help" type="html">
      <p>
        Here is a list of all your products classified by category. You
        can click a category to get the list of all products linked to
        this category or to a child of this category.
      </p>
    </field>
  </record>

  <menuitem
      action="product_category_action"
      id="product.menu_products_category"
      parent="purchase.menu_procurement_management"
      sequence="30" groups="base.group_no_one"/>

    <record id="product_normal_action_tree" model="ir.actions.act_window">
      <field name="name">Product Variants</field>
      <field name="type">ir.actions.act_window</field>
      <field name="res_model">product.product</field>
      <field name="view_type">form</field>
      <field name="view_mode">tree,form,kanban</field>
      <field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
    </record>


  <record id="ir_product_category_open" model="ir.values">
    <field eval="'tree_but_open'" name="key2"/>
    <field eval="'product.category'" name="model"/>
    <field name="name">Products by Categories</field>
    <field eval="'ir.actions.act_window,%d'%product_normal_action_tree" name="value"/>
  </record>

</odoo>
Avatar
Zrušit
Nejlepší odpověď

Hi Jerome,

In Odoo V10, you can find the product categories from,

Purchase -> Configuration -> Products ->Product Categories, then you can open any of the categories, then to view the products in this category you can click on the Products Smart Button.


Thank You

Avatar
Zrušit
Autor

So the information is available, but no in a single view. I'll make one then. Thanks!

With the Studio apps, simply select the module (sales or purchases or warehouse...) and then add the category field (then move the menu line to where you need it inside the menu

Related Posts Odpovědi Zobrazení Aktivita
1
kvě 18
2683
1
lis 24
20222
1
zář 23
3035
3
kvě 23
5635
7
dub 23
49011