<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="child_model_access" model="ir.model.access">
        <field name="name">Child access to portal users</field>
        <field name="model_id" ref="model_compassion_child"/>
        <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
        <field name="domain_force">[('sponsor_id', '=', user.partner_id.id)]</field>
        <field name="perm_read" eval="1"/>
        <field name="perm_write" eval="0"/>
        <field name="perm_unlink" eval="0"/>
        <field name="perm_create" eval="0"/>
    </record>
    <record id="child_pictures_model_access" model="ir.model.access">
        <field name="name">Child pictures access to portal users</field>
        <field name="model_id" ref="model_compassion_child_pictures"/>
        <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
        <field name="domain_force">[('child_id.sponsor_id', '=', user.partner_id.id)]</field>
        <field name="perm_read" eval="1"/>
        <field name="perm_write" eval="0"/>
        <field name="perm_unlink" eval="0"/>
        <field name="perm_create" eval="0"/>
    </record>
</odoo>


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <record id="child_model_access" model="ir.rule">
            <field name="name">Child access to portal users</field>
            <field name="model_id" ref="model_compassion_child"/>
            <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
            <field name="domain_force">[('sponsor_id', '=', user.partner_id.id)]</field>
            <field name="perm_read" eval="1"/>
            <field name="perm_write" eval="0"/>
            <field name="perm_unlink" eval="0"/>
            <field name="perm_create" eval="0"/>
        </record>
        <record id="child_pictures_model_access" model="ir.rule">
            <field name="name">Child pictures access to portal users</field>
            <field name="model_id" ref="model_compassion_child_pictures"/>
            <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
            <field name="domain_force">[('child_id.sponsor_id', '=', user.partner_id.id)]</field>
            <field name="perm_read" eval="1"/>
            <field name="perm_write" eval="0"/>
            <field name="perm_unlink" eval="0"/>
            <field name="perm_create" eval="0"/>
        </record>
    </data>
</odoo>


Fix child pictures access rules
Fix child pictures access rules
