跳至内容
菜单
此问题已终结
2 回复
12225 查看

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.

形象
丢弃
相关帖文 回复 查看 活动
1
7月 19
4417
3
10月 23
8708
1
9月 23
3282
1
5月 23
2231
2
4月 23
2777