Skip to Content
Menu
This question has been flagged
1 Reply
2384 Views

we know about register-payment and account_payment module....

but regardless of this odoo method we want to change the state of an invoice to paid.

in our custom Method we use:

self.write({'state':'paid'})

But the state in the Database seems to be unchanged.

any ideas why this fails?

Avatar
Discard
Best Answer

Probably because the _write method in account_invoice (exact action_invoice_paid method called here) recalculates this field and sets it up in its own way

You modify write method in account_invoice, like this (but ... think about whether you do well by setting this status yourself):

@api.multi
def write(self, vals):
ret = super(AccountInvoice, self).write(vals)
... your logic here ...
return ret

Avatar
Discard