Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5922 Näkymät

I have tried to add some domain force to some osv objects. All of them are working fine except crm.phonecall object. Here is the code i have added to restrict the access.

<record id="crm_phonecall_comp_rule" model="ir.rule">
<field name="name">CRM Phone Call MutliCompany</field>
<field model="ir.model" name="model_id" ref="crm.model_crm_phonecall"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

These code don't work... Is there anything wrong in my code or is this a known issue in V7 against crm.phonecall object?

Avatar
Hylkää
Tekijä

Is there anything to do with the view part of crm phonecall?

Tekijä Paras vastaus

I solved the problem. In case any one face the same issue, here shares my solution. By default, in the file crm_security.xml, there is one rule controlling the crm phone call access.

<record id="crm_rule_all_phones" model="ir.rule">
    <field name="name">All Phones</field>
    <field ref="model_crm_phonecall" name="model_id"/>
    <field name="domain_force">[(1,'=',1)]</field>
    <field name="groups" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
</record>

It allows the phone call records to be viewed by all the users no matter he is in this company or not. So in order to fix the issue, you could change the rule to the following:

<record id="crm_rule_all_phones" model="ir.rule">
    <field name="name">All Phones</field>
    <field ref="model_crm_phonecall" name="model_id"/>
    <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

That will protect the records to be viewed by the members out of this company.

Regards Sage

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
lokak. 15
3484
2
elok. 25
446
2
toukok. 25
1450
1
huhtik. 25
1358
0
maalisk. 25
1425