diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 1832d6df9..837be1226 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -921,8 +921,13 @@ class AppletAttendance(Controller): last_day_str = last_day.strftime('%Y-%m-%d') floor_name = request.env['yuthon.epitope.values'].sudo().search([('id', '=', floor_id)]).name - domain = [('state', '=', reading_state), - ('epitope_values_id.name', '=', floor_name), + # domain = [('state', '=', reading_state), + # ('epitope_values_id.name', '=', floor_name), + # ('meter_date', '>=', first_day_str), + # ('meter_date', '<=', last_day_str)] + + # 去掉 state + domain = [('epitope_values_id.name', '=', floor_name), ('meter_date', '>=', first_day_str), ('meter_date', '<=', last_day_str)] diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 7142d554d..972a01ecf 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -468,8 +468,7 @@ class PropertyBankStatements(models.Model): "dialog_size": "extra-large", "default_order": "due_date desc", } - # 未知逻辑忘记可能要补充,只能依次对账 - # self._check_unreconciled_statements(start_time) + self._check_unreconciled_statements(start_time) return { "type": "ir.actions.act_window", @@ -481,33 +480,32 @@ class PropertyBankStatements(models.Model): "context": context, } - # def _check_unreconciled_statements(self, current_transaction_time): - # """ - # 检查所有承租方对应的银行账号在property.bank.statements中是否有未对账流水 - # :param current_transaction_time: 当前交易时间(带时区处理后) - # """ - # if not self.lessee_ids: - # return - # bank_accounts = self.env['property.bank.line'].search([ - # ('tenant_id', 'in', self.lessee_ids.ids) - # ]).mapped('bank') - # bank_accounts = [acc for acc in bank_accounts if acc] # 过滤空值 - # if not bank_accounts: - # return - # unreconciled = {} - # for account in bank_accounts: - # # 查询条件:同账号 + 交易时间早于当前 + 未对账 - # statements = self.env['property.bank.statements'].search([ - # ('name', '=', account), - # ('start_time', '<', current_transaction_time), - # ('bank_state', '=', 'not_reconciled'), - # ('id', '!=', self.id), - # ]) - # if statements: - # unreconciled[account] = len(statements) - # - # if unreconciled: - # raise UserError("存在未对账的历史流水,请优先处理") + def _check_unreconciled_statements(self, current_transaction_time): + """ + 检查所有承租方对应的银行账号在property.bank.statements中是否有未对账流水 + :param current_transaction_time: 当前交易时间(带时区处理后) + """ + if not self.lessee_ids: + return + bank_accounts = self.env['property.bank.line'].search([ + ('tenant_id', 'in', self.lessee_ids.ids) + ]).mapped('bank') + bank_accounts = [acc for acc in bank_accounts if acc] # 过滤空值 + if not bank_accounts: + return + unreconciled = {} + for account in bank_accounts: + # 查询条件:同账号 + 交易时间早于当前 + 未对账 + statements = self.env['property.bank.statements'].search([ + ('name', '=', account), + ('start_time', '<', current_transaction_time), + ('bank_state', '=', 'not_reconciled'), + ('id', '!=', self.id), + ]) + if statements: + unreconciled[account] = len(statements) + if unreconciled: + raise UserError("存在未对账的历史流水,请优先处理:") def button_reconciliation(self): for record in self: diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 9c4b50bfb..649639cca 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -304,7 +304,7 @@ class PropertyLeaseContract(models.Model): name_title = fields.Char(default=_get_default_name_title) - contract_sort = fields.Selection([('property', '物业'), ('guanggao', '广告位'), ('guanzi', '管子间'), ('room', '机房'), ('base_station','基站'), ('other', '其他')], string="资产类型", default='property') + contract_sort = fields.Selection([('property', '物业'), ('guanggao', '广告位'),('parking', '停车场'), ('guanzi', '管子间'), ('room', '机房'), ('base_station','基站'), ('other', '其他')], string="资产类型", default='property') @api.depends('lease_ids.address_id.title_deed') def _compute_title_information(self): diff --git a/yuthon_property_approval/wizard/binding_information_wizard_views.xml b/yuthon_property_approval/wizard/binding_information_wizard_views.xml index 4b4461a27..5acb3f508 100644 --- a/yuthon_property_approval/wizard/binding_information_wizard_views.xml +++ b/yuthon_property_approval/wizard/binding_information_wizard_views.xml @@ -10,8 +10,8 @@ - - + +