Help

0

update draft Invoice line unit price

I want to update draft invoices unit price by script but in odoo 13 it always shows error-

Cannot create unbalanced journal entry. Ids: [XXXXX]
which method I need to call to auto update account move line debit and credit as per new unit price in invoice line. I tried with calling onchange and computed methods in script but it seems not working.

Please advice!

Avatar
Discard
1 Answer
1
Avatar
Niyas Raphy
Best Answer

Hi,

Add this code and see,

self.with_context(check_move_validity=False)._recompute_dynamic_lines\
(recompute_all_taxes=True, recompute_tax_base_amount=True)

Thanks

1 Comment
Avatar
Discard

Thanks Niyas, Its working !