hello
i have form have many2one field that related to another model i creater.
when i enter new value to this field and choose created and edit then form of another model open the value of this field not passed ?????
why??
hello
i have form have many2one field that related to another model i creater.
when i enter new value to this field and choose created and edit then form of another model open the value of this field not passed ?????
why??
Hello,
You can transmit a value from another field using context, as in the code below, adapting it to your needs:
<field name="another_partner_id"
context="{'default_street': street, 'default_street2': street2,
'default_city': city, 'default_zip': zip, 'default_country_id': country_id}"
options="{'no_quick_create': True}"/>
Best regards!
Hello nohaAhmad,
By default, Odoo expects that model to have a name field, or at least one field declared as _rec_name. If the created model:
does not include a plain editable field (like name), or no _rec_name is set, or the popup form view does not contain the _rec_name field, then Odoo cannot prefill the value.
You can add in created model _rec_name or name field.
If you have any questions, feel free to reach out to us.
Hope this helps!
Thanks & Regards,
Email : odoo@aktivsoftware.com
Hi,
<field name="my_field_id" context="{'default_name': name}"/>
When you click Create and Edit for my_field_id, Odoo will pass the current form’s name field into the new record’s name.
Hope it helps.
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
Display values of dropdown in a many2one field
Diselesaikan
|
2
Feb 25
|
9249 | ||
|
Set default value in object of many2one field
Diselesaikan
|
1
Nov 22
|
18292 | ||
|
How to remove Create and Edit in many2one field.?
Diselesaikan
|
3
Agu 22
|
16408 | ||
|
2
Agu 22
|
6603 | |||
|
0
Jul 22
|
836 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.