Merge lp:~openerp-dev/openobject-addons/trunk-bug-1204455-ssh into lp:openobject-addons

Proposed by Sunil Sharma(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1204455-ssh
Merge into: lp:openobject-addons
Diff against target: 57 lines (+17/-1)
3 files modified
hr/hr.py (+8/-0)
hr/hr_view.xml (+3/-1)
hr/security/hr_security.xml (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1204455-ssh
Reviewer Review Type Date Requested Status
Daniel Reis (community) Needs Information
OpenERP Core Team Pending
Review via email: mp+202082@code.launchpad.net

Description of the change

Hello,

       I have fix this bug, Employee personal address should be private information in hr.

Thanks
Sunil Sharma (SSH)

To post a comment you must log in.
Revision history for this message
Daniel Reis (dreis-pt) wrote :

The Record Rule is a good solution, but there is a use case that will not work:
Sometimes we have many2one field for res.partner that reference an OpenERP user.
For example: in Project Issues, we night wnat the "Contact" (partner_id) field to reference the Demo user.

I suggest using for the record rule:
<field name="domain_force">[('employee','=',False)] </field>

review: Needs Information
9055. By Sunil Sharma(OpenERP)

[imp]:as per suggestion

9056. By Sunil Sharma(OpenERP)

[imp]:add write method

Unmerged revisions

9056. By Sunil Sharma(OpenERP)

[imp]:add write method

9055. By Sunil Sharma(OpenERP)

[imp]:as per suggestion

9054. By Sunil Sharma(OpenERP)

[FIX]:hr:personal address should be private information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr/hr.py'
--- hr/hr.py 2013-12-12 09:32:34 +0000
+++ hr/hr.py 2014-01-20 05:33:20 +0000
@@ -252,6 +252,14 @@
252 )252 )
253 return employee_id253 return employee_id
254254
255 def write(self, cr, uid, ids, vals, context=None):
256 """Overrides orm write method
257 """
258 if 'address_home_id' in vals:
259 if vals['address_home_id']:
260 self.pool.get('res.partner').write(cr, uid, vals['address_home_id'], {'employee': True})
261 return super(hr_employee, self).write(cr, uid, ids, vals, context=context)
262
255 def unlink(self, cr, uid, ids, context=None):263 def unlink(self, cr, uid, ids, context=None):
256 resource_ids = []264 resource_ids = []
257 for employee in self.browse(cr, uid, ids, context=context):265 for employee in self.browse(cr, uid, ids, context=context):
258266
=== modified file 'hr/hr_view.xml'
--- hr/hr_view.xml 2013-12-12 09:32:34 +0000
+++ hr/hr_view.xml 2014-01-20 05:33:20 +0000
@@ -67,7 +67,7 @@
67 <field name="otherid" groups="base.group_hr_user"/>67 <field name="otherid" groups="base.group_hr_user"/>
68 </group>68 </group>
69 <group string="Contact Information">69 <group string="Contact Information">
70 <field name="address_home_id" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>70 <field name="address_home_id" context="{'show_address': 1,'default_customer':0, 'default_supplier':0, 'default_employee':1}" options='{"always_reload": True, "highlight_first_line": True}'/>
71 </group>71 </group>
72 <group string="Status">72 <group string="Status">
73 <field name="gender"/>73 <field name="gender"/>
@@ -95,6 +95,8 @@
95 </field>95 </field>
96 </record>96 </record>
9797
98
99
98 <record id="view_employee_tree" model="ir.ui.view">100 <record id="view_employee_tree" model="ir.ui.view">
99 <field name="name">hr.employee.tree</field>101 <field name="name">hr.employee.tree</field>
100 <field name="model">hr.employee</field>102 <field name="model">hr.employee</field>
101103
=== modified file 'hr/security/hr_security.xml'
--- hr/security/hr_security.xml 2013-10-27 12:31:04 +0000
+++ hr/security/hr_security.xml 2014-01-20 05:33:20 +0000
@@ -35,6 +35,12 @@
35 <field eval="True" name="global"/>35 <field eval="True" name="global"/>
36 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>36 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
37 </record>37 </record>
38 <record id="hr_employee_address" model="ir.rule">
39 <field name="name">hr employee address rule</field>
40 <field name="model_id" ref="base.model_res_partner"/>
41 <field name="domain_force">[('employee','=',False)] </field>
42 <field name="groups" eval="[(4, ref('base.group_user'))]"/>
43 </record>
3844
39</data>45</data>
40</openerp>46</openerp>

Subscribers

People subscribed via source and target branches

to all changes: