跳至內容
選單
此問題已被標幟
1 回覆
3612 瀏覽次數

I want copy property filed list_price value to product_template list_price2

res_id  is product.template,id

insert into product_template (id, list_price2)
       select cast(substring(res_id from 18) as int) as id, value_float
              from ir_property where name='list_price';
ERROR:  null value in column "uom_id" violates not-null constraint
DETAIL:  Failing row contains (32645, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1).

 

頭像
捨棄
作者 最佳答案

I solved it.

UPDATE product_template p2
SET list_price2 = p1.value_float
FROM ir_property p1
WHERE p2.id  = cast(substring(p1.res_id from 18) as int) and p1.name='list_price' 
AND p2.list_price2 IS DISTINCT FROM p1.value_float;

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
11月 22
5646
1
10月 21
3301
2
11月 18
10206
4
3月 15
5247
1
3月 15
6056