@@ -69,6 +69,7 @@
|
||||
<button class="oe_stat_button" name="update_attendance_month" string="更新考勤明细" type="object"
|
||||
icon="fa-bars"/>
|
||||
</header>
|
||||
<button name="button_put" string="发送" type="object" class="oe_highlight"/>
|
||||
<field name="employee_id" widget="ztree_select"/>
|
||||
<field name="department_id" optional="show" widget="ztree_select"/>
|
||||
<field name="current_year"/>
|
||||
@@ -105,7 +106,6 @@
|
||||
<field name="state" widget="badge" decoration-info="state == 'unconfirmed'"
|
||||
decoration-success="state == 'confirmed'"/>
|
||||
<field name="company_id" optional="show"/>
|
||||
<button name="button_put" string="发送" type="object" class="oe_highlight"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -8,6 +8,7 @@ class PropertyAccountsReceivable(models.Model):
|
||||
_description = '应收账单'
|
||||
|
||||
property_id = fields.Many2one('yuthon.property', string='物业')
|
||||
management_area = fields.Float(related='property_id.management_area', string='面积')
|
||||
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
|
||||
admin_id = fields.Many2one(related='property_id.admin_id', string="片区管理员")
|
||||
company_id = fields.Many2one(related='property_id.company_id', string="公司")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<field name="name">property.accounts.receivable.tree</field>
|
||||
<field name="model">property.accounts.receivable</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="应收列表" decoration-danger = "charge_status == 'unpaid'"
|
||||
<tree editable="bottom" string="应收账单" decoration-danger = "charge_status == 'unpaid'"
|
||||
decoration-muted="is_reconciliation == True"
|
||||
decoration-success="charge_status == 'fully_paid'" limit="20">
|
||||
<header>
|
||||
|
||||
@@ -280,15 +280,7 @@
|
||||
<field name="company_id" enable_counters="1" />
|
||||
<field name="tenure_type" enable_counters="1" string="权属类型"/>
|
||||
<field name="precinct_id" string="所属片区" enable_counters="1"/>
|
||||
<field name="property_floor_id"/>
|
||||
</searchpanel>
|
||||
<header_search>
|
||||
<quick_filter string="评估状态">
|
||||
<filter string="待评估" name="property_state_to" domain="[('property_state', '=', 'to')]"/>
|
||||
<filter string="评估中" name="property_state_ing" domain="[('property_state', '=', 'ing')]"/>
|
||||
<filter string="已评估" name="property_state_done" domain="[('property_state', '=', 'done')]"/>
|
||||
</quick_filter>
|
||||
</header_search>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -414,7 +414,7 @@ class PropertyDepositList(models.Model):
|
||||
'contract_id': rec.contract_id.id,
|
||||
'property_id': rec.property_id.id,
|
||||
'lessee_id': rec.contract_id.lessee_id.id if rec.contract_id.lessee_id else None,
|
||||
'original_amount': rec.aggregate,
|
||||
'original_amount': rec.original_amount,
|
||||
'create_time': datetime.now(),
|
||||
'management_type_id': management_type_id.id,
|
||||
})
|
||||
|
||||
@@ -386,13 +386,14 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="property_accounts_receivable_action" model="ir.actions.act_window">
|
||||
<field name="name">应收列表</field>
|
||||
<field name="name">应收账单</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="context">{'group_by': 'contract_id'}</field>
|
||||
<field name="view_id" ref="yuthon_property_approval.view_property_accounts_receivable_tree"/>
|
||||
</record>
|
||||
<!-- 合同应收报表 -->
|
||||
<record id="view_property_accounts_receivable_tree" model="ir.ui.view">
|
||||
<record id="view_property_accounts_receivable_report_tree" model="ir.ui.view">
|
||||
<field name="name">property.accounts.receivable.tree.form</field>
|
||||
<field name="model">property.accounts.receivable</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -410,6 +411,7 @@
|
||||
<field name="name">合同应收报表</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
<field name="view_id" ref="yuthon_property_approval.view_property_accounts_receivable_report_tree"/>
|
||||
</record>
|
||||
<!-- 违约金明细报表 -->
|
||||
<record id="view_property_penalty_line_report" model="ir.ui.view">
|
||||
@@ -438,6 +440,7 @@
|
||||
<field name="name">违约金明细报表</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="yuthon_property_approval.view_property_penalty_line_report"/>
|
||||
</record>
|
||||
<!--本月实收报表-->
|
||||
<record id="view_property_received_month_report" model="ir.ui.view">
|
||||
@@ -458,6 +461,7 @@
|
||||
<field name="name">本月实收报表</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="yuthon_property_approval.view_property_received_month_report"/>
|
||||
</record>
|
||||
<!--累计欠收 -->
|
||||
<record id="view_property_accumulated_underpayment_report" model="ir.ui.view">
|
||||
@@ -465,7 +469,14 @@
|
||||
<field name="model">property.accounts.receivable</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="累计欠收">
|
||||
<field name="rent_owed"/>
|
||||
<field name="contract_id" string="合同编号"/>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="management_area"/>
|
||||
<field name="delivered1"/>
|
||||
<field name="submitted"/>
|
||||
<field name="due_date"/>
|
||||
<field name="company_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -473,6 +484,7 @@
|
||||
<field name="name">累计欠收报表</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="yuthon_property_approval.view_property_accumulated_underpayment_report"/>
|
||||
</record>
|
||||
<record id="all_button_accounts_receivable" model="ir.actions.server">
|
||||
<field name="name">批量生成违约金</field>
|
||||
|
||||
@@ -2,6 +2,8 @@ from odoo import models, fields, api, _, SUPERUSER_ID
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from datetime import datetime, time, timedelta
|
||||
import calendar
|
||||
|
||||
|
||||
class PropertyRentalWizard(models.Model):
|
||||
_name = 'property.rental.wizard'
|
||||
@@ -158,12 +160,17 @@ class PropertyRentalWizard(models.Model):
|
||||
|
||||
def confirm(self):
|
||||
"""主逻辑入口"""
|
||||
records = self.env['property.lease.contract'].search(
|
||||
[('cycle_dict', 'in', ['monthly', 'quarter', 'half', 'year'])])
|
||||
year, month = int(self.select_year), int(self.select_month)
|
||||
date_field = datetime(year, month, 1).date()
|
||||
date_field_year_month = date_field.strftime('%Y-%m')
|
||||
|
||||
# 获取当月第一天和最后一天
|
||||
first_day = datetime.strptime(date_field_year_month, '%Y-%m').date() # 当月第一天
|
||||
last_day = (first_day + relativedelta(months=1, days=-1)) # 当月最后一天
|
||||
records = self.env['property.lease.contract'].search([
|
||||
('cycle_dict', 'in', ['monthly', 'quarter', 'half', 'year']),
|
||||
('actual_start_time', '<=', last_day),
|
||||
('actual_end_time', '>=', first_day)
|
||||
])
|
||||
for record in records:
|
||||
date_data = {
|
||||
'five': 5,
|
||||
|
||||
@@ -364,6 +364,8 @@
|
||||
<field name="model">hr.payslip</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="我的薪资" create="false" delete="false" edit="false">
|
||||
<button name="payslip_wizard" string="发送" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
|
||||
<button name="open_archive_record" string="详情" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
|
||||
<field name="employee_id" optional="show"/>
|
||||
<field name="actual_salary" decoration-danger="1" decoration-bf="1" optional="show"/>
|
||||
<field name="total_before_tax" decoration-danger="1" decoration-bf="1" optional="show"/>
|
||||
@@ -374,8 +376,6 @@
|
||||
<field name="is_salary_release" column_invisible="1"/>
|
||||
<field name="is_salary_push" column_invisible="1"/>
|
||||
<field name="confirm_status"/>
|
||||
<button name="payslip_wizard" string="发送" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
|
||||
<button name="open_archive_record" string="详情" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user