跳至内容
菜单
此问题已终结
2 回复
1886 查看

i want to make qweb report accessible for public user of my custom object

形象
丢弃
最佳答案

Hi,

  1. Create the QWeb Report: First, create the QWeb report that you want to make accessible to public users. This involves creating an XML file in your custom module with the QWeb template for your report.
  2. Configure Access Rights: In order to allow public users to access your report, you need to configure the appropriate access rights. You'll need to decide whether these users should be able to view, edit, or create records of your custom object and access the report
  3. Create a new user group specifically for the public users who need access to your report.
  4. Assign the public users (or a role/group containing public users) to the newly created user group.

Code : 

<record id="report_custom_object_id" model="ir.actions.report">
<field name="model">your.custom.object.model</field>
    <field name="name">Your Report Name</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">your_module.report_template_name</field>
    <!-- Add this line to restrict access to the user group -->
<field name="groups_id" eval="[(4, ref('your_module.group_public_users'))]"/>
</record>

Hope it helps

形象
丢弃
最佳答案

It was truly useful! Without an inquiry, I've just barely begun, however I'm finding out increasingly more about it. Much thanks to you for being benevolent, and proceed with the astounding exertion.


形象
丢弃