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

Hi,

I created a new module that add a new field "user_last_change_state" to the object "account.invouce", and I've done some code with this field.

I needed that older records to have this field equal to 1 (admin id ).

Someone knows how to set the new data field with a default value to existent records?

Thanks

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

The simplest form is to do it from a sql script in postgresql. If you have linux, you could do it using pgadmin3 software. The script will be like this: UPDATE [file] SET [field] = 'value' WHERE [condition] ;

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

I did that... but it this the best way ?

I my experience yes.... but maybe there's something better.

ผู้เขียน

Hope that someone knows a better way =)

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 22
3986
Default value editable on field แก้ไขแล้ว
1
ส.ค. 19
3915
1
ธ.ค. 21
6388
0
ต.ค. 21
2969
1
ต.ค. 21
3766