Skip to Content
Menu
This question has been flagged
4 Replies
4972 Views

I'm trying to create and update records via XML. Creating the records is fine, but when I try to update a m2m field (implied_ids for example) it simply doesn't work, the implied_ids field keeps the the initial values. I tried using the (6, False, [id, ...]) for updating the field but it's not working. noupdate is set to 0.

- 1 creating the record : 

<record model="res.users.role" id="my_role">

            <field name='name'>My role</field>

            <field name='implied_ids' eval="[(6, 0, [ref('hr.group_hr_user')])]"/>

</record>


=> this creates the record with the group_hr_user group in implied_ids

- 2 updating the record :

Now if i'm willing for example to update the implied_ids with another group (group_hr_manager), I do the following but it doesn't work. The field keeps the old group :

<record model="res.users.role" id="my_role">

            <field name='name'>My role</field>

            <field name='implied_ids' eval="[(6, 0, [ref('hr.group_hr_manager')])]"/>

</record>


Any idea ?

Avatar
Discard
Author

I already made sure noupdate is set to 0 as I stated in my question

Author

I tried that as well and didn't work :(

Updating Record: Does it only shows "group_hr_user" group only or it show both user and manager groups after update?

Best Answer

HI,

Make sure that there is no noupdate="1" in your xml file, if is it set to 1, the changes on upgrading will not get into effect. So check your file for noupdate="1", and if is there, set it to 0 or remove it. uninstall the module and install it again.

Now you can test by changing the group and update.


UPDT:

try this,

            <field name='implied_ids' eval="[(5, 0,0), (6, 0, [ref('hr.group_hr_manager')])]"/>

Thanks

Avatar
Discard
Related Posts Replies Views Activity
0
Nov 24
133
0
Jun 24
268
1
Jun 24
704
0
Oct 23
953
2
Mar 23
1489