Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1677 Widoki

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

Awatar
Odrzuć
Autor

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

Najlepsza odpowiedź

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.

Awatar
Odrzuć
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.

Powiązane posty Odpowiedzi Widoki Czynność
0
sty 21
4826
0
mar 23
1997
1
paź 21
3985
1
lut 19
7184
0
cze 23
2548