I added buttons in lines on wizard of payment ('pos.make.payment')
In xml code, I added the 'payment_ids tree' in 'pos.make.payment' model(POS module)
When clicking on button, I want to delete the payment, but I got this error:
"Record does not exist or has been deleted .
(Record: pos.payment(100,), User: 2) "
What's wrong please ? Any help?
class PosPayment(models.Model):
_inherit = 'pos.payment'
def delete_payment(self):
self.unlink()
return {
'context': self.env.context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'pos.make.payment',
'res_id': self.id,
'view_id': False,
'type': 'ir.actions.act_window',
'target': 'new',
}
Thanks.