添加功能
This commit is contained in:
@@ -6,7 +6,7 @@ from odoo import models, fields, api, exceptions, _
|
||||
|
||||
class PropertyManagement(models.Model):
|
||||
_name = 'property.management'
|
||||
_description = '物业管理变更申请表'
|
||||
_description = '物业分配申请表'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
@@ -19,11 +19,29 @@ class PropertyManagement(models.Model):
|
||||
new_property_ids = fields.One2many('property.information.detail.lines', 'new_property_id', string="新物业信息")
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
@api.onchange('is_issues')
|
||||
def _onchange_is_issues(self):
|
||||
if self.is_issues:
|
||||
issue_id = self.env['issue.library'].create({'name': self.name})
|
||||
self.related_issues_id = issue_id.id
|
||||
workflow_record_id = self.env["soong.workflow.record"].search(
|
||||
[("res_model", "=", self._name), ("res_id", "=", self.id)])
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': issue_id.id,
|
||||
'workflow_record_id': workflow_record_id.id,
|
||||
'approval_type': workflow_record_id.workflow_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now(),
|
||||
})
|
||||
|
||||
|
||||
class PropertyInformationDetailLines(models.Model):
|
||||
@@ -31,10 +49,11 @@ class PropertyInformationDetailLines(models.Model):
|
||||
_description = '新物业信息'
|
||||
|
||||
new_property_id = fields.Many2one('property.management', string="新物业信息")
|
||||
new_company = fields.Char(string="新公司")
|
||||
company_id = fields.Many2one('yuthon.property.company', string="所属公司")
|
||||
new_admin = fields.Char(string="新管理员")
|
||||
new_precincts = fields.Char(string="新片区")
|
||||
new_management_type = fields.Char(string="新权属类型")
|
||||
admin_id = fields.Many2one('res.users', string="管理员")
|
||||
new_precincts = fields.Many2one('yuthon.precinct.message', string="新片区")
|
||||
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@
|
||||
<group>
|
||||
<field name="urgency_level" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="is_issues"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="related_issues_id" invisible="is_issues == False"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
@@ -45,28 +52,29 @@
|
||||
<group>
|
||||
<field name="reason_change"/>
|
||||
<field name="handling_opinions"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
<group string="原物业信息">
|
||||
<group string="原管理信息">
|
||||
<field name="original_property_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="original_property_id" column_invisible="1"/>
|
||||
<field name="property_name"/>
|
||||
<field name="company_id"/>
|
||||
<field name="tenure_type"/>
|
||||
<field name="admin_id"/>
|
||||
<field name="precinct"/>
|
||||
<field name="management_type"/>
|
||||
<field name="property_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group string="新物业信息">
|
||||
<group string="新管理信息">
|
||||
<field name="new_property_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="new_property_id" column_invisible="1"/>
|
||||
<field name="new_company"/>
|
||||
<field name="new_admin"/>
|
||||
<field name="new_precincts"/>
|
||||
<field name="new_management_type"/>
|
||||
<field name="tenure_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="js_class">custom_salary_button</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='basic_wage']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='gross_wage']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='net_wage']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='net_wage']" position="after">
|
||||
<field name="base_salary"/>
|
||||
<field name="performance_bonuses"/>
|
||||
|
||||
@@ -45,12 +45,22 @@ class SalaryComputeWizard(models.Model):
|
||||
def confirm(self):
|
||||
for employee in self.employee_ids:
|
||||
contract_id = self.env['hr.contract'].search([('employee_id', '=', employee.id)], limit=1)
|
||||
payslip_run_id = self.env['hr.payslip.run'].search([('name', '=', '2025年-3月')])
|
||||
if not payslip_run_id:
|
||||
payslip_run_id = self.env['hr.payslip.run'].create({
|
||||
'name': '2025年-3月',
|
||||
'date_start': '2025-03-01',
|
||||
'date_end': '2025-03-31',
|
||||
'state': 'draft',
|
||||
'payslip_count':0
|
||||
})
|
||||
struct_id = contract_id.structure_type_id.default_struct_id
|
||||
payslip = self.env['hr.payslip'].create({
|
||||
'name': employee.name,
|
||||
'employee_id': employee.id,
|
||||
'contract_id': contract_id.id,
|
||||
'struct_id': struct_id.id,
|
||||
'payslip_run_id':payslip_run_id.id,
|
||||
'state':'draft',
|
||||
})
|
||||
payslip.compute_sheet()
|
||||
|
||||
Reference in New Issue
Block a user