Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
5562 Переглядів

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 ?

Аватар
Відмінити
Автор

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

Автор

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?

Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 25
1627
0
лист. 24
1677
0
черв. 24
1672
1
черв. 24
2191
0
жовт. 23
2216