File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 3
3
4
4
5
5
def migrate (cr , version ):
6
+ if util .version_gte ("saas~18.2" ):
7
+ return
6
8
util .env (cr )["res.groups" ]._update_user_groups_view ()
Original file line number Diff line number Diff line change @@ -1652,15 +1652,16 @@ def test_m2m_no_conflict(self):
1652
1652
mapping = {g1 .id : g3 .id , g2 .id : g3 .id }
1653
1653
1654
1654
u1 = self .env ["res.users" ].create ({"login" : "U1" , "name" : "U1" })
1655
- u1 .groups_id = g1 | g3
1656
- self .assertEqual (u1 .groups_id .ids , [g1 .id , g3 .id ])
1655
+ groups = "group_ids" if util .version_gte ("saas~18.2" ) else "groups_id"
1656
+ u1 [groups ] = g1 | g3
1657
+ self .assertEqual (u1 [groups ].ids , [g1 .id , g3 .id ])
1657
1658
util .replace_record_references_batch (cr , mapping , "res.groups" )
1658
1659
util .invalidate (u1 )
1659
- self .assertEqual (u1 . groups_id .ids , [g3 .id ])
1660
+ self .assertEqual (u1 [ groups ] .ids , [g3 .id ])
1660
1661
1661
1662
u2 = self .env ["res.users" ].create ({"login" : "U2" , "name" : "U2" })
1662
- u2 . groups_id = g1 | g2
1663
- self .assertEqual (u2 . groups_id .ids , [g1 .id , g2 .id ])
1663
+ u2 [ groups ] = g1 | g2
1664
+ self .assertEqual (u2 [ groups ] .ids , [g1 .id , g2 .id ])
1664
1665
util .replace_record_references_batch (cr , mapping , "res.groups" )
1665
1666
util .invalidate (u2 )
1666
- self .assertEqual (u2 . groups_id .ids , [g3 .id ])
1667
+ self .assertEqual (u2 [ groups ] .ids , [g3 .id ])
You can’t perform that action at this time.
0 commit comments