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

In odoo every model will be having a write_date column which will store the last edited time and date of the record.I want to take the value of that field to a variable/ field. But when I print this , it is printing False . What to do.?

code

variable = self.write_date

Thanks in Advance..

อวตาร
ละทิ้ง

to catch the write_date information, simply add new field name write_date, that's it. the value will be auto filled.

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

Hi,

Even though you can see a field named write_date in the table,  First of all, what you have to do is that you have to add a field named write_date into your model and then try the same.

write_date = fields.Datetime(string='Write Date')


Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
First you need to check database table had 'write_date' field.
If yes, then also check whether you get any record in 'self' or not.
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

If value is False then you need to check self.

check self.name or any other field data is showing...?

if no then your self with no record.


Thank you.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 22
5808
1
ส.ค. 21
6340
1
ธ.ค. 20
2479
0
ก.ค. 21
2667
1
ก.พ. 23
5349