Odoo Help

0

[Solved]ValueError: Invalid field 'message_follower_ids' in leaf "<osv.ExtendedLeaf: ('message_follower_ids', 'in', [5]) on todo_task (ctx: )>"

By
Akram El Gabry
on 6/8/15, 1:55 PM 2,005 views

This is an error message I got after extending record rules following the 'Odoo Development Essentials,

You initially create a new module called 'todo_app' and then extend it 'todo_user', when creating the todo_app module you define record level rules so that users can only view their own records. because the rules were created using 'data noupdate="1" when extending the rules for the todo_user module which is an mutl-user extension of the todo_app module the new xml rules record first deletes the original rule record and then defines the new rules:


<?xml version="1.0" encoding="utf-8"?>

<openerp>

  <data noupdate="0">


    <delete model="ir.rule" search="[('id','=',

     ref('todo_app.todo_task_user_rule'))]" />


    <record id="todo_task_per_user_rule" model="ir.rule">

        <field name="name">ToDo Tasks only for owner</field>

        <field name="model_id" ref="model_todo_task"/>

        <field name="groups" eval="[(4,ref('base.group_user'))]"/>

        <field name="domain_force">

          ['|',('user_id','in',[user.id,False]),

            ('message_follower_ids','in',[user.partner_id.id])]

        </field>

    </record>


  </data>

</openerp>

Now this record rules extension works fine using the admin ID but when using any other user ID this fails with the error:

ValueError: Invalid field 'message_follower_ids' in leaf "&lt;osv.ExtendedLeaf: ('message_follower_ids', 'in', [5]) on todo_task (ctx: )>"



as I've just followed this book, I can't see why the system thinks that the field 'message_follower_ids' does not exist.
The new record rules are supposed to allow users who have been assigned to a task access to that record as well as the owner and also allow any records where no one has been assigned to be viewed by all users. 


0
Akram El Gabry
On 6/10/15, 2:23 PM

OK my fault here sorry for the post, I hadn't included the inheritance on mail.thread! This meant that the 'message_follower_ids' that was being referred to did not exist as that is where it is inherited from!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 6/8/15, 1:55 PM
Seen: 2005 times
Last updated: 6/10/15, 2:23 PM