Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3670 มุมมอง

Hello Odooers,


I have one question, When we type any string in many2one field and they are giving one option in bottom "Create and edit" or "create". So when we click on create or create and edit button then by default it will set typed string in name field [technical name]. So is there any option to set which field to fill typed name?


I know that how to pass default field data by using context, but here question is how to set typed string to set in specific field.


Thanks in advance

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Haresh,

As an idea, I guess Odoo is using the _rec_name of that model. So by default this would be the field 'name'. So in your model, you could try to do something like:

class MyModel(models.Model):
    _name = 'my_model'
    _rec_name = 'my_favourite_field'


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 25
5785
1
ธ.ค. 24
1369
1
พ.ย. 22
15915
3
ส.ค. 22
12882
2
ส.ค. 22
4405