Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2332 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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!

Awatar
Odrzuć
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

Powiązane posty Odpowiedzi Widoki Czynność
3
wrz 25
2664
0
sie 25
224
1
sie 25
2223
2
lip 25
8098
2
lip 25
4548