Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
12198 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

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

Thanks

Awatar
Odrzuć
Najlepsza odpowiedź

HI Paulo,

You can check the condition like this,

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

Thanks.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 19
4390
3
paź 23
8668
1
wrz 23
3253
1
maj 23
2224
2
kwi 23
2765