Browse Source

Oct 13 [UPDT] : Updated coding standards 'employee_orientation'

pull/219/head
AjmalCybro 3 years ago
parent
commit
629fd376dd
  1. 1
      employee_orientation/README.rst
  2. 1
      employee_orientation/__manifest__.py
  3. 37
      employee_orientation/models/employee_orientation.py
  4. 16
      employee_orientation/models/employee_training.py
  5. 4
      employee_orientation/models/orientation_checklist.py
  6. 2
      employee_orientation/models/orientation_checklist_line.py
  7. 10
      employee_orientation/models/orientation_checklist_request.py
  8. 2
      employee_orientation/security/ir.model.access.csv
  9. 30
      employee_orientation/views/employee_orientation.xml
  10. 11
      employee_orientation/views/employee_training.xml
  11. 14
      employee_orientation/views/orientation_checklist.xml
  12. 10
      employee_orientation/views/orientation_checklist_line.xml
  13. 12
      employee_orientation/views/orientation_checklists_request.xml
  14. 11
      employee_orientation/views/orientation_request_mail_template.xml
  15. 2
      employee_orientation/wizard/orientation_complete.py

1
employee_orientation/README.rst

@ -21,6 +21,7 @@ Credits
Gion V15 @cybrosys odoo@cybrosys.com Gion V15 @cybrosys odoo@cybrosys.com
Contacts Contacts
-------- --------
* Mail Contact : odoo@cybrosys.com * Mail Contact : odoo@cybrosys.com

1
employee_orientation/__manifest__.py

@ -39,6 +39,7 @@
'views/print_pack_certificates_template.xml', 'views/print_pack_certificates_template.xml',
'views/report.xml', 'views/report.xml',
'views/employee_training.xml', 'views/employee_training.xml',
'wizard/orientation_complete.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
], ],
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],

37
employee_orientation/models/employee_orientation.py

@ -28,21 +28,20 @@ class Orientation(models.Model):
_inherit = 'mail.thread' _inherit = 'mail.thread'
name = fields.Char(string='Employee Orientation', readonly=True, default=lambda self: _('New')) name = fields.Char(string='Employee Orientation', readonly=True, default=lambda self: _('New'))
employee_name = fields.Many2one('hr.employee', string='Employee', size=32, required=True) employee_id = fields.Many2one('hr.employee', string='Employee', required=True)
department = fields.Many2one('hr.department', string='Department', related='employee_name.department_id', department_id = fields.Many2one('hr.department', string='Department', related='employee_id.department_id',
required=True) required=True)
date = fields.Datetime(string="Date") date = fields.Datetime(string="Date")
# date = fields.Datetime.to_string(dateText) responsible_user_id = fields.Many2one('res.users', string='Responsible User')
responsible_user = fields.Many2one('res.users', string='Responsible User') employee_company_id = fields.Many2one('res.company', string='Company', required=True,
employee_company = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id)
default=lambda self: self.env.user.company_id) parent_id = fields.Many2one('hr.employee', string='Manager', related='employee_id.parent_id')
parent_id = fields.Many2one('hr.employee', string='Manager', related='employee_name.parent_id') job_id = fields.Many2one('hr.job', string='Job Title', related='employee_id.job_id',
job_id = fields.Many2one('hr.job', string='Job Title', related='employee_name.job_id', domain="[('department_id', '=', department_id)]")
domain="[('department_id', '=', department)]")
orientation_id = fields.Many2one('orientation.checklist', string='Orientation Checklist', orientation_id = fields.Many2one('orientation.checklist', string='Orientation Checklist',
domain="[('checklist_department','=', department)]", required=True) domain="[('checklist_department_id','=', department_id)]", required=True)
note_id = fields.Text('Description') note = fields.Text('Description')
orientation_request = fields.One2many('orientation.request', 'request_orientation', string='Orientation Request') orientation_request_ids = fields.One2many('orientation.request', 'request_orientation_id', string='Orientation Request')
state = fields.Selection([ state = fields.Selection([
('draft', 'Draft'), ('draft', 'Draft'),
('confirm', 'Confirmed'), ('confirm', 'Confirmed'),
@ -52,23 +51,23 @@ class Orientation(models.Model):
def confirm_orientation(self): def confirm_orientation(self):
self.write({'state': 'confirm'}) self.write({'state': 'confirm'})
for values in self.orientation_id.checklist_line_id: for values in self.orientation_id.checklist_line_ids:
self.env['orientation.request'].create({ self.env['orientation.request'].create({
'request_name': values.line_name, 'request_name': values.line_name,
'request_orientation': self.id, 'request_orientation_id': self.id,
'partner_id': values.responsible_user.id, 'partner_id': values.responsible_user_id.id,
'request_date': self.date, 'request_date': self.date,
'employee_id': self.employee_name.id, 'employee_id': self.employee_id.id,
}) })
def cancel_orientation(self): def cancel_orientation(self):
for request in self.orientation_request: for request in self.orientation_request_ids:
request.state = 'cancel' request.state = 'cancel'
self.write({'state': 'cancel'}) self.write({'state': 'cancel'})
def complete_orientation(self): def complete_orientation(self):
force_complete = False force_complete = False
for request in self.orientation_request: for request in self.orientation_request_ids:
if request.state == 'new': if request.state == 'new':
force_complete = True force_complete = True
if force_complete: if force_complete:

16
employee_orientation/models/employee_training.py

@ -38,9 +38,9 @@ class EmployeeTraining(models.Model):
_inherit = 'mail.thread' _inherit = 'mail.thread'
program_name = fields.Char(string='Training Program', required=True) program_name = fields.Char(string='Training Program', required=True)
program_department = fields.Many2one('hr.department', string='Department', required=True) program_department_id = fields.Many2one('hr.department', string='Department', required=True)
program_convener = fields.Many2one('res.users', string='Responsible User', size=32, required=True) program_convener_id = fields.Many2one('res.users', string='Responsible User', size=32, required=True)
training_id = fields.One2many('hr.employee', string='Employee Details', compute="employee_details") training_ids = fields.One2many('hr.employee', string='Employee Details', compute="employee_details")
note_id = fields.Text('Description') note_id = fields.Text('Description')
date_from = fields.Datetime(string="Date From") date_from = fields.Datetime(string="Date From")
date_to = fields.Datetime(string="Date To") date_to = fields.Datetime(string="Date To")
@ -56,10 +56,10 @@ class EmployeeTraining(models.Model):
('print', 'Print'), ('print', 'Print'),
], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='new') ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='new')
@api.onchange('program_department') @api.depends('program_department_id')
def employee_details(self): def employee_details(self):
datas = self.env['hr.employee'].search([('department_id', '=', self.program_department.id)]) datas = self.env['hr.employee'].search([('department_id', '=', self.program_department_id.id)])
self.training_id = datas self.training_ids = datas
def print_event(self): def print_event(self):
self.ensure_one() self.ensure_one()
@ -70,14 +70,14 @@ class EmployeeTraining(models.Model):
hours = difference.hours hours = difference.hours
minutes = difference.minutes minutes = difference.minutes
data = { data = {
'dept_id': self.program_department.id, 'dept_id': self.program_department_id.id,
'program_name': self.program_name, 'program_name': self.program_name,
'company_name': self.company_id.name, 'company_name': self.company_id.name,
'date_to': started_date, 'date_to': started_date,
'duration': duration, 'duration': duration,
'hours': hours, 'hours': hours,
'minutes': minutes, 'minutes': minutes,
'program_convener': self.program_convener.name, 'program_convener': self.program_convener_id.name,
} }
return self.env.ref('employee_orientation.print_pack_certificates').report_action(self, data=data) return self.env.ref('employee_orientation.print_pack_certificates').report_action(self, data=data)

4
employee_orientation/models/orientation_checklist.py

@ -30,10 +30,10 @@ class OrientationChecklist(models.Model):
_inherit = 'mail.thread' _inherit = 'mail.thread'
checklist_name = fields.Char(string='Name', required=True) checklist_name = fields.Char(string='Name', required=True)
checklist_department = fields.Many2one('hr.department', string='Department', required=True) checklist_department_id = fields.Many2one('hr.department', string='Department', required=True)
active = fields.Boolean(string='Active', default=True, active = fields.Boolean(string='Active', default=True,
help="Set active to false to hide the Orientation Checklist without removing it.") help="Set active to false to hide the Orientation Checklist without removing it.")
checklist_line_id = fields.Many2many('checklist.line', 'checklist_line_rel', String="Checklist") checklist_line_ids = fields.Many2many('checklist.line', 'checklist_line_rel', String="Checklist")

2
employee_orientation/models/orientation_checklist_line.py

@ -28,4 +28,4 @@ class ChecklistLine(models.Model):
_rec_name = 'line_name' _rec_name = 'line_name'
line_name = fields.Char(string='Name', required=True) line_name = fields.Char(string='Name', required=True)
responsible_user = fields.Many2one('res.users', string='Responsible User', required=True) responsible_user_id = fields.Many2one('res.users', string='Responsible User', required=True)

10
employee_orientation/models/orientation_checklist_request.py

@ -31,15 +31,15 @@ class OrientationChecklistRequest(models.Model):
_inherit = 'mail.thread' _inherit = 'mail.thread'
request_name = fields.Char(string='Name') request_name = fields.Char(string='Name')
request_orientation = fields.Many2one('employee.orientation', string='Employee Orientation') request_orientation_id = fields.Many2one('employee.orientation', string='Employee Orientation')
employee_company = fields.Many2one('res.company', string='Company', required=True, employee_company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id) default=lambda self: self.env.user.company_id)
partner_id = fields.Many2one('res.users', string='Responsible User') partner_id = fields.Many2one('res.users', string='Responsible User')
request_date = fields.Date(string="Date") request_date = fields.Date(string="Date")
employee_id = fields.Many2one('hr.employee', string='Employee') employee_id = fields.Many2one('hr.employee', string='Employee')
request_expected_date = fields.Date(string="Expected Date") request_expected_date = fields.Date(string="Expected Date")
attachment_id_1 = fields.Many2many('ir.attachment', 'orientation_rel_1', string="Attachment") attachment_id_1 = fields.Many2many('ir.attachment', 'orientation_rel_1', string="Attachment")
note_id = fields.Text('Description') note = fields.Text('Description')
user_id = fields.Many2one('res.users', string='users', default=lambda self: self.env.user) user_id = fields.Many2one('res.users', string='users', default=lambda self: self.env.user)
company_id = fields.Many2one('res.company', string='Company', required=True, company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id) default=lambda self: self.env.user.company_id)
@ -54,6 +54,7 @@ class OrientationChecklistRequest(models.Model):
ir_model_data = self.env['ir.model.data'] ir_model_data = self.env['ir.model.data']
try: try:
template_id = ir_model_data._xmlid_lookup('employee_orientation.orientation_request_mailer')[2] template_id = ir_model_data._xmlid_lookup('employee_orientation.orientation_request_mailer')[2]
print(template_id)
except ValueError: except ValueError:
template_id = False template_id = False
try: try:
@ -61,6 +62,7 @@ class OrientationChecklistRequest(models.Model):
except ValueError: except ValueError:
compose_form_id = False compose_form_id = False
ctx = dict(self.env.context or {}) ctx = dict(self.env.context or {})
print(template_id)
ctx.update({ ctx.update({
'default_model': 'orientation.request', 'default_model': 'orientation.request',
'default_res_id': self.ids[0], 'default_res_id': self.ids[0],

2
employee_orientation/security/ir.model.access.csv

@ -6,3 +6,5 @@ access_manager_employee_orientation_request,orientation.checklist,model_orientat
access_user_employee_training,employee.training,model_employee_training,hr.group_hr_user,1,1,1,1 access_user_employee_training,employee.training,model_employee_training,hr.group_hr_user,1,1,1,1
access_manager_employee_training,employee.training,model_employee_training,base.group_user,1,1,0,0 access_manager_employee_training,employee.training,model_employee_training,base.group_user,1,1,0,0
access_manager_orientation_request,orientation.request,model_orientation_request,base.group_user,1,1,0,0 access_manager_orientation_request,orientation.request,model_orientation_request,base.group_user,1,1,0,0
access_orientation_complete,orientation.complete,model_orientation_force_complete,hr.group_hr_user,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
6 access_user_employee_training employee.training model_employee_training hr.group_hr_user 1 1 1 1
7 access_manager_employee_training employee.training model_employee_training base.group_user 1 1 0 0
8 access_manager_orientation_request orientation.request model_orientation_request base.group_user 1 1 0 0
9 access_orientation_complete orientation.complete model_orientation_force_complete hr.group_hr_user 1 1 1 1
10

30
employee_orientation/views/employee_orientation.xml

@ -6,9 +6,9 @@
<field name="model">employee.orientation</field> <field name="model">employee.orientation</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Employee Orientation"> <tree string="Employee Orientation">
<field name="employee_name" /> <field name="employee_id" />
<field name="department" /> <field name="department_id" />
<field name="responsible_user"/> <field name="responsible_user_id"/>
<field name="orientation_id"/> <field name="orientation_id"/>
<field name="state"/> <field name="state"/>
</tree> </tree>
@ -33,18 +33,18 @@
</h1> </h1>
</div> </div>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="employee_name" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="employee_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
<field name="department"/> <field name="department_id"/>
<field name="date" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="date" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
<field name="job_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="job_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
<field name="responsible_user" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="responsible_user_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
<field name="parent_id"/> <field name="parent_id"/>
<field name="employee_company" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="employee_company_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
<field name="orientation_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/> <field name="orientation_id" attrs="{'readonly':[('state','in',('confirm','complete'))]}"/>
</group> </group>
<notebook colspan="4"> <notebook colspan="4">
<page name="checklist_lines" string="Orientation Checklists Lines" attrs="{'invisible': [('state', '=', 'draft')]}"> <page name="checklist_lines" string="Orientation Checklists Lines" attrs="{'invisible': [('state', '=', 'draft')]}">
<field name="orientation_request" attrs="{'readonly':[('state','=','complete')]}"> <field name="orientation_request_ids" attrs="{'readonly':[('state','=','complete')]}">
<tree string="lines" editable="bottom" create="true"> <tree string="lines" editable="bottom" create="true">
<field name="request_name"/> <field name="request_name"/>
<field name="partner_id"/> <field name="partner_id"/>
@ -54,8 +54,8 @@
<form> <form>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="request_name" /> <field name="request_name" />
<field name="request_orientation"/> <field name="request_orientation_id"/>
<field name="employee_company" readonly="1"/> <field name="employee_company_id" readonly="1"/>
<field name="partner_id"/> <field name="partner_id"/>
<field name="request_date" readonly="1"/> <field name="request_date" readonly="1"/>
<field name="request_expected_date"/> <field name="request_expected_date"/>
@ -66,7 +66,7 @@
</page> </page>
<page name="note_book" <page name="note_book"
string="Notes"> string="Notes">
<field name="note_id" colspan="4" nolabel="1" /> <field name="note" colspan="4" nolabel="1" />
</page> </page>
</notebook> </notebook>
</sheet> </sheet>
@ -82,13 +82,9 @@
<field name="model">employee.orientation</field> <field name="model">employee.orientation</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Employee Orientation"> <search string="Employee Orientation">
<field name="employee_name"/> <field name="employee_id"/>
<field name="department"/> <field name="department_id"/>
<newline /> <newline />
<!-- <group expand="0" string="Group By...">-->
<!-- <filter string="department" domain="[]"-->
<!-- context="{'group_by':'department'}" />-->
<!-- </group>-->
</search> </search>
</field> </field>
</record> </record>

11
employee_orientation/views/employee_training.xml

@ -7,8 +7,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Employee Training Program"> <tree string="Employee Training Program">
<field name="program_name"/> <field name="program_name"/>
<field name="program_department"/> <field name="program_department_id"/>
<field name="program_convener" domain="[('department_id.name', '=', 'program_department.name')]"/> <field name="program_convener_id" domain="[('department_id.name', '=', 'program_department.name')]"/>
<field name="state"/> <field name="state"/>
</tree> </tree>
</field> </field>
@ -29,21 +29,20 @@
<sheet> <sheet>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="program_name" /> <field name="program_name" />
<field name="program_department"/> <field name="program_department_id"/>
<label for="date_from" string="Time Period"/> <label for="date_from" string="Time Period"/>
<div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div> <div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div>
<field name="program_convener"/> <field name="program_convener_id"/>
</group> </group>
<notebook colspan="4"> <notebook colspan="4">
<page name="checklist_lines" string="Employee Details"> <page name="checklist_lines" string="Employee Details">
<field name="training_id"> <field name="training_ids">
<tree editable="true"> <tree editable="true">
<field name="name"/> <field name="name"/>
<field name="job_id"/> <field name="job_id"/>
<field name="parent_id"/> <field name="parent_id"/>
<field name="certificates" /> <field name="certificates" />
</tree> </tree>
<!-- <field name="product_updatable" invisible="1"/>-->
</field> </field>
</page> </page>
<page name="note_book" <page name="note_book"

14
employee_orientation/views/orientation_checklist.xml

@ -8,7 +8,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Orientation Checklists"> <tree string="Orientation Checklists">
<field name="checklist_name" /> <field name="checklist_name" />
<field name="checklist_department" /> <field name="checklist_department_id" />
</tree> </tree>
</field> </field>
</record> </record>
@ -22,15 +22,15 @@
<sheet> <sheet>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="checklist_name" /> <field name="checklist_name" />
<field name="checklist_department"/> <field name="checklist_department_id"/>
<field name="active"/> <field name="active"/>
</group> </group>
<notebook colspan="4"> <notebook colspan="4">
<page name="checklist_line" string="Checklist Lines"> <page name="checklist_line" string="Checklist Lines">
<field name="checklist_line_id" string="Checklist Line"> <field name="checklist_line_ids" >
<tree string="Checklist Lines" editable="bottom"> <tree string="Checklist Lines" editable="bottom">
<field name="line_name"/> <field name="line_name"/>
<field name="responsible_user"/> <field name="responsible_user_id"/>
</tree> </tree>
</field> </field>
</page> </page>
@ -50,12 +50,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Orientation Checklists"> <search string="Orientation Checklists">
<field name="checklist_name"/> <field name="checklist_name"/>
<field name="checklist_department"/> <field name="checklist_department_id"/>
<newline /> <newline />
<!-- <group expand="0" string="Group By">-->
<!-- <filter string="department" domain="[]"-->
<!-- context="{'group_by':'checklist_department'}" />-->
<!-- </group>-->
</search> </search>
</field> </field>
</record> </record>

10
employee_orientation/views/orientation_checklist_line.xml

@ -8,7 +8,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Orientation Checklists Lines"> <tree string="Orientation Checklists Lines">
<field name="line_name" /> <field name="line_name" />
<field name="responsible_user" /> <field name="responsible_user_id" />
</tree> </tree>
</field> </field>
</record> </record>
@ -21,7 +21,7 @@
<sheet> <sheet>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="line_name" /> <field name="line_name" />
<field name="responsible_user"/> <field name="responsible_user_id"/>
</group> </group>
</sheet> </sheet>
</form> </form>
@ -34,12 +34,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Orientation Checklists Lines"> <search string="Orientation Checklists Lines">
<field name="line_name" /> <field name="line_name" />
<field name="responsible_user" /> <field name="responsible_user_id" />
<newline /> <newline />
<!-- <group expand="0" string="Group By...">-->
<!-- <filter string="ResponsibleUser" domain="[]"-->
<!-- context="{'group_by':'responsible_user'}" />-->
<!-- </group>-->
</search> </search>
</field> </field>
</record> </record>

12
employee_orientation/views/orientation_checklists_request.xml

@ -7,7 +7,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Employee Orientation" create="0"> <tree string="Employee Orientation" create="0">
<field name="request_name" /> <field name="request_name" />
<field name="request_orientation" /> <field name="request_orientation_id" />
<field name="partner_id" /> <field name="partner_id" />
<field name="state"/> <field name="state"/>
</tree> </tree>
@ -27,19 +27,19 @@
<sheet> <sheet>
<group colspan="1" col="4" name="main"> <group colspan="1" col="4" name="main">
<field name="request_name" readonly="1"/> <field name="request_name" readonly="1"/>
<field name="request_orientation" readonly="1"/> <field name="request_orientation_id" readonly="1"/>
<field name="employee_id" readonly="1"/> <field name="employee_id" readonly="1"/>
<field name="partner_id" readonly="1"/> <field name="partner_id" readonly="1"/>
<field name="request_date" readonly="1"/> <field name="request_date" readonly="1"/>
<field name="request_expected_date" attrs="{'readonly':[('state','=','complete')]}"/> <field name="request_expected_date" attrs="{'readonly':[('state','=','complete')]}"/>
<field name="employee_company" readonly="1"/> <field name="employee_company_id" readonly="1"/>
</group> </group>
<notebook> <notebook>
<page name="orientation_line_attachments" string="Documents"> <page name="orientation_line_attachments" string="Documents">
<field name="attachment_id_1" widget="many2many_binary" attrs="{'readonly':[('state','=','complete')]}" /> <field name="attachment_id_1" widget="many2many_binary" attrs="{'readonly':[('state','=','complete')]}" />
</page> </page>
<page name="note_book" string="Notes"> <page name="note_book" string="Notes">
<field name="note_id" nolabel="1"/> <field name="note" nolabel="1"/>
</page> </page>
</notebook> </notebook>
</sheet> </sheet>
@ -57,10 +57,6 @@
<search string="Employee Orientation"> <search string="Employee Orientation">
<field name="request_name"/> <field name="request_name"/>
<newline /> <newline />
<!-- <group expand="0" string="Group By...">-->
<!-- <filter string="Request" domain="[]"-->
<!-- context="{'group_by':'request_name'}" />-->
<!-- </group>-->
</search> </search>
</field> </field>
</record> </record>

11
employee_orientation/views/orientation_request_mail_template.xml

@ -3,8 +3,8 @@
<data noupdate="1"> <data noupdate="1">
<record id="orientation_request_mailer" model="mail.template"> <record id="orientation_request_mailer" model="mail.template">
<field name="name">Employee Orientation Request</field> <field name="name">Employee Orientation Request</field>
<field name="email_from">{{(object.user_id.email or object.company_id.email)}}</field> <field name="email_from">{{(object.user_id.login or object.company_id.email)}}</field>
<field name="email_to">{{(object.partner_id.email)}}</field> <field name="email_to">{{(object.partner_id.work_email)}}</field>
<field name="subject">Employee Orientation Request</field> <field name="subject">Employee Orientation Request</field>
<field name="model_id" ref="employee_orientation.model_orientation_request"/> <field name="model_id" ref="employee_orientation.model_orientation_request"/>
<field name="auto_delete" eval="True"/> <field name="auto_delete" eval="True"/>
@ -71,20 +71,21 @@
<record id="orientation_training_mailer" model="mail.template"> <record id="orientation_training_mailer" model="mail.template">
<field name="name">Employee Training program</field> <field name="name">Employee Training program</field>
<field name="email_from">{{(object.user_id.email or object.company_id.email)}}</field> <field name="email_from">{{(object.user_id.email or object.company_id.email)}}</field>
<field name="email_to">{{(object.program_convener.email)}}</field> <field name="email_to">{{(object.program_convener_id.login)}}</field>
<field name="subject">Employee Training Request</field> <field name="subject">Employee Training Request</field>
<field name="model_id" ref="employee_orientation.model_employee_training"/> <field name="model_id" ref="employee_orientation.model_employee_training"/>
<field name="auto_delete" eval="True"/> <field name="auto_delete" eval="True"/>
<field name="body_html" type="html"> <field name="body_html" type="html">
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p> <p>
Hello <t t-out="object.program_convener.name"/>, Hello
<t t-out="object.program_convener_id.name"/>,
</p> </p>
<p> <p>
You are requested to conduct You are requested to conduct
<t t-out="object.program_name"/> <t t-out="object.program_name"/>
Training program for Training program for
<t t-out="object.program_department.name"/> <t t-out="object.program_department_id.name"/>
department department
<t t-if=" object.date_from and object.date_to"> <t t-if=" object.date_from and object.date_to">
from from

2
employee_orientation/wizard/orientation_complete.py

@ -34,7 +34,7 @@ class OrientationForceComplete(models.TransientModel):
def pending_lines(self): def pending_lines(self):
pending = [] pending = []
for data in self.orientation_id.orientation_request: for data in self.orientation_id.orientation_request_ids:
if data.state == 'new': if data.state == 'new':
pending.append(data.id) pending.append(data.id)
self.update({'orientation_lines': pending}) self.update({'orientation_lines': pending})

Loading…
Cancel
Save