完成合同审批模块的代码调整

This commit is contained in:
李鹏宇
2025-12-29 17:11:34 +08:00
parent de5c032512
commit ae021f37d3
5 changed files with 37 additions and 2 deletions
@@ -80,6 +80,7 @@
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='department_id']" position="after">
<field name="allowed_user_ids" invisible="1"/>
<field name="number"/>
<field name="establishment_quotas"/>
<field name="no_of_employee" string="在编人数"/>
+7 -2
View File
@@ -12,7 +12,7 @@
'author': 'pengyuthon',
'website': 'https://www.pengyuthon.com',
'depends': ['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents', 'hr_recruitment',
'room', 'yuthon_issue', 'mail'],
'room', 'yuthon_issue', 'mail', 'web'],
'data': [
'security/ir.model.access.csv',
'data/process_code_data.xml',
@@ -52,8 +52,13 @@
'views/yuthon_social_files_approval_view.xml',
'views/website_employee_views.xml',
'views/menuitem.xml',
'report/contract_review_report.xml',
'report/contract_review_report_templates.xml',
'wizard/yuthon_website_employee_wizard.xml',
'wizard/interview_approval_wizard.xml'
'wizard/interview_approval_wizard.xml',
],
'installable': True,
'application': False,
@@ -33,6 +33,14 @@ class ContractReviewApproval(models.Model):
name_title = fields.Char(default=_get_default_name_title)
def action_print_contract_review(self):
# report_ref = self.env['ir.actions.report'].search([
# ('report_name', '=', 'yuthon_hr_employee_approval.action_contract_review_report')])
report_ref = self.env.ref('yuthon_hr_employee_approval.action_contract_review_report')
return report_ref.report_action(self.id)
return self.env.ref('yuthon_hr_employee_approval.action_contract_review_report').report_action(self.id)
@api.onchange('user_id')
def _onchange_user_id(self):
if self.user_id:
@@ -16,6 +16,12 @@
<field name="model">contract.review.approval</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_print_contract_review"
type="object"
string="打印"
class="btn-primary"/>
</header>
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="action_business_approval_print_report" model="ir.actions.report">
<field name="name">业务审批单</field>
<field name="model">yuthon.business.approval</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">yuthon_trade.business_approval_print_report_document</field>
<field name="report_file">yuthon_trade.business_approval_print_report_document</field>
<field name="binding_model_id" ref="model_yuthon_business_approval"/>
<field name="binding_type">report</field>
<field name="print_report_name">'业务审批单 - %s' % (object.name or '')</field>
</record>
</data>
</odoo>