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

Hi, 

I have an issue concerning the option grant portal access on Odoo v12.

By default after selecting the customer when I click on Action: grant the portal access, the in portal is not  checked by default and I would like to avoid spending 2 days selecting all my customers :) 

any way to set the checkbox to true by default?

thanks, 


Ảnh đại diện
Huỷ bỏ

I tried several different possible ways of doing this, but none of them worked.

I suppose you know that you can select multiple customers from the List View, but after you do still have to select that you want portal access for each one.

Tác giả

Thanks for your reply, indeed I have selected all of them but I had to the check then one by one :)

Câu trả lời hay nhất

Just to simplify,

In wizard just replace your apply button with following button

<button name="1174" type="action" string="Apply"/>

here name is the id of your server action. 

In server action you can add the code like,

for rec in records:

  for userin rec.user_ids:

    user['in_portal'] = True

 rec.action_apply()

Video : https://youtu.be/Mjr-RpITSC0

Ảnh đại diện
Huỷ bỏ
Tác giả

thanks a lot, this is great workaround :)

Then please accept the answer.

Tác giả Câu trả lời hay nhất

Hi, 

sorry I am new in the forum, what do you mean accept the answer?

let me know what to do id anything has to be done, 

thanks, 

Ảnh đại diện
Huỷ bỏ

Click on the 'tick' symbol to mark the answer as correct. It's OK, already done by someone else.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 21
8097
1
thg 1 23
5709
0
thg 9 22
2974
2
thg 5 18
10274
0
thg 3 18
3666