跳至內容
選單
此問題已被標幟
1 回覆
2759 瀏覽次數

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?

頭像
捨棄
最佳答案

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

頭像
捨棄