İçereği Atla
Menü
This question has been flagged
2 Cevaplar
11508 Görünümler

Hello everyone,

Odoo 12 allows us to pay invoices directly from the invoice, by clicking on the Register Payment button or from the "Customer | Payments" menu option.

Is there any way I can check if user is processing the payment from the invoice or from the Payments menu option?​

I need to run some code depending where user actually is processing the payment.

Perhaps someway to check by environment?

Thank you all in advance

Best regards

PM

Avatar
Vazgeç
Best Answer

Hi,

You can get the current model name from the context like this: self._context.get('active_model')

Thanks

Avatar
Vazgeç
Best Answer

HI Paulo,

You can check the condition like this,

if self._name == 'account.invoice':
// Your code

Thanks.

Avatar
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
1
Tem 19
3948
3
Eki 23
7422
1
Eyl 23
2661
1
May 23
1602
2
Nis 23
2025