Tuesday, August 20, 2019

domain to field in odoo

ODOO

we can add domain for field in both python file and xml file as bellow 
E.G : let us say we have department_id file which it's domain must be the company 

in python file :

department_id = fields.Many2one('hr.department', domain="[('company_id', '=', company_id)]", string="Department")

// the department object must has field call company_id and the current object too 

in xml file : 

<field name="department_id" domain="[('company_id','=',company_id)]"/>

No comments:

Post a Comment

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...