hr_holidays_usability: add support for emails

Many small fixes and improvements
This commit is contained in:
Alexis de Lattre
2017-06-06 16:27:44 +02:00
parent d55b01ca7b
commit e5221d6a96
7 changed files with 56 additions and 21 deletions

View File

@@ -3,7 +3,7 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, workflow, _
from odoo import models, fields, api, _
from odoo.exceptions import UserError
@@ -62,10 +62,10 @@ class HrHolidaysMassAllocation(models.TransientModel):
'type': 'add',
'holiday_type': 'employee',
'holiday_status_id': self.holiday_status_id.id,
'state': 'confirm',
})
if auto_approve:
# TODO: handle the no_email_notification
hol.action_validate()
hol.with_context(no_email_notification=True).action_validate()
alloc_hol_ids.append(hol.id)
action = self.env['ir.actions.act_window'].for_xml_id(
'hr_holidays', 'open_allocation_holidays')

View File

@@ -15,7 +15,7 @@
<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"
<field name="holidays_to_post_ids" nolabel="1" colspan="2"
context="{'tree_view_ref': 'hr_holidays.view_holiday'}"
states="done"/>
</group>