Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2692 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen