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

Hello everyone,

I am trying to create a button that clicks it go to product view(tree) and add automatically partner_id to the search field.

<button class="oe_stat_button" type="action" name="%(product.product_search_form_view)d" context="{'search_default_partner_id': active_id}" attrs="{'invisible': [('product_count', '=', 0)]}" icon="fa-dropbox">

<field string="Products" name="product_count" widget="statinfo"/>

</button>

When i click on the button it goes to Tasks view.. 

Ta
الصورة الرمزية
إهمال

Have a look into odoo customization tips: https://www.scoop.it/t/learn-openerp

أفضل إجابة

Hi Gabriel: The model on which product.product_search_form_view is based does not have a partner_id field in it. On which screen are you trying to add this button ?

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

I add this field on the model.

Its a Custom model wich i put that field

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 21
7245
0
يناير 23
2125
1
أكتوبر 22
2275
3
أغسطس 20
4461
2
مارس 15
8056