Files
odoo_source/addons/note/security/note_security.xml
T
Yannick Tivisse e98e7d762b [IMP] note: Allow company specific notes
Purpose
=======

Allow to restrict note to users having access to a specific company

For example, when creating a new company, it create a "Useful Links" note
that is used on the payroll dashboard (With granted access to payroll officers
who belongs to this company).

This note should be restricted to people having access to the company,
and shouldn't be mixed all the time for people having multi company accesses.

closes odoo/odoo#84155

Related: odoo/enterprise#24128
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-08 11:08:05 +00:00

32 lines
1.4 KiB
XML

<?xml version="1.0"?>
<odoo noupdate="1">
<record id="ir_rule_note_note_multi_company" model="ir.rule">
<field name="name">Note - Multi-Company</field>
<field name="model_id" ref="model_note_note"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
</record>
<record id="note_note_rule_global" model="ir.rule">
<field name="name">Only followers can access a sticky notes</field>
<field name="model_id" ref="model_note_note"/>
<field name="domain_force">['|', ('user_id', '=', user.id), ('message_partner_ids', '=', user.partner_id.id)]</field>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
<record id="note_note_create_unlink_global" model="ir.rule">
<field name="name">note: create / unlink: responsible</field>
<field name="model_id" ref="model_note_note"/>
<field name="domain_force">[('user_id', '=', user.id)]</field>
<field name="perm_write" eval="False"/>
<field name="perm_read" eval="False"/>
</record>
<record id="note_stage_rule_global" model="ir.rule">
<field name="name">Each user have his stage name</field>
<field name="model_id" ref="model_note_stage"/>
<field name="domain_force">['|',('user_id','=',False),('user_id','=',user.id)]</field>
</record>
</odoo>