Hello,
I have Many2one field, I want to add some fields, not all of the model.
Thank you in addvance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I have Many2one field, I want to add some fields, not all of the model.
Thank you in addvance
Hi jenan soliman,
You can use a domain filter to display specific values on a field in the many2one field's dropdown list.
Domain can be used in Python as well as XML file,
In PY
state_id = fields.Many2one('res.country.state', string='State', domain="[('country_id', '=', country_id)]")
In XML
"state_ids" domain="[('country_id', '=', country_id)]"/>
In XML
<field name="state_ids" domain="[('country_id', '=', country_id)]"/>
Hi,
To hide some field in Many2one Here is an example
There are two fields source_location_id and destination_location_id, both of which are Many2one fields referencing the res.country model.
source_location_id = fields.Many2one('res.country',string='Source Location')
destination_location_id = fields.Many2one('res.country',string='Destination Location', domain="[('id', '!=', ""source_location_id)]")
The destination_location_id field has a domain set on it, which filters out the value of the source_location_id field from the dropdown list of destination_location_id. This ensures that the user cannot select the same country as both the source and destination
Regards
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
Odoo Mail Sending Limit
تم الحل
|
|
2
ديسمبر 23
|
14942 | |
|
0
أكتوبر 23
|
33 | ||
|
3
أكتوبر 23
|
790 | ||
|
1
أكتوبر 23
|
569 | ||
|
1
أغسطس 23
|
2569 |