Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3431 Visualizzazioni

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).

 

Avatar
Abbandona
Autore Risposta migliore

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;

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
nov 22
5224
1
ott 21
3066
2
nov 18
9997
4
mar 15
5063
1
mar 15
5898