Merge lp:~mukunde/unifield-server/US-12110 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6187
Proposed branch: lp:~mukunde/unifield-server/US-12110
Merge into: lp:unifield-server
Diff against target: 46 lines (+18/-0)
2 files modified
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+14/-0)
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-12110
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+457060@code.launchpad.net
To post a comment you must log in.
lp:~mukunde/unifield-server/US-12110 updated
6171. By Gaël Mukunde

US-12110 [IMP] Code fix to avoid in-pipe sync data without deleting or blocking usage of the group

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_profile/data/patches.xml'
2--- bin/addons/msf_profile/data/patches.xml 2023-11-16 13:03:16 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2023-12-07 16:09:13 +0000
4@@ -1016,6 +1016,10 @@
5 <field name="method">us_9321_2_remove_location_colors</field>
6 </record>
7
8+ <record id="us_12110_remove_sup_fin_read" model="patch.scripts">
9+ <field name="method">us_12110_remove_sup_fin_read</field>
10+ </record>
11+
12
13 </data>
14 </openerp>
15
16=== modified file 'bin/addons/msf_profile/msf_profile.py'
17--- bin/addons/msf_profile/msf_profile.py 2023-11-16 13:03:16 +0000
18+++ bin/addons/msf_profile/msf_profile.py 2023-12-07 16:09:13 +0000
19@@ -58,6 +58,15 @@
20 }
21
22
23+ def us_12110_remove_sup_fin_read(self, cr, uid, *a, **b):
24+ '''
25+ Remove all Sup_Fin_Read groups from all users
26+ '''
27+ instance = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id
28+ if instance and instance.level == 'section':
29+ self.pool.get('sync.trigger.something').create(cr, uid, {'name': 'US-12110-Sup_Fin_Read'})
30+ return True
31+
32 # python 3
33 def us_9321_2_remove_location_colors(self, cr, uid, *a, **b):
34 '''
35@@ -6654,6 +6663,11 @@
36 """)
37 _logger.warn('Deletion of %d Dest CC Links created out of HQ' % (cr.rowcount,))
38
39+ if vals.get('name') == 'US-12110-Sup_Fin_Read':
40+ cr.execute("""
41+ DELETE FROM res_groups_users_rel
42+ WHERE gid=(SELECT id FROM res_groups WHERE name='Sup_Fin_Read')""")
43+
44 return super(sync_tigger_something, self).create(cr, uid, vals, context)
45
46 sync_tigger_something()

Subscribers

People subscribed via source and target branches