[IMP]: Updated access rights and record rules for hr, hr contract and hr payroll
This commit is contained in:
parent
efa255c886
commit
9ec3993757
@ -28,6 +28,13 @@
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_employee_comp_rule" model="ir.rule">
|
||||
<field name="name">Employee multi company rule</field>
|
||||
<field name="model_id" ref="model_hr_employee"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_job_comp_rule" model="ir.rule">
|
||||
<field name="name">Job multi company rule</field>
|
||||
<field name="model_id" ref="model_hr_job"/>
|
||||
|
@ -20,6 +20,7 @@ You can assign several contracts per employee.
|
||||
'website': 'https://flectrahq.com/page/employees',
|
||||
'depends': ['hr'],
|
||||
'data': [
|
||||
'security/contract_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/hr_contract_data.xml',
|
||||
'views/hr_contract_views.xml',
|
||||
|
14
addons/hr_contract/security/contract_security.xml
Normal file
14
addons/hr_contract/security/contract_security.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<flectra>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="hr_contract_rule" model="ir.rule">
|
||||
<field name="name">Hr Contract Multicompany</field>
|
||||
<field name="model_id" ref="model_hr_contract"/>
|
||||
<field name="domain_force">
|
||||
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</flectra>
|
@ -19,7 +19,10 @@ class HrPayrollStructure(models.Model):
|
||||
|
||||
@api.model
|
||||
def _get_parent(self):
|
||||
if self.env.user.company_id.id == self.env.ref(
|
||||
'base.base.main_company', False):
|
||||
return self.env.ref('hr_payroll.structure_base', False)
|
||||
return False
|
||||
|
||||
name = fields.Char(required=True)
|
||||
code = fields.Char(string='Reference', required=True)
|
||||
|
@ -33,5 +33,29 @@
|
||||
<field name="groups" eval="[(4, ref('hr_payroll.group_hr_payroll_manager'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_rule" model="ir.rule">
|
||||
<field name="name">Payslip Multicompany</field>
|
||||
<field name="model_id" ref="model_hr_payslip"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_structure_rule" model="ir.rule">
|
||||
<field name="name">Payroll Structure Multicompany</field>
|
||||
<field name="model_id" ref="model_hr_payroll_structure"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_rule" model="ir.rule">
|
||||
<field name="name">Hr Salary Rule Multicompany</field>
|
||||
<field name="model_id" ref="model_hr_salary_rule"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_contribution_register_rule" model="ir.rule">
|
||||
<field name="name">Hr Contribution Register Multicompany</field>
|
||||
<field name="model_id" ref="model_hr_contribution_register"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</flectra>
|
||||
|
Loading…
Reference in New Issue
Block a user