Hello Guys
I have created a report like this :
<report
id="action_report_batch_product_config"
string="GuiLherme Configuration Configuration"
model="stock.picking.batch"
report_type="qweb-pdf"
name="teste2"
file="teste2"
paperformat=format_teste"
menu="True"
print_report_name="'Batch Product Config- %s' % (object.name)"
/>
It worked as expected. However I need to show it and sometimes I need to get it invisible due the value that I have in the stock.picking.batch model.
Could u please help me on that ?
Thank you so much
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi,
Easily what you can do is that, hide the report from the print by giving menu="False" inside the report tag(which you shown in the question) and print the same report from a button in the header of the form. Once you add the button in form and use it for printing, you can easily make it visible and invisible using the attrs .
<report
id="action_report_batch_product_config"
string="GuiLherme Configuration Configuration"
model="stock.picking.batch"
report_type="qweb-pdf"
name="teste2"
file="teste2"
menu="False"
print_report_name="'Batch Product Config- %s' % (object.name)"/>
Add a button to form view,
<button name="print_picking_new" string="Print" type="object" class="oe_highlight"/>
then in the model,
def print_picking_new(self):
return self.env.ref('module_name.action_report_batch_product_config').report_action(self)
Now the print button will be visible always, for making it visible and invisible you can add attrs and give condition, a sample is given below,
<button string="Configure Variants" type="action"
name="%(product_attribute_value_action)d"
attrs="{'invisible': ['|', ('attribute_line_ids', '<=', 0), ('is_product_variant', '=', True)]}"
groups="product.group_product_variant"/>
Thanks
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
أبريل 25
|
1180 | ||
|
2
مارس 25
|
1317 | ||
|
1
نوفمبر 24
|
1091 | ||
|
4
نوفمبر 24
|
7045 | ||
|
1
مارس 24
|
1958 |