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:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
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
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
1
apr. 25
|
1200 | ||
|
2
mrt. 25
|
1333 | ||
|
1
nov. 24
|
1106 | ||
|
4
nov. 24
|
7056 | ||
|
1
mrt. 24
|
1972 |