Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1698 Lượt xem

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"/>

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 21
4843
0
thg 3 23
2024
1
thg 10 21
3989
1
thg 2 19
7202
0
thg 6 23
2557