Merge pull request !459 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2024-11-14 10:59:54 +00:00
committed by Gitee
3 changed files with 12 additions and 7 deletions
@@ -19,6 +19,7 @@ class YuthonOnboardApproval(models.Model):
_description = "入职申请表"
_inherit = ['soong.workflow.mixin']
name = fields.Char(string="标题")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_onboard_approval_code'))
employee_id = fields.Many2one('hr.employee', string='姓名')
@@ -75,3 +76,9 @@ class YuthonOnboardApproval(models.Model):
'default_date_end': self.duration_employment_end,
'default_job_lv_id': self.grades_id.id,
}}
@api.onchange('employee_id')
def _onchange_employee_id(self):
for record in self:
if record.employee_id:
self.name = record.employee_id.name + '的入职合同'
@@ -20,6 +20,11 @@
<button name="put_contract" type="object" class="oe_highlight" string="创建合同"/>
</header>
<sheet>
<div class="col-12 text-center">
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="yuthon_company"/>
@@ -7,11 +7,4 @@
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
<record id="yuthon_sps_code_sequence1" model="ir.sequence">
<field name="name">办公用品借用编号</field>
<field name="code">yuthon_office_borrow_code</field>
<field name="prefix">BG%(y)s%(month)s%(day)s</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
</odoo>