summaryrefslogtreecommitdiff
path: root/addons/hr_contract/security
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-11-14 13:55:35 +0100
committerYannick Tivisse <yti@odoo.com>2019-01-21 12:33:03 +0100
commit1684ec555dcccfbd4fca9123902065e01a67c057 (patch)
tree00bb60d1b262f17289abac57cd7395029f8018c9 /addons/hr_contract/security
parent4764a70af7d9e32468a3608efceb4553b01a242a (diff)
[IMP] hr_payroll: Manage multi company on payslips/contracts
Purpose ======= Currently the payroll doens't manage the multi company Specification ============= 1/ Add ir.rules on hr.contract and hr.payslip to prevent users to access a record in another company. 2/ Add ir.rules on hr.payroll.structure to prevent users to access a record for another country. 3/ Remove company_id fields on models that doesn't require it, as hr.salary.rule.category. 4/ Make the accounting fields on the salary rules company dependent. 5/ Specify the country on the salary structures on the l10n_**_hr_payroll modules. 6/ Add demo data and modify the salary package tour. 7/ Make the car_atn and company_car_total_depreciated_costs fields compute_sudo=True, as one car can be assigned on several contract, for different companies Closes #26866 Closes #25231 Closes #24683 Closes #23814
Diffstat (limited to 'addons/hr_contract/security')
-rw-r--r--addons/hr_contract/security/security.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/hr_contract/security/security.xml b/addons/hr_contract/security/security.xml
index 6a922ba15b2..1e4cd3a829f 100644
--- a/addons/hr_contract/security/security.xml
+++ b/addons/hr_contract/security/security.xml
@@ -10,5 +10,13 @@
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('hr_contract.group_hr_contract_manager'))]"/>
</record>
+
+ <record id="ir_rule_hr_contract_multi_company" model="ir.rule">
+ <field name="name">HR Contract: Multi Company</field>
+ <field name="model_id" ref="model_hr_contract"/>
+ <field name="global" eval="True"/>
+ <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
+ </record>
+
</data>
</odoo>