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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
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
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się