How we can list out all the open state invoices in a form (sales) in odoo12?
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,
Not sure how you go to display the form if the form is coming from a menu you can give domain for the menu action if the python the form is returned from the python code you can give a domain in the return.
If menu action:
<record id="view_open_invoice" model="ir.actions.act_window">
<field name="name">Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field eval="False" name="view_id"/>
<field name="domain">[('state','=','open')]</field>
</record>
If you are returning the form from python:
return {
'name': _('Invoices'),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.invoice',
'type': 'ir.actions.act_window',
'domain': [('state', '=', 'open')],
}
If you are returning it from a button click, call a python function from the button by giving the type as object and return the above lines.
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!
Aanmelden