تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3006 أدوات العرض

Hello Community,

i've created 2 submenus for Quotation view, just to be able to see quotation which comes by different sales channels.

my aim is just to create different search filter for each of them to see it by default, but looks like i can have only one of them active at once. 

or maybe i'm doing something wrong?

in other words - is it possible to have different default views for each sub-menus?

here is some screenshots:

http://prntscr.com/kqrjs5

http://prntscr.com/kqrkmj


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

For this, you have to write two separate actions for the menus. Right now you may have given the same action for both the menus.

Just copy the existing action of the menu and create a new action and assign it for the second menu item. In this action, you can change the default filter.


<record id="action_account_analytic_account_form" model="ir.actions.act_window">
<field name="name">Analytic Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
<field name="search_view_id" ref="view_account_analytic_account_search"/>
<field name="context">{'search_default_active':1}</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
</record>


Update;

As you are looking to do it from the user interface, you can follow this,

1. Duplicate the Existing Action record and assign this record as the action of the second menu.

2. Now to give new default filter for the second menu, edit the context in the action



Thanks

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

hi, many thanks for answer, but could you pls clarify a bit how should i copy action? (i'm relatively new to odoo).

here what i see in "Edit action" menu:

http://prntscr.com/kqscqu


thank you in advance!

الصورة الرمزية
إهمال
الكاتب

hi, sorry, cannot reply under your answer, only below this comment.

how can i duplicate action? i see no such possibility. when i rename action for one menu - it also renames for second...

الكاتب

ok, i've managed to duplicate Action:

http://prntscr.com/kqtm5e

but this action is not selectable to assign it to menu:

http://prntscr.com/kqtmq4

what i'm doing wrong?

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 19
6454
1
مارس 18
6767
1
يونيو 17
4050
2
يوليو 25
4257
2
ديسمبر 24
7486