Add multi-company support hr_holidays_usability

Add modules hr_holidays_lunch_voucher and hr_holidays_lunch_voucher_natixis
This commit is contained in:
Alexis de Lattre
2017-05-11 00:29:22 +02:00
parent 00592100f7
commit 193e5e6ecc
30 changed files with 792 additions and 4 deletions

View File

@@ -241,6 +241,10 @@ class HrHolidays(models.Model):
string='Public Title',
help="Warning: this title is shown publicly in the "
"calendar. Don't write private/personnal information in this field.")
# by default, there is no company_id field on hr.holidays !
company_id = fields.Many2one(
related='employee_id.resource_id.company_id', store=True,
readonly=True)
@api.one
@api.constrains(

View File

@@ -61,6 +61,7 @@ hr_holidays.edit_holiday_new is used for both leaves and allocation -->
</group>
</field>
<field name="department_id" position="after">
<field name="company_id" groups="base.group_multi_company"/>
<field name="posted_date" groups="base.group_hr_manager"/>
</field>
</field>
@@ -90,6 +91,7 @@ hr_holidays.edit_holiday_new is used for both leaves and allocation -->
</field>
<field name="holiday_status_id" position="after">
<field name="posted_date" groups="base.group_hr_manager"/>
<field name="company_id" groups="base.group_multi_company"/>
</field>
</field>
</record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<data noupdate="1">
<!--
Employee : only see his holidays
@@ -41,5 +41,12 @@ Manager = person that administrates the holidays process : can see everything, d
<field name="groups" eval="[(4, ref('base.group_hr_manager'))]"/>
</record>
<record id="hr_holidays_multicompany_rule" model="ir.rule">
<field name="name">Holidays multi-company</field>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
</data>
</openerp>

View File

@@ -31,7 +31,9 @@ class HrHolidaysMassAllocation(models.TransientModel):
@api.model
def _default_employees(self):
return self.env['hr.employee'].search([
('holiday_exclude_mass_allocation', '=', False)])
('holiday_exclude_mass_allocation', '=', False),
('company_id', '=', self.env.user.company_id.id),
])
@api.model
def _get_default_holiday_status(self):

View File

@@ -56,6 +56,7 @@ class HrHolidaysPost(models.TransientModel):
('state', '=', 'validate'),
('posted_date', '=', False),
('vacation_date_to', '<=', self.before_date),
('company_id', '=', self.env.user.company_id.id),
])
self.write({
'state': 'done',

View File

@@ -12,13 +12,13 @@
<field name="name">hr_holidays_post_form</field>
<field name="model">hr.holidays.post</field>
<field name="arch" type="xml">
<form string="Post Leaves" version="7.0">
<form string="Post Leaves">
<group name="main" string="Leave Requests to Post">
<field name="state" invisible="1"/>
<field name="before_date" states="draft"/>
<field name="holidays_to_post_ids" nolabel="1"
context="{'tree_view_ref': 'hr_holidays.view_holiday'}"
states="done"/>
states="done" colspan="2"/>
</group>
<footer>
<button name="select_date" type="object" string="Get Holiday Requests"