添加功能

This commit is contained in:
李鹏宇
2026-03-03 15:22:59 +08:00
parent 963373122e
commit 8c825643ce
9 changed files with 84 additions and 4 deletions
@@ -74,6 +74,7 @@ class SoongWorkflowLog2(models.Model):
_description = "Soong Workflow Log2"
workflow_id = fields.Many2one(comodel_name="soong.workflow")
code = fields.Char(string="流水号", compute="_compute_code")
model = fields.Char(string="Related Document Model", index=True, required=True)
res_id = fields.Integer(string="Related Document ID", index=True, required=True)
node_id = fields.Many2one(comodel_name="soong.workflow.node")
@@ -87,6 +88,13 @@ class SoongWorkflowLog2(models.Model):
lase_click_date = fields.Datetime(string="操作时间")
commit = fields.Char(string="意见")
@api.depends("res_id", 'model')
def _compute_code(self):
record = self.env[self.model].browse(self.res_id)
if record:
self.code = record.code
else:
self.code = ""
@api.depends("workflow_id", "node_id", "node_btn_id")
def _compute_name(self):
@@ -32,6 +32,7 @@
<field name="arch" type="xml">
<tree string="传阅日志" default_order="lase_click_date desc">
<field name="sequence"/>
<field name="code"/>
<field name="name"/>
<field name="workflow_id" string="审批类型"/>
<field name="node_btn_id"/>
@@ -111,9 +111,9 @@ class RemoveHolidayApprovals(models.Model):
])
if attend_records:
for attend in attend_records:
attend.compute_attend()
attend.workflow_id = False
attend.is_workflow = False
attend.compute_attend()
@api.depends('date_start', 'date_end')
def _compute_duration(self):
@@ -193,6 +193,10 @@ class PropertyLeaseContract(models.Model):
first_year_rent = fields.Float(string="首年租金")
rent = fields.Float(string="租金", help='第一笔合同的应收')
total_contract_receivables = fields.Float(string="合同总应收", compute="_compute_total_contract_receivables")
lessor_line = fields.One2many('lessor.alteration.line', 'contract_id', string="出租变更明细")
lessee_line = fields.One2many('lessee.alteration.line', 'contract_id', string="承租变更明细")
is_lessor = fields.Boolean(string="出租方变更")
is_lessee = fields.Boolean(string="承租方变更")
def _get_default_tax_rate(self):
default_rate = self.env['yuthon.tariff.setting'].search(
@@ -2534,3 +2538,22 @@ class PropertySubsetContract(models.Model):
lessee_id = fields.Many2one(related='contract_id.lessee_id', string="承租方")
rental_purposes = fields.Many2one(related='contract_id.rental_purposes', string="出租用途")
class LesseeAlterationLine(models.Model):
_name = 'lessee.alteration.line'
_description = '承租方变更明细行'
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
lessee_id = fields.Char(string="承租方")
start_date = fields.Date(string="生效日期", default=fields.Datetime.today())
end_date = fields.Date(string="失效日期")
class LessorAlterationLine(models.Model):
_name = 'lessor.alteration.line'
_description = '出租方变更明细行'
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
lessor_id = fields.Char(string="出租方")
start_date = fields.Date(string="生效日期", default=fields.Datetime.today())
end_date = fields.Date(string="失效日期")
@@ -131,4 +131,7 @@ access_property_management_line2,property_management_line2,model_property_manage
access_yuthon_expenses_type,yuthon.expenses.type,model_yuthon_expenses_type,base.group_user,1,1,1,1
access_property_fee_spending,property_fee_spending,model_property_fee_spending,base.group_user,1,1,1,1
access_property_fee_spending_line,property_fee_spending_line,model_property_fee_spending_line,base.group_user,1,1,1,1
access_build_fee_wizard,build_fee_wizard,model_build_fee_wizard,base.group_user,1,1,1,1
access_build_fee_wizard,build_fee_wizard,model_build_fee_wizard,base.group_user,1,1,1,1
access_lessee_alteration_line,lessee.alteration.line,model_lessee_alteration_line,base.group_user,1,1,1,1
access_lessor_alteration_line,lessor.alteration.line,model_lessor_alteration_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
131
132
133
134
135
136
137
@@ -857,6 +857,26 @@
</tree>
</field>
</page>
<page string="承租方变更明细">
<field name="lessee_line">
<tree editable="bottom">
<field name="contract_id" column_invisible="1"/>
<field name="lessee_id" options="{'no_open': True}"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>
</field>
</page>
<page string="出租方变更明细">
<field name="lessor_line">
<tree editable="bottom">
<field name="contract_id" column_invisible="1"/>
<field name="lessor_id" options="{'no_open': True}"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>
</field>
</page>
</notebook>
<group col="4">
<group>
@@ -75,6 +75,8 @@ class InheritRoomBooking(models.Model):
'request_hour_from': request_hour_from,
'request_hour_to': request_hour_to,
'address': new_record.room_id.name,
'room_booking_id': new_record.id,
'task_type': 'meet',
'task_state': 'will',
})
return new_record
@@ -73,10 +73,32 @@ class YuthonWillTask(models.Model):
('task', '日程'),
('meet', '会议')
], string='类型', default='task')
room_booking_id = fields.Many2one('room.booking', string='会议室')
def back_wecom_msg(self):
self.env['wecom.apps'].back_message(category='task', msg_id=self.msg_id)
def open_record(self):
self.ensure_one()
if self.room_booking_id:
target_model = 'room.booking'
target_id = self.room_booking_id.id
view_id = self.env.ref('room.room_booking_view_form').id
else:
target_model = self._name
target_id = self.id
view_id = self.env.ref('yuthon_will_task.view_yuthon_will_task_form').id
return {
'type': 'ir.actions.act_window',
'name': f'{target_model} 详情',
'res_model': target_model,
'res_id': target_id,
'view_mode': 'form',
'view_type': 'form',
'view_id': view_id,
'target': 'current',
}
@api.depends('start_date')
def _compute_task_week(self):
@@ -8,7 +8,8 @@
decoration-muted="task_state == 'cancel'"
decoration-danger="priority == 'very_urgent'"
decoration-info="priority == 'urgent'"
decoration-success="priority == 'important'" limit="15">
decoration-success="priority == 'important'" limit="15" action="open_record" type="object">
<field name="task_type"/>
<field name='start_date' column_invisible="1"/>
<field name='task_time'/>
<field name='name' required="1"/>
@@ -85,7 +86,7 @@
style="max-width: 6rem !important;"/>
<field name="task_week" string="" class="me-2" style="max-width: 4rem !important;"/>
<field name="request_hour_from" string=" " class="ms-2"
style="max-width: 5rem !important;"/>→
style="max-width: 5rem !important;"/>
<field name="request_hour_to" string=" " class="ms-2"
style="max-width: 5rem !important;"/>
</div>