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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký