添加功能
This commit is contained in:
@@ -16,6 +16,7 @@ class PropertyManagementList(models.Model):
|
||||
area = fields.Float(string='面积')
|
||||
remarks = fields.Text(string='备注')
|
||||
is_push = fields.Boolean(string='是否推送')
|
||||
type = fields.Selection([('management', '物业管理费') , ('guanzijian', '管子间管理费'), ('lightbox', '灯箱管理费')], string='类型')
|
||||
|
||||
@api.depends('property_ids')
|
||||
def _compute_admin_id(self):
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<field name="original_amount" readonly="1"/>
|
||||
<field name="due_date" readonly="1"/>
|
||||
<field name="message_standard_id" readonly="1"/>
|
||||
<field name="type" readonly="1"/>
|
||||
<field name="remarks" readonly="1"/>
|
||||
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
|
||||
</tree>
|
||||
|
||||
@@ -509,7 +509,7 @@ class PropertyBankStatements(models.Model):
|
||||
# 查询条件:同账号 + 交易时间早于当前 + 未对账
|
||||
statements = self.env['property.bank.statements'].search([
|
||||
('name', '=', account),
|
||||
('start_time', '<', current_transaction_time),
|
||||
('start_time', '<', current_transaction_time - timedelta(hours=8)),
|
||||
('bank_state', '=', 'not_reconciled'),
|
||||
('id', '!=', self.id),
|
||||
])
|
||||
@@ -903,8 +903,14 @@ class PropertyAccountsReceivable(models.Model):
|
||||
('meter_date', '<=', last_day)
|
||||
])
|
||||
else:
|
||||
year = rec.due_date.year
|
||||
month = rec.due_date.month
|
||||
first_day = date(year, month, 1)
|
||||
last_day = first_day - timedelta(days=1)
|
||||
model_id = self.env[model_type].search([
|
||||
('contract_id', '=', rec.contract_id.id)
|
||||
('contract_id', '=', rec.contract_id.id),
|
||||
('due_date', '>=', first_day),
|
||||
('due_date', '<=', last_day)
|
||||
])
|
||||
|
||||
if model_id:
|
||||
|
||||
@@ -129,6 +129,12 @@ class PropertyRentalWizard(models.Model):
|
||||
break
|
||||
|
||||
is_special_contract = record.contract_sort in ['guanggao', 'guanzi', 'room']
|
||||
if record.contract_sort == 'guanggao':
|
||||
type = 'lightbox'
|
||||
elif record.contract_sort == 'guanzi':
|
||||
type = 'guanzijian'
|
||||
else:
|
||||
type = 'management'
|
||||
if (not is_special_contract and has_valid_property) or is_special_contract:
|
||||
area_value = sum(
|
||||
lease_id.property_area or 0.0
|
||||
@@ -139,6 +145,7 @@ class PropertyRentalWizard(models.Model):
|
||||
self.sudo().env["property.management.list"].create({
|
||||
"contract_id": record.id,
|
||||
"area":area_value,
|
||||
"type": type,
|
||||
'property_ids': [(6, 0, [lease_id.address_id.id for lease_id in record.lease_ids if lease_id.address_id])],
|
||||
'original_amount':total_original_amount,
|
||||
'message_standard_id': record.lease_ids[0].message_standard_id.id,
|
||||
@@ -149,6 +156,7 @@ class PropertyRentalWizard(models.Model):
|
||||
management_id.write({
|
||||
"contract_id": record.id,
|
||||
"area": area_value,
|
||||
"type": type,
|
||||
'property_ids': [(6, 0, [lease_id.address_id.id for lease_id in record.lease_ids if lease_id.address_id])],
|
||||
'original_amount': total_original_amount,
|
||||
'message_standard_id': record.lease_ids[0].message_standard_id.id,
|
||||
|
||||
Reference in New Issue
Block a user