Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
12217 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

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

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

HI Paulo,

You can check the condition like this,

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

Thanks.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 19
4410
3
thg 10 23
8688
1
thg 9 23
3264
1
thg 5 23
2227
2
thg 4 23
2771