تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
11832 أدوات العرض

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
يوليو 19
4135
3
أكتوبر 23
7898
1
سبتمبر 23
2903
1
مايو 23
1880
2
أبريل 23
2430