+
@@ -146,6 +149,9 @@
+
+
+
diff --git a/yuthon_official/models/yuthon_offficial_incoming_party.py b/yuthon_official/models/yuthon_offficial_incoming_party.py
index 53bbd2fbc..22f45109d 100644
--- a/yuthon_official/models/yuthon_offficial_incoming_party.py
+++ b/yuthon_official/models/yuthon_offficial_incoming_party.py
@@ -30,7 +30,7 @@ class YuthonOfficialIncomingParty(models.Model):
department_id = fields.Many2one('hr.department', string="申请人部门")
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
string="状态", default='drft')
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
red_suit = fields.Char(string="套红")
official_documents_ids = fields.Many2many('ir.attachment', string="附件")
is_issues = fields.Boolean(string="是否上会")
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index 6b6ee4025..b0484926e 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -42,7 +42,7 @@ class YuthonOfficial(models.Model):
official_documents_ids = fields.Many2many('ir.attachment', string="附件")
is_supervising = fields.Boolean(string="是否督办")
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
done_date = fields.Date(string="完成时间")
workflow_inspector_ids = fields.One2many('soong.workflow.inspector', 'yuthon_official_id', string="督办事项")
room_booking_ids = fields.One2many('room.booking', 'yuthon_official_id', string="会议关联")
diff --git a/yuthon_official/models/yuthon_official_incoming_labor.py b/yuthon_official/models/yuthon_official_incoming_labor.py
index f9fadb349..144317272 100644
--- a/yuthon_official/models/yuthon_official_incoming_labor.py
+++ b/yuthon_official/models/yuthon_official_incoming_labor.py
@@ -30,7 +30,7 @@ class YuthonOfficialIncomingLabor(models.Model):
department_id = fields.Many2one('hr.department', string="申请人部门")
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
string="状态", default='drft')
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
red_suit = fields.Char(string="套红")
official_documents_ids = fields.Many2many('ir.attachment', string="附件")
is_issues = fields.Boolean(string="是否上会")
diff --git a/yuthon_official/models/yuthon_official_incoming_normal.py b/yuthon_official/models/yuthon_official_incoming_normal.py
index 3b70a6317..f344374a5 100644
--- a/yuthon_official/models/yuthon_official_incoming_normal.py
+++ b/yuthon_official/models/yuthon_official_incoming_normal.py
@@ -33,7 +33,7 @@ class YuthonOfficialIncomingNormal(models.Model):
is_issues = fields.Boolean(string="是否上会")
issues_result = fields.Html(string="会议结果")
is_supervising = fields.Boolean(string="是否督办")
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
done_date = fields.Date(string="完成时间")
is_official_incoming = fields.Boolean(string="是否收文")
official_documents_ids = fields.Many2many('ir.attachment', string="收文附件")
diff --git a/yuthon_official/models/yuthon_official_labor.py b/yuthon_official/models/yuthon_official_labor.py
index 768268213..6a05c2cca 100644
--- a/yuthon_official/models/yuthon_official_labor.py
+++ b/yuthon_official/models/yuthon_official_labor.py
@@ -23,7 +23,7 @@ class YuthonOfficialLabor(models.Model):
department_id = fields.Many2one('hr.department', string="申请人部门")
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
string="状态", default='drft')
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
red_suit = fields.Char(string="套红")
official_documents_ids = fields.Many2many('ir.attachment', string="附件")
urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], default='normal'
diff --git a/yuthon_official/models/yuthon_official_party.py b/yuthon_official/models/yuthon_official_party.py
index 510b53cdd..fa02b3c87 100644
--- a/yuthon_official/models/yuthon_official_party.py
+++ b/yuthon_official/models/yuthon_official_party.py
@@ -30,7 +30,7 @@ class YuthonOfficialParty(models.Model):
department_id = fields.Many2one('hr.department', string="申请人部门")
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
string="状态", default='drft')
- deadline = fields.Date(string="办理期限")
+ deadline = fields.Datetime(string="办理期限")
red_suit = fields.Char(string="套红")
official_documents_ids = fields.Many2many('documents.document', string="公文相关文件")
active = fields.Boolean('Active', default=True, tracking=True)
diff --git a/yuthon_property/models/property_evaluation_plan.py b/yuthon_property/models/property_evaluation_plan.py
index db24a38e3..843719334 100644
--- a/yuthon_property/models/property_evaluation_plan.py
+++ b/yuthon_property/models/property_evaluation_plan.py
@@ -16,10 +16,23 @@ class PropertyEvaluationPlan(models.Model):
registered_id2 = fields.Many2one('yuthon.purpose.evidence', string='设定用途')
rent_id = fields.Many2one('rent.free.setting', string="办法")
lease_period = fields.Integer(string='租赁期限(<=)')
- annual_increase_percentage = fields.Float(string='每年递增(%)', igits=(6, 2))
+ first_years_begin = fields.Integer(string='第几年开始')
+ increments_few_years = fields.Integer(string='每几年递增')
+ lease_form = fields.Selection([('sublease', '分租'), ('whole', '整租')], string="租赁形式", compute='compute_lease_form')
+ annual_increase_percentage = fields.Float(string='递增百分比', igits=(6, 2))
remake = fields.Text(string='备注')
property_state = fields.Selection([('to', '待审批'), ('done', '已审批')], string="状态", default='to')
+ @api.depends('property_ids')
+ def compute_lease_form(self):
+ for record in self:
+ if record.property_ids:
+ if len(record.property_ids) > 1:
+ record.lease_form = 'sublease'
+ else:
+ record.lease_form = 'whole'
+
+
def put_assessment_approval(self):
property_evaluation_ids = self.env["property.evaluation.plan"].browse(
self._context.get('active_ids', self._context.get('active_id')))
@@ -50,6 +63,20 @@ class PropertyEvaluationPlan(models.Model):
"type": "ir.actions.act_window",
"view_mode": "tree",
"res_model": "yuthon.property",
+ 'tree_view_ref': 'yuthon_property.view_property_evaluation_plan_tree1',
"domain": domain,
"target": "new",
- }
\ No newline at end of file
+ }
+
+ def update_message(self):
+ property_evaluation_ids = self.env["property.evaluation.plan"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for record in property_evaluation_ids:
+ property_id = self.sudo().env['yuthon.property'].search([('name', 'in', record.name)])
+ if property_id:
+ record.write({
+ 'owner_id': property_id.owner_id,
+ 'lease_period': property_id.lease_period,
+ 'registered_id': property_id.registered_id,
+ })
+
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 8a52cf51f..d23f75d2a 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -81,11 +81,18 @@ class YuthonProperty(models.Model):
produce_ids = fields.One2many('yuthon.property.production', 'yuthon_property_id', string='关联安全生产明细行')
property_merge_approval_id = fields.Many2one('yuthon.property', string='关联物业信息')
reference_ids = fields.One2many('yuthon.reference.conditions', 'yuthon_property_id', string='关联出租参考条件明细行')
-
first_letter = fields.Char(string="首字母", compute='_compute_first_letter', store=True)
-
+ owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
vacant_duration = fields.Float(string="空置时长", digits=(16, 2))
+ lease_period = fields.Integer(string='租赁期限(<=)')
+ @api.onchange('reference_ids')
+ def _onchange_reference_ids(self):
+ for record in self:
+ if record.reference_ids:
+ record.lease_period = record.reference_ids[-1].lease_period
+ else:
+ record.lease_period = 0.0
@api.depends('name')
def _compute_first_letter(self):
@@ -107,6 +114,7 @@ class YuthonProperty(models.Model):
if rec.title_information_ids:
latest_title_information = sorted(rec.title_information_ids, key=lambda x: x.start_time, reverse=True)[0]
rec.write({
+ 'owner_id': latest_title_information.owner_id,
'title_deed': latest_title_information.title_certificate,
'registered_id': latest_title_information.registered_id,
'equity_area': latest_title_information.equity_area,
@@ -274,10 +282,9 @@ class YuthonProperty(models.Model):
'name': record.name,
'property_ids': [(6, 0, [record.id])],
'evaluation_area': record.rent_area,
- 'owner_id': record.title_information_ids[-1].owner_id.id if record.title_information_ids else None,
- 'registered_id': record.title_information_ids[-1].registered_id.id if record.title_information_ids else None,
- 'rent_id': record.reference_ids[-1].rent_id.id if record.reference_ids else None,
- 'lease_period': record.reference_ids[-1].lease_period if record.reference_ids else None,
+ 'owner_id': record.owner_id.id if record.owner_id else None,
+ 'registered_id': record.registered_id.id if record.registered_id else None,
+ 'lease_period': record.lease_period if record.lease_period else None,
'annual_increase_percentage': record.reference_ids[-1].annual_increase_percentage if record.reference_ids else None,
'assessment_category': 'rent_money',
'remake': record.remark,
@@ -294,16 +301,15 @@ class YuthonProperty(models.Model):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for record in property_ids:
- if record.state == 'ing':
+ if record.property_state == 'ing':
raise UserError(f'{record.name}该物业已在评估,请勿重复提交')
self.env['property.evaluation.plan'].create({
'name': record.name,
'property_ids': [(6, 0, [record.id])],
'evaluation_area': record.rent_area,
- 'owner_id': record.title_information_ids[-1].owner_id.id if record.title_information_ids else None,
- 'registered_id': record.title_information_ids[-1].registered_id.id if record.title_information_ids else None,
- 'rent_id': record.reference_ids[-1].rent_id.id if record.reference_ids else None,
- 'lease_period': record.reference_ids[-1].lease_period if record.reference_ids else None,
+ 'owner_id': record.owner_id.id if record.owner_id else None,
+ 'registered_id': record.registered_id.id if record.registered_id else None,
+ 'lease_period': record.lease_period if record.lease_period else None,
'annual_increase_percentage': record.reference_ids[-1].annual_increase_percentage if record.reference_ids else None,
'assessment_category': 'rent_money',
'remake': record.remark,
@@ -372,12 +378,14 @@ class YuthonProperty(models.Model):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for record in property_ids:
- precinct_id = self.env["yuthon.precinct.message"].search([('employee_id.name', '=', record.admin_id.name)])
+ precinct_id = self.env["yuthon.precinct.message"].search([('employee_id.name', '=', record.owner_id .name)])
company_id = record.manage_information_ids[-1].company_id.id if record.manage_information_ids else ''
+ lease_period = record.reference_ids[-1].lease_period if record.reference_ids else ''
title_deed = record.title_information_ids[-1].title_certificate if record.title_information_ids else ''
registered_id = record.title_information_ids[-1].registered_id if record.title_information_ids else ''
record.registered_id = registered_id
record.company_id = company_id
+ record.lease_period = lease_period
record.title_deed = title_deed
record.precinct_id = precinct_id.id if precinct_id else ''
if record.manage_information_ids:
@@ -452,12 +460,12 @@ class TitleInformationLine(models.Model):
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
property_message_id = fields.Many2one('yuthon.property.message', string='产权地址')
- owner_id = fields.Many2one(related='property_message_id.owner_id', string="权属人")
- equity_area = fields.Float(related='property_message_id.equity_area', string="产权面积", digits=(16, 4))
- registered_id = fields.Many2one(related='property_message_id.registered_id', string='证载用途')
- property_use_time = fields.Selection(related='property_message_id.property_use_time', string="产权年限")
- life_timer = fields.Date(related='property_message_id.life_timer', string="使用时间")
- title_certificate = fields.Char(related='property_message_id.title_certificate', string="产权证号")
+ owner_id = fields.Many2one(related='property_message_id.owner_id', string="权属人", store=True)
+ equity_area = fields.Float(related='property_message_id.equity_area', string="产权面积", digits=(16, 4), store=True)
+ registered_id = fields.Many2one(related='property_message_id.registered_id', string='证载用途', store=True)
+ property_use_time = fields.Selection(related='property_message_id.property_use_time', string="产权年限", store=True)
+ life_timer = fields.Date(related='property_message_id.life_timer', string="使用时间", store=True)
+ title_certificate = fields.Char(related='property_message_id.title_certificate', string="产权证号", store=True)
start_time = fields.Date(string="生效日期", default=fields.Date.today)
end_date = fields.Date(string="失效日期")
@@ -530,7 +538,9 @@ class YuthonReferenceConditions(models.Model):
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
lease_period = fields.Integer(string='租赁期限(<=)')
rent_period = fields.Integer(string="免租期(<=)")
- annual_increase_percentage = fields.Float(string='每年递增(%)', igits=(6, 2))
+ first_years_begin = fields.Integer(string='第几年开始')
+ increments_few_years = fields.Integer(string='每几年递增')
+ annual_increase_percentage = fields.Float(string='递增百分比', igits=(6, 2))
class YuthonMajorEventLine(models.Model):
_name = 'yuthon.major.event.line'
diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml
index 201b889c6..8adf9b570 100644
--- a/yuthon_property/views/property_accounts_receivable_views.xml
+++ b/yuthon_property/views/property_accounts_receivable_views.xml
@@ -36,7 +36,7 @@
-
+
批量导入合同
diff --git a/yuthon_property/views/property_evaluation_plan_view.xml b/yuthon_property/views/property_evaluation_plan_view.xml
index f4e10ff0b..8375aff36 100644
--- a/yuthon_property/views/property_evaluation_plan_view.xml
+++ b/yuthon_property/views/property_evaluation_plan_view.xml
@@ -17,9 +17,12 @@
+
+
+
@@ -39,4 +42,27 @@
property.evaluation.plan
tree,search
+
+ 更新信息
+
+
+ code
+ action = model.update_message()
+
+
+ property.evaluation.plan.tree1
+ yuthon.property
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index fb292d30b..2f7a26eed 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -13,10 +13,11 @@
-
+
+
@@ -201,6 +202,8 @@
+
+
diff --git a/yuthon_property_approval/wizard/click_reconciliation_wizard.py b/yuthon_property_approval/wizard/click_reconciliation_wizard.py
index fdad42325..7d3afefcf 100644
--- a/yuthon_property_approval/wizard/click_reconciliation_wizard.py
+++ b/yuthon_property_approval/wizard/click_reconciliation_wizard.py
@@ -23,29 +23,29 @@ class ClickReconciliationWizard(models.Model):
# 检查所有明细行的rent_month和rent是否相等
all_lines_match = True
+ amount_been_reconciled = 0.0
for val in all_vals:
if isinstance(val, tuple) and len(val) == 3 and isinstance(val[2], dict):
line_data = val[2]
+ # 检查金额是否匹配
if line_data.get('rent_month') != line_data.get('rent'):
all_lines_match = False
- break
+ # 累加已对账金额
+ amount_been_reconciled += line_data.get('amount', 0.0)
+ amount_reconciled = max(record.original_amount - amount_been_reconciled, 0.0)
# 更新对账状态(总金额相等且所有行金额匹配)
if total_rent_month == record.original_amount and all_lines_match:
record.bank_state = 'reconciled'
# 查找对应的银行行记录
bank_lines = self.env['property.bank.line'].search([
- ('bank', '=', record.bank_id.name)
+ ('bank', '=', record.name)
])
if bank_lines:
- # 更新银行账户相关信息
- if record.actual_total > record.receivable_total:
- record.bank_id.registered = record.actual_total - record.receivable_total
- record.bank_id.bank_state = 'reconciled'
- record.bank_id.yes_amount = record.amount_been_reconciled
- record.bank_id.no_amount = record.amount_reconciled
-
+ record.bank_state = 'reconciled'
+ record.yes_amount = amount_been_reconciled
+ record.no_amount = amount_reconciled
first_line = bank_lines[0]
# 直接使用all_vals中的数据更新应收账款
@@ -79,7 +79,7 @@ class ClickReconciliationWizard(models.Model):
receivable.write({
'is_reconciliation': True,
'delivered1': amount,
- 'payout_date': record.bank_id.start_time.date(),
+ 'payout_date': record.start_time.date(),
'remark': line_data.get('remark', ''), # 使用line_data中的备注
- 'receivable_log': f'当前登录人{record.env.user.name}于{fields.Datetime.now()}对户名为{record.bank_id.name_account}进行对账操作,对账应收金额为{record.receivable_total},实际金额为{record.actual_total}'
+ 'receivable_log': f'当前登录人{record.env.user.name}于{fields.Datetime.now()}对户名为{record.name_account}进行对账操作,对账应收金额为{record.receivable_total},实际金额为{record.original_amount}'
})
\ No newline at end of file
diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py
index 7af73a8cd..17e996059 100644
--- a/yuthon_property_approval/wizard/property_rental_wizard.py
+++ b/yuthon_property_approval/wizard/property_rental_wizard.py
@@ -158,6 +158,7 @@ class PropertyRentalWizard(models.Model):
rent = self.env['property.rent.list'].search([
('due_date', '>=', first_day),
('due_date', '<=', last_day),
+ ('is_push', '=', True)
])
if rent:
raise UserError('该月已租金已推送,不能生成重复数据')