审批流 完善判断隐藏显示条件
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
<template id="soong_workflow_log">
|
||||
<field name="log_ids" invisible="not log_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree create="false" edit="false" delete="false" editable="bottom">
|
||||
<tree create="false" edit="true" delete="false" editable="bottom">
|
||||
<field name="name"/>
|
||||
<!-- <field name="node_btn_id" />-->
|
||||
<field name="done_by" />
|
||||
|
||||
@@ -146,27 +146,36 @@ class PropertyLeaseContract(models.Model):
|
||||
if first_years_begin and first_index > first_years_begin:
|
||||
increments_start = segment_year[0]
|
||||
break
|
||||
all_period_rent += period_rent * 12 * first_years_begin
|
||||
delta = relativedelta(increments_start, start_date)
|
||||
months = delta.years * 12 + delta.months
|
||||
all_period_rent += period_rent * months
|
||||
|
||||
# 开始递增
|
||||
divided_increments_segments = self.divide_time_range_fixed(increments_start, end_date, increments_every_few_years * 12)
|
||||
index = 0 # 第几递增周期年
|
||||
for increments_year in divided_increments_segments:
|
||||
index += 1
|
||||
"""
|
||||
increment_percentage = fields.Float(string="递增百分比")
|
||||
increment_price = fields.Float(string="递增单价")
|
||||
increment_amount = fields.Float(string="递增金额")
|
||||
"""
|
||||
if record.increment_price:
|
||||
unit_price = unit_price + record.increment_price
|
||||
if record.increment_percentage:
|
||||
period_rent = record.total_area * unit_price * record.increment_percentage
|
||||
unit_price = period_rent / record.total_area
|
||||
if record.increment_amount:
|
||||
period_rent = period_rent + record.increment_amount
|
||||
unit_price = period_rent / record.total_area
|
||||
all_period_rent += period_rent * 12 * increments_every_few_years
|
||||
if not increments_every_few_years:
|
||||
delta = relativedelta(end_date, increments_start)
|
||||
months = delta.years * 12 + delta.months
|
||||
all_period_rent += period_rent * months
|
||||
else:
|
||||
# 开始递增
|
||||
divided_increments_segments = self.divide_time_range_fixed(increments_start, end_date, increments_every_few_years * 12)
|
||||
index = 0 # 第几递增周期年
|
||||
for increments_year in divided_increments_segments:
|
||||
index += 1
|
||||
"""
|
||||
increment_percentage = fields.Float(string="递增百分比")
|
||||
increment_price = fields.Float(string="递增单价")
|
||||
increment_amount = fields.Float(string="递增金额")
|
||||
"""
|
||||
delta = relativedelta(increments_year[1], increments_year[0])
|
||||
months = delta.years * 12 + delta.months
|
||||
if record.increment_price:
|
||||
unit_price = unit_price + record.increment_price
|
||||
if record.increment_percentage:
|
||||
period_rent = record.total_area * unit_price * record.increment_percentage
|
||||
unit_price = period_rent / record.total_area
|
||||
if record.increment_amount:
|
||||
period_rent = period_rent + record.increment_amount
|
||||
unit_price = period_rent / record.total_area
|
||||
all_period_rent += period_rent * months
|
||||
|
||||
self.sudo().env["property.rent.list"].create({
|
||||
"contract_id": record.id,
|
||||
@@ -226,49 +235,68 @@ class PropertyLeaseContract(models.Model):
|
||||
first_index = 0 # 第几递增周期年
|
||||
increments_start = start_date # 递增开始
|
||||
# 第几年不递增
|
||||
if first_years_begin:
|
||||
divided_year_segments = self.divide_time_range_fixed(start_date, end_date, 12)
|
||||
for segment_year in divided_year_segments:
|
||||
first_index += 1
|
||||
if first_years_begin and first_index > first_years_begin:
|
||||
increments_start = segment_year[0]
|
||||
break
|
||||
if not increments_every_few_years:
|
||||
delta = relativedelta(end_date, increments_start)
|
||||
months = delta.years * 12 + delta.months
|
||||
self.sudo().env["property.rent.breakdown.line"].create({
|
||||
"unit_price": unit_price,
|
||||
"monthly_amount": period_rent,
|
||||
"breakdown_id": record.id,
|
||||
"start_data": start_date,
|
||||
"end_data": increments_start,
|
||||
"month_number": 12 * first_years_begin,
|
||||
"period_rent": period_rent * 12 * first_years_begin,
|
||||
})
|
||||
# 开始递增
|
||||
divided_increments_segments = self.divide_time_range_fixed(increments_start, end_date, increments_every_few_years*12)
|
||||
index = 0 # 第几递增周期年
|
||||
for increments_year in divided_increments_segments:
|
||||
index += 1
|
||||
"""
|
||||
increment_percentage = fields.Float(string="递增百分比")
|
||||
increment_price = fields.Float(string="递增单价")
|
||||
increment_amount = fields.Float(string="递增金额")
|
||||
"""
|
||||
if record.increment_price:
|
||||
unit_price = unit_price + record.increment_price
|
||||
if record.increment_percentage:
|
||||
period_rent = record.total_area * unit_price * record.increment_percentage
|
||||
unit_price = period_rent / record.total_area
|
||||
if record.increment_amount:
|
||||
period_rent = period_rent + record.increment_amount
|
||||
unit_price = period_rent / record.total_area
|
||||
self.sudo().env["property.rent.breakdown.line"].create({
|
||||
"unit_price": unit_price,
|
||||
"monthly_amount": period_rent,
|
||||
"breakdown_id": record.id,
|
||||
"start_data": increments_year[0],
|
||||
"end_data": increments_year[1],
|
||||
"month_number": 12 * increments_every_few_years,
|
||||
"period_rent": period_rent * 12 * increments_every_few_years,
|
||||
"start_data": increments_start,
|
||||
"end_data": end_date,
|
||||
"month_number": months,
|
||||
"period_rent": period_rent * months,
|
||||
})
|
||||
else:
|
||||
if first_years_begin:
|
||||
divided_year_segments = self.divide_time_range_fixed(start_date, end_date, 12)
|
||||
for segment_year in divided_year_segments:
|
||||
first_index += 1
|
||||
if first_years_begin and first_index > first_years_begin:
|
||||
increments_start = segment_year[0]
|
||||
break
|
||||
delta = relativedelta(increments_start, start_date)
|
||||
months = delta.years * 12 + delta.months
|
||||
self.sudo().env["property.rent.breakdown.line"].create({
|
||||
"unit_price": unit_price,
|
||||
"monthly_amount": period_rent,
|
||||
"breakdown_id": record.id,
|
||||
"start_data": start_date,
|
||||
"end_data": increments_start,
|
||||
"month_number": months,
|
||||
"period_rent": period_rent * months,
|
||||
})
|
||||
|
||||
# 开始递增
|
||||
divided_increments_segments = self.divide_time_range_fixed(increments_start, end_date, increments_every_few_years*12)
|
||||
index = 0 # 第几递增周期年
|
||||
for increments_year in divided_increments_segments:
|
||||
index += 1
|
||||
"""
|
||||
increment_percentage = fields.Float(string="递增百分比")
|
||||
increment_price = fields.Float(string="递增单价")
|
||||
increment_amount = fields.Float(string="递增金额")
|
||||
"""
|
||||
if record.increment_price:
|
||||
unit_price = unit_price + record.increment_price
|
||||
if record.increment_percentage:
|
||||
period_rent = record.total_area * unit_price * record.increment_percentage
|
||||
unit_price = period_rent / record.total_area
|
||||
if record.increment_amount:
|
||||
period_rent = period_rent + record.increment_amount
|
||||
unit_price = period_rent / record.total_area
|
||||
|
||||
delta = relativedelta(increments_year[1], increments_year[0])
|
||||
months = delta.years * 12 + delta.months
|
||||
self.sudo().env["property.rent.breakdown.line"].create({
|
||||
"unit_price": unit_price,
|
||||
"monthly_amount": period_rent,
|
||||
"breakdown_id": record.id,
|
||||
"start_data": increments_year[0],
|
||||
"end_data": increments_year[1],
|
||||
"month_number": months,
|
||||
"period_rent": period_rent * months,
|
||||
})
|
||||
|
||||
class PropertyLeaseContractLine(models.Model):
|
||||
_name = 'property.lease.contract.line'
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="物业合同管理">
|
||||
<header>
|
||||
<button name="action_generate_rental_charges" class="oe_link" type="object" string="生成租金费用"/>
|
||||
<button name="action_generate_administrative_expenses" class="oe_link" type="object" string="生成管理费用"/>
|
||||
<button name="action_generate_rental_charges" class="oe_link btn btn-primary" type="object" string="生成租金费用"/>
|
||||
<button name="action_generate_administrative_expenses" class="oe_link btn btn-primary" type="object" string="生成管理费用"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group string="基本信息">
|
||||
@@ -113,7 +113,7 @@
|
||||
</field>
|
||||
</page>
|
||||
<page string="租金明细">
|
||||
<button name="action_generate_details" class="oe_link" type="object" string="生成明细"/>
|
||||
<button name="action_generate_details" class="oe_link btn btn-primary" type="object" string="生成明细"/>
|
||||
<field name="breakdown_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="breakdown_id" colunm_invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user