@@ -7,6 +7,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="流程查询">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="workflow_id" string="审批类型"/>
|
||||
<filter name="my_department_shifts" string="本部门" domain="[('member_of_department', '=', True)]"/>
|
||||
<group expand="0" string="审批分组">
|
||||
|
||||
@@ -52,6 +52,18 @@
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_inherit_hr_department_search" model="ir.ui.view">
|
||||
<field name="name">inherit.hr.department.search</field>
|
||||
<field name="model">hr.department</field>
|
||||
<field name="inherit_id" ref="hr.view_department_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='manager_id']" position="after">
|
||||
<searchpanel>
|
||||
<field name="company_id" string="公司"/>
|
||||
</searchpanel>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sync_hr_do_department_to_res_groups" model="ir.actions.server">
|
||||
<field name="name">批量生成权限组</field>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</group>
|
||||
<group col="4" string="发布范围">
|
||||
<group>
|
||||
<field name="department_ids" widget="many2many_tags"/>
|
||||
<field name="department_ids" widget="many2many_tags" context="{'tree_view_ref':'yuthon_notice.view_yuthon_cs_tree'}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="users_role_group_ids" widget="many2many_tags"/>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="片区管理" editable="bottom" limit="20">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="name"/>
|
||||
<field name="employee_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -42,6 +42,7 @@ class PropertyLeaseContract(models.Model):
|
||||
name = fields.Char(string='物业信息')
|
||||
code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('property_lease_contract_code'))
|
||||
admin_id = fields.Many2one('res.users', string="管理员")
|
||||
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
|
||||
contract_code = fields.Char(string="合同编号")
|
||||
contract_date = fields.Date(string="合同签订日期")
|
||||
property_documents_ids = fields.Many2many('ir.attachment', string="租赁合同文件")
|
||||
@@ -157,6 +158,9 @@ class PropertyLeaseContract(models.Model):
|
||||
responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书(住宅)")
|
||||
other_id = fields.Many2one('ir.attachment', string="其他")
|
||||
handover_time = fields.Date(string="交接日期")
|
||||
contract_source_id = fields.Many2one('property.lease.contract', string="合同来源")
|
||||
is_child_contract = fields.Boolean(string="是否子合同")
|
||||
is_contract = fields.Boolean(string="是否主合同")
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
work_end = fields.Boolean(string="结束")
|
||||
@@ -203,6 +207,7 @@ class PropertyLeaseContract(models.Model):
|
||||
contract_ids = self.env["property.lease.contract"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in contract_ids:
|
||||
|
||||
if record.term_start_time:
|
||||
record.actual_start_time = record.term_start_time
|
||||
if record.term_end_time:
|
||||
@@ -904,6 +909,7 @@ class PropertyLeaseContract(models.Model):
|
||||
rec.electricity_fee_ids = [(5, 0, 0)]
|
||||
rec.mange_fee_ids = [(5, 0, 0)]
|
||||
rec.admin_id = rec.lease_ids[0].admin_line_id.id if rec.lease_ids else ''
|
||||
rec.tenure_type = rec.lease_ids[0].address_id.tenure_type if rec.lease_ids else ''
|
||||
rec.company_id = rec.lease_ids[0].address_id.company_id.id if rec.lease_ids else ''
|
||||
rec.precinct_id = rec.lease_ids[0].address_id.precinct_id.id if rec.lease_ids else ''
|
||||
rec.total_area = sum([lease.property_area for lease in rec.lease_ids])
|
||||
@@ -915,12 +921,11 @@ class PropertyLeaseContract(models.Model):
|
||||
for record in property_ids:
|
||||
company_id = record.lease_ids[0].address_id.company_id.id if record.lease_ids else ''
|
||||
admin_id = record.lease_ids[0].admin_line_id.id if record.lease_ids else ''
|
||||
record.write({'company_id': company_id,
|
||||
tenure_type = record.lease_ids[0].address_id.tenure_type if record.lease_ids else ''
|
||||
record.sudo().write({'company_id': company_id,
|
||||
'admin_id': admin_id,
|
||||
'actual_end_time': datetime.now(),
|
||||
'precinct_id': record.lease_ids[0].address_id.precinct_id.id if record.lease_ids else '',
|
||||
'use_address': record.name,
|
||||
'address_for_delivery': record.name,})
|
||||
'tenure_type':tenure_type,
|
||||
'precinct_id': record.lease_ids[0].address_id.precinct_id.id if record.lease_ids else '',})
|
||||
|
||||
def action_yuthon_property_contract_wizard(self):
|
||||
return {
|
||||
@@ -979,9 +984,14 @@ class PropertyLeaseContract(models.Model):
|
||||
|
||||
def action_copy_record1(self):
|
||||
for record in self:
|
||||
record.is_contract = True
|
||||
record.is_child_contract = False
|
||||
record.number += 1
|
||||
contract_id = self.env['property.lease.contract'].create({
|
||||
'name': record.name,
|
||||
'is_child_contract': True,
|
||||
'is_contract': False,
|
||||
'contract_source_id': record.id,
|
||||
'actual_start_time': record.actual_start_time,
|
||||
'actual_end_time': record.actual_end_time,
|
||||
'contract_code': record.contract_code+ f'-{record.number}',
|
||||
@@ -1088,7 +1098,7 @@ class PropertyLeaseContract(models.Model):
|
||||
}])
|
||||
rent_list = []
|
||||
if record.rent_list_ids:
|
||||
for record in record.rent_list_ids:
|
||||
for rent in record.rent_list_ids:
|
||||
rent_list.append([0, 0, {
|
||||
'contract_id': contract_id.id,
|
||||
}])
|
||||
@@ -1099,11 +1109,11 @@ class PropertyLeaseContract(models.Model):
|
||||
# management_list.append([0, 0, {
|
||||
# 'contract_id': contract_id.id,
|
||||
# }])
|
||||
# subset_list = []
|
||||
# subset_list.append([0, 0, {
|
||||
# 'subset_id': record.id,
|
||||
# 'contract_id': contract_id.id, }])
|
||||
# record.subset_ids = subset_list
|
||||
subset_list = []
|
||||
subset_list.append([0, 0, {
|
||||
'subset_id': record.id,
|
||||
'contract_id': contract_id.id}])
|
||||
record.subset_ids = subset_list
|
||||
contract_id.write({
|
||||
'lease_ids': lease_list,
|
||||
'breakdown_ids': breakdown_list,
|
||||
@@ -1379,4 +1389,7 @@ class PropertySubsetContract(models.Model):
|
||||
_description = '物业子合同明细'
|
||||
|
||||
subset_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联合同审批")
|
||||
contract_id = fields.Many2one('property.lease.contract', string="合同")
|
||||
name = fields.Char(related='contract_id.name', string="物业信息")
|
||||
lessee_id = fields.Many2one(related='contract_id.lessee_id', string="承租方")
|
||||
rental_purposes = fields.Many2one(related='contract_id.rental_purposes', string="出租用途")
|
||||
@@ -77,6 +77,10 @@
|
||||
<field name="address_for_delivery"/>
|
||||
<field name="title_address"/>
|
||||
<field name="handling_opinions"/>
|
||||
<field name="tenure_type" invisible="1"/>
|
||||
<field name="is_child_contract" invisible="1"/>
|
||||
<field name="is_contract" invisible="1"/>
|
||||
<field name="contract_source_id" invisible="not is_child_contract"/>
|
||||
<field name="condition" readonly="1" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -133,6 +137,17 @@
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page string="子合同" invisible="not is_contract">
|
||||
<field name="subset_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="subset_id" column_invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="contract_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="rental_purposes"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="property_documents_ids" widget="many2many_tags" invisible="1">
|
||||
@@ -429,8 +444,12 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="use_address"/>
|
||||
<field name="is_child_contract" invisible="1"/>
|
||||
<field name="is_contract" invisible="1"/>
|
||||
<field name="contract_source_id" invisible="not is_child_contract"/>
|
||||
<field name="property_state" invisible="1"/>
|
||||
<field name="deposit_status" invisible="1"/>
|
||||
<field name="tenure_type" invisible="1"/>
|
||||
<field name="address_for_delivery"/>
|
||||
<field name="condition" invisible="1" readonly="1"/>
|
||||
<field name="is_equal" invisible="1"/>
|
||||
@@ -493,6 +512,17 @@
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page string="子合同" invisible="not is_contract">
|
||||
<field name="subset_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="subset_id" column_invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="contract_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="rental_purposes"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="property_documents_ids" widget="many2many_tags" invisible="1">
|
||||
@@ -709,6 +739,7 @@
|
||||
<searchpanel>
|
||||
<field name="company_id"/>
|
||||
<field name="precinct_id"/>
|
||||
<field name="tenure_type"/>
|
||||
</searchpanel>
|
||||
<group expand="0" string="Group By">
|
||||
<filter name="group_by_condition" context="{'group_by': 'condition'}"/>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<field name="admin_id_all"/>
|
||||
<field name="precinct_id"/>
|
||||
<field name="purpose_id"/>
|
||||
<field name="information_line_id"/>
|
||||
<field name="information_line_id" column_invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
@@ -19,8 +19,8 @@ class YuthonTaskApproval(models.Model):
|
||||
employee_ids = fields.Many2many('hr.employee', string="作业人员")
|
||||
task_id = fields.Many2one('yuthon.task.setting', string="作业项目")
|
||||
stack_position_ids = fields.Many2many('yuthon.stack.position', string="作业堆位")
|
||||
task_start_time = fields.Datetime(string="作业开始时间", default=lambda self: fields.Datetime.to_string(datetime.now() - timedelta(hours=8)))
|
||||
task_end_time = fields.Datetime(string="作业结束时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(8, 0))))
|
||||
task_start_time = fields.Datetime(string="作业开始时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(0, 30))))
|
||||
task_end_time = fields.Datetime(string="作业结束时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(8, 30))))
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
@@ -51,4 +51,10 @@ class YuthonTaskApproval(models.Model):
|
||||
delta = end - start
|
||||
record.duration = delta.total_seconds() / 3600
|
||||
else:
|
||||
record.duration = 0
|
||||
record.duration = 0
|
||||
|
||||
@api.constrains('task_start_time', 'task_end_time')
|
||||
def _check_task_end_time(self):
|
||||
for record in self:
|
||||
if record.task_start_time and record.task_end_time and record.task_start_time > record.task_end_time:
|
||||
raise models.ValidationError("开始时间不能大于结束时间!")
|
||||
Reference in New Issue
Block a user