Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
12199 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

Hi,

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

Thanks

Аватар
Відмінити
Найкраща відповідь

HI Paulo,

You can check the condition like this,

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

Thanks.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лип. 19
4396
3
жовт. 23
8677
1
вер. 23
3259
1
трав. 23
2224
2
квіт. 23
2766