Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2238 Vistas

I want to make an update of all partners and set the payment_term to immediate payment.

This is what I tried:

UPDATE res_partner SET "property_payment_term_id"=1;


But I get an error saying that:

column "property_payment_term_id" does not exist


But thats the field for defining the payment term in the view and model:

https://github.com/odoo/odoo/blob/c0161736db4f2415e6a44674d872bf8aa2972287/addons/account/models/partner.py l.461


Thank you for any suggestions

Avatar
Descartar
Mejor respuesta

This field can be updated in ir_property table, to get all property_payment_term_id values for all partners use the below query:

select * from ir_property ip where name='property_payment_term_id';

You can update it for all partners as below:

update ir_property 
set value_reference ='account.payment.term,1'
where name='property_payment_term_id';

Also you can change it from Odoo, enable developer mode and go to settings -> Technical -> Company Parameters and then search for name  property_payment_term_id  and you can update it from there!

Avatar
Descartar
Autor

What if I wanted to update only the payment_terms that are not set? Like:
UPDATE res_partner SET "property_payment_term_id"=1 WHERE "property_payment_term_id"=''; ?

You can do it as below:

update ir_property
set value_reference ='account.payment.term,1'
where name='property_payment_term_id' and value_reference is null

Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
2453
2
jul 25
7908
2
jul 25
4323
2
jul 25
4065
2
jun 25
2664