添加功能

This commit is contained in:
李鹏宇
2025-10-17 15:20:26 +08:00
parent 17400a588f
commit b69dda7862
4 changed files with 16 additions and 1 deletions
@@ -39,6 +39,7 @@ class PropertyAccountsReceivable(models.Model):
management_type_id = fields.Many2one('yuthon.management.type', string='应收类型')
last_update_time = fields.Datetime(string='最后修改时间')
is_write = fields.Boolean(string='是否修改')
acc_type = fields.Selection([('new', '新租'), ('done', '到期')], string='类型')
bank_id = fields.Many2one('property.bank.statements', string='流水记录')
receivable_log = fields.Text(string='应收日志')
@@ -4,6 +4,7 @@
<field name="model">property.accounts.receivable</field>
<field name="arch" type="xml">
<tree editable="bottom" string="应收账单" decoration-success="is_reconciliation == True" limit="15">
<field name="acc_type" string=" "/>
<field name="due_date" readonly="1" width="300px"/>
<field name="due_date_end" readonly="1"/>
<field name="payout_date" readonly="1"/>
@@ -879,6 +879,17 @@ class PropertyRentList(models.Model):
due_date_end = False
theoretical_end = False
contract = rec.contract_id
existing_receivable = self.env['property.accounts.receivable'].search([
('lessee_id', '=', rec.lessee_id.id),
('management_type_id.name', '=', '租金'),
('contract_id', '=', contract),
], limit=1)
if not existing_receivable:
acc_type = 'new'
else:
acc_type = None
if contract and contract.cycle_mode and due_date:
due_date_obj = fields.Date.from_string(due_date)
contract_actual_end = fields.Date.from_string(
@@ -916,6 +927,7 @@ class PropertyRentList(models.Model):
'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None,
'original_amount': rec.original_amount,
'due_date': due_date,
'acc_type': acc_type,
'due_date_end': due_date_end,
'create_time': datetime.now(),
'management_type_id': management_type.id,
@@ -163,7 +163,8 @@ class PropertyRentalWizard(models.Model):
# 当期应收日期
if not record.is_contract:
if start_year_month <= date_field_year_month <= end_year_month:
self.create_rent_list(record, rent_id, rent_amount, start_date, multiplier)
if rent_id.period_rent != 0:
self.create_rent_list(record, rent_id, rent_amount, start_date, multiplier)
self.create_management_list(record, start_date, rent_amount)
def get_multiplier(self, cycle_dict):