Skip to Content
Menú
This question has been flagged
2 Respostes
12200 Vistes

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
Descartar
Best Answer

Hi,

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

Thanks

Avatar
Descartar
Best Answer

HI Paulo,

You can check the condition like this,

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

Thanks.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de jul. 19
4397
3
d’oct. 23
8681
1
de set. 23
3261
1
de maig 23
2224
2
d’abr. 23
2767