Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
12193 มุมมอง

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
4387
3
ต.ค. 23
8657
1
ก.ย. 23
3252
1
พ.ค. 23
2224
2
เม.ย. 23
2763