Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1564 Vistas

I have a problem that I have two different trees for buyers and sellers, but for some reason only the buyer tree is displayed.

Moreover, if you go to edit action in the debug menu, the seller tree will be displayed in the seller tab, and the buyer tree will be displayed in the buyer tab, but for some reason the system shows only the buyer tree.


Here is my code:

id="onova_seller_tree" model="ir.ui.view">
name="name">Seller list
name="model">res.partner
name="priority">30
name="inherit_id" ref="base.view_partner_tree"/>
name="arch" type="xml">
expr="//tree" position="replace">
default_order='create_date desc'>
name="create_date" string="Registration date" optional="show"/>
name="id_site" optional="show"/>
name="display_name" string="Contact" optional="show"/>
name="email" string="E-mail" optional="show"/>
name="phone" class="o_force_ltr" string="Phone number" optional="show"/>
name="sale_request_count" optional="show"/>
name="is_partner" optional="show"/>
name="is_object_partner" optional="show"/>





id="onova_buyer_tree" model="ir.ui.view">
name="name">Buyer list
name="model">res.partner
name="priority">40
name="inherit_id" ref="base.view_partner_tree"/>
name="arch" type="xml">
expr="//tree" position="replace">
default_order='create_date desc'>
name="create_date" string="Registration date" optional="show"/>
name="id_site" optional="show"/>
name="display_name" string="Contact" optional="show"/>
name="email" string="E-mail" optional="show"/>
name="phone" class="o_force_ltr" string="Phone number" optional="show"/>
name="buy_request_count" optional="show"/>





id="onova_sellers_action_window" model="ir.actions.act_window">
name="name">Sellers
name="res_model">res.partner
name="view_mode">tree,form
name="domain">[('is_seller','=',True)]
name="search_view_id" ref="onova_seller_search"/>


id="action_seller_view_tree" model="ir.actions.act_window.view">
name="sequence" eval="2"/>
name="view_mode">tree
name="view_id" ref="onova_seller_tree"/>
name="act_window_id" ref="onova_sellers_action_window"/>


id="onova_buyer_action_window" model="ir.actions.act_window">
name="name">Buyers
name="res_model">res.partner
name="view_mode">tree,form
name="domain">[('is_buyer','=',True)]


id="action_buyer_view_tree" model="ir.actions.act_window.view">
name="sequence" eval="2"/>
name="view_mode">tree
name="view_id" ref="onova_buyer_tree"/>
name="act_window_id" ref="onova_buyer_action_window"/>

Avatar
Descartar
Autor

I don't understand why my tags disappeared, so I pasted the code to pastebin: https://pastebin.com/RXSFgLdi

Mejor respuesta

Hello Denis, did you try to add a groups attribute in the tree view that replaces the origin tree view.

like 

groups='purchase.group_purchase_user'

Hope it would be helpful & regards.

Avatar
Descartar
Autor

I don't really understand how to do it
can you show an example etc.?
thank you

Sry,the code disappeared.
You can try to add this attribute in the tree tag.
Regards.

Autor

I don't think I've made myself clear enough
I don't want a certain group to see one tree and another group to see another
I have two menu items "buyers" and "sellers" and I want each tab to have its own tree
Sorry for the confusion and thank you for your help

You can try the 'sheet' and 'page' tag
It would be helpful to refer the purchase module, purchase.purchase_view.xml, line 209.
Regards.

Publicaciones relacionadas Respuestas Vistas Actividad
0
ene 21
4682
0
mar 23
1866
1
oct 21
3803
1
feb 19
6951
0
jun 23
2437