Customer portal Customization

Good day

So i just created my portal for a customer. What i see is that portal items are listed based on user email.
So if my user is abc@test.com, ill only see issues or other doctypes that has been raised by abc@test.com. What i need is to be able to see data for the customer name instead.

I see in Issue this code:


Im guessing something needs to be updated here? I tried using the customer field(“Issue”, “customer”,“=”, “ABC”) in the filters but it changed nothing.

Any advice?

The filter you added should have worked.

Can you share the full code snippet where you placed that filter?

@RohanB, My custom doctype is named COCT.

Not sure what im doing wrong. But even if i take this line with the filter out it still shows in the portal the data with only the raised_by user data. Must i do a update or something?

A few things:

  • Frappe doesn’t currently have provisions for conditional filters, which means you can either apply both those filters, or none of them. However, you CAN use logic beforehand to avoid appending it to the filters.
  • Usually, if you’re running the app locally, a change in a Python file will cause an auto-reload of files, so a simple refresh of the page should have shown the change. You might try restarting your bench.
  • Python uses the or operator; the || operator belongs to Javascript.

Hope that helps.

  • @RohanB, Thank you very much. I ddnt know about the condition filters. I tried adding in the emails as conditionals but frappe reads only the first condition then it doesnt see the others. I also tried adding more than one filter.append and it shows no data then.
  • I had to do a restart every time i made a change.

But thank you.

@RohanB,
I removed the filters so now customer sees all the data in a list view, but can only access the ones if the raised by email is the same. Where do you grant access to view data?

I’m not too sure about that, sorry. It sounds like a general permission check - have you checked that DocType’s permissions?

@RohanB,
Yeah iv checked. Granted all the correct permissions.
For now i solved it by changing the whitelist permissions in the doctype to allow if the customer is someone specific. I can code it to check who the user is first but for now this solves my problem that i needed out of the way for testing purposes.
image

Once again thank you for you support

Glad to help :slight_smile: