Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
18504 Vizualizări



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.

Imagine profil
Abandonează
Cel mai bun răspuns

I see that you delete the record using 

self.unlink()

it should remove the record

but then you use the deleted record id in 

'res_id': self.id, 

it will throw error because the record already deleted

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 23
41
4
mar. 23
17001
2
iul. 22
3841
0
mai 22
2124
2
oct. 21
7569