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

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
Descartar
Mejor respuesta

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
Descartar