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

Hi, can anyone tell me where I can change the title of the custom field instead of generating an ID? 

 
Kindly see the screenshot in the above link.

Thanks.

อวตาร
ละทิ้ง

Your link shows no image.

ผู้เขียน

Thanks for the fastest reply. Please check if this link works?

http://imageshack.com/a/img922/666/3YFuGO.png

คำตอบที่ดีที่สุด

That is because your module has't name field and don't define a _rec_name to use another field as the display name of the record. 

If you don't have one to use you could always use create_date or write_date like:

class your_model(models.Model):
_name = 'your.model'
_rec_name = 'write_date'
...
อวตาร
ละทิ้ง
ผู้เขียน

Thanks. I think this is exactly what I was looking for, but as I just created this module through Studio, so will I be able to see that module in my Odoo path on the server? Thanks alot.

I don't thinks so, the Odoo studio will just directly create the model directly in the database as a customized model without creating a physical file for the model or views

ผู้เขียน

Thanks for the quick response Axel.

don't forget to upvote the answer if it was helpful and also accept it as valid to help others

ผู้เขียน

Yes did that already.

คำตอบที่ดีที่สุด

_rec_name

Alternative field to use as name, used by osv’s name_get() (default: 'name')

example :print current date

class model_name(models.Model):

    _name = 'your.model' / _inherit = 'modal_name'

     _rec_name = 'your_field' / example rec_name="start_date"

   start_date = fields.Date(default=time.strftime("%Y-%m-%d"))


อวตาร
ละทิ้ง
ผู้เขียน

Thanks, but as Axel said above, I was unable to find the module I created through Odoo Studio. So I don't think I can make changes to the default name.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Menu's with different default filter แก้ไขแล้ว
1
ก.ค. 25
1467
2
มี.ค. 25
1688
0
ก.พ. 25
1327
0
ก.พ. 25
1558
0
ก.พ. 25
1459