!1759 添加功能

Merge pull request !1759 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-03-11 13:13:03 +00:00
committed by Gitee
44 changed files with 410 additions and 371 deletions
@@ -24,6 +24,7 @@ class HrJob(models.Model):
establishment_quotas = fields.Integer(string="编制定员")
job_personnel_ids = fields.Many2many('hr.employee', string='在岗人员')
recruitment_employees = fields.Integer(string="招聘人数")
email = fields.Char(string='邮箱')
job_personnel = fields.Text(string="在岗人员", compute='_compute_job_personnel')
remarks = fields.Text(string="备注")
is_recruitment_status = fields.Boolean(string="招聘状态")
@@ -63,9 +63,9 @@
<xpath expr="//field[@name='job_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='stage_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<!-- <xpath expr="//field[@name='stage_id']" position="attributes">-->
<!-- <attribute name="column_invisible">1</attribute>-->
<!-- </xpath>-->
<xpath expr="//field[@name='partner_mobile']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
@@ -135,9 +135,18 @@
<field name="is_enable"/>
<field name="job_personnel_ids" widget="many2many_tags"/>
</div>
<xpath expr="//field[@name='contract_type_id']" position="before">
<field name="email"/>
</xpath>
<xpath expr="//field[@name='contract_type_id']" position="after">
<field name="function"/>
</xpath>
<xpath expr="//field[@name='contract_type_id']" position="attributes">
<attribute name="string">合同类型</attribute>
</xpath>
<xpath expr="//field[@name='alias_name']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
@@ -150,6 +159,9 @@
<attribute name="name">action_create_new_job</attribute>
<attribute name="type">object</attribute>
</xpath>
<xpath expr="//a[@name='874']" position="attributes">
<attribute name="string">新建人员信息</attribute>
</xpath>
</field>
</record>
</odoo>
@@ -271,14 +271,6 @@
<field name="pinyin_min"/>
</xpath>
</field>
<!-- <xpath expr="//group[@string='Group By']" position="after">-->
<!-- <header_search>-->
<!-- <quick_filter string="分组">-->
<!-- <filter string="领导" name="manager" domain="[('salary_group_id.name', '=', '领导')]"/>-->
<!-- <filter string="员工" name="employee" domain="[('salary_group_id.name', '=', '员工')]"/>-->
<!-- </quick_filter>-->
<!-- </header_search>-->
<!-- </xpath>-->
</record>
<record id="all_data_write_user" model="ir.actions.server">
<field name="name">批量更新员工</field>
@@ -45,12 +45,6 @@ class YuthonInterviewApproval(models.Model):
}
}
def put_interview_stage(self):
for rec in self.applicant_ids:
employee_id = self.env['hr.applicant'].search([('partner_name', '=',rec.name)])
employee_id.write({
'stage_id': rec.interview_stage_id.id})
def put_interview_wizard(self):
self.ensure_one()
application_list = []
@@ -59,13 +53,14 @@ class YuthonInterviewApproval(models.Model):
'applicant_time': applicant.interview_time,
'employee_ids': applicant.employee_ids.ids,
'stage_id': applicant.stage_id.id}))
return {
'name': '面试结果',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'interview.approval.wizard',
'target': 'new',
'context': {'default_interview_approval_line_ids': application_list, }
'context': {'default_interview_approval_line_ids': application_list}
}
@api.onchange('is_issues')
@@ -100,10 +95,13 @@ class InterviewApprovalLine(models.Model):
def button_applicant_ids(self):
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'res_model': 'hr.applicant',
'res_id': self.id,
'view_mode': 'form',
'target': 'current',
}
applicant = self.env['hr.applicant'].search([('name', '=', self.name)], limit=1)
if applicant:
return {
'type': 'ir.actions.act_window',
'res_model': 'hr.applicant',
'res_id': applicant.id,
'view_mode': 'form',
'target': 'current',
}
return None
@@ -65,7 +65,7 @@
<field name="interview_time" required="1"/>
<field name="tage_ids" widget="many2many_tags"/>
<field name="employee_ids" widget="many2many_tags"/>
<button name="button_applicant_ids" type="object" string="详细信息"/>
<button name="button_applicant_ids" type="object" string="详细信息" class="btn-primary"/>
</tree>
</field>
</page>
+1
View File
@@ -10,6 +10,7 @@
'data': [
'security/ir.model.access.csv',
'security/yuthon_property_group.xml',
'security/yuthon_accounts_group.xml',
'data/data_yuthon_resource_mgmt_config.xml',
'data/yuthon_property_approval_data.xml',
'views/yuthon_property_views.xml',
@@ -31,35 +31,9 @@ class PropertyBankStatements(models.Model):
remake = fields.Text('备注')
property_ids = fields.Many2many('yuthon.property', string='物业地址')
# def button_reconciliation(self):
# for rec in self:
# for property_id in rec.property_ids:
# receivable_ids = self.env['property.accounts.receivable'].search([('property_id', '=', property_id.id)])
# for receivable_id in receivable_ids:
# difference_amount = receivable_id.original_amount - rec.original_amount
# receivable_id.write({
# 'is_reconciliation': True,
# 'difference_amount': difference_amount
# })
def button_all_reconciliation(self):
statements_ids = self.env["property.bank.statements"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for statements_id in statements_ids:
for property_id in statements_id.property_ids:
receivable_ids = self.env['property.accounts.receivable'].search([('property_id', '=', property_id.id)])
for receivable_id in receivable_ids:
difference_amount = receivable_id.original_amount - statements_id.original_amount
receivable_id.write({
'is_reconciliation': True,
'difference_amount': difference_amount
})
def unlink(self):
return super().unlink()
@api.onchange('name')
def _onchange_name(self):
contract_ids = self.env['property.lease.contract']
@@ -78,6 +52,18 @@ class PropertyBankStatements(models.Model):
self.property_ids = [(6, 0, property_ids)]
self.contract_ids = [(6, 0, contract_ids.ids)] if contract_ids else []
@api.onchange('property_ids')
def _onchange_property_or_contract_ids(self):
bank_list = []
if self.name:
bank_id = self.env['property.bank.line'].search([('bank', '=', self.name)])
if not bank_id:
for property_id in self.property_ids:
lease_contract_id = self.env['property.lease.contract'].search([('name', '=', property_id.name)])
if lease_contract_id:
lessee_id = lease_contract_id.lessee_id
bank_list.append((0, 0, {'name': self.name_account, 'user': lessee_id.name, 'bank': self.name,}))
lessee_id.bank_ids = bank_list
@api.model
def create(self, vals):
record = super(PropertyBankStatements, self).create(vals)
@@ -102,10 +88,6 @@ class PropertyBankStatements(models.Model):
self.property_ids = [(6, 0, property_ids)]
self.contract_ids = [(6, 0, contract_ids.ids)] if contract_ids else []
def put_button(self):
for record in self:
record.is_put = True
def put_button_cancel(self):
for record in self:
record.is_put = False
record.is_put = False
@@ -338,6 +338,7 @@ class ManageInformationLine(models.Model):
management_area = fields.Float(string="管理面积", digits=(16, 4))
rent_area = fields.Float(string="可租面积", digits=(16, 4))
admin_id = fields.Many2one('res.users', string="管理员")
company_id = fields.Many2one('yuthon.property.company', string="所属公司")
start_time = fields.Date(string="生效日期", default=fields.Date.today)
end_date = fields.Date(string="失效日期")
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="module_category_yuthon_accounts" model="ir.module.category">
<field name="name">财务群组</field>
</record>
<record id="group_account_user" model="res.groups">
<field name="name">财务用户</field>
<field name="category_id" ref="module_category_yuthon_accounts"/>
</record>
<record id="group_account_admin" model="res.groups">
<field name="name">财务管理员</field>
<field name="category_id" ref="module_category_yuthon_accounts"/>
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
<record id="rule_property_accounts_receivable_read_only_for_account_user" model="ir.rule">
<field name="name">财务用户只读规则</field>
<field name="model_id" ref="model_property_accounts_receivable"/>
<field name="groups" eval="[(4, ref('group_account_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
<!-- <record id="inherit_property_company_views_rule" model="ir.rule">-->
<!-- <field name="name">物业公司过滤</field>-->
<!-- <field name="model_id" ref="model_yuthon_property"/>-->
<!--&lt;!&ndash; <field name="domain_force">[('company_id', '=', user.employee_id.yuthon_company)]</field>&ndash;&gt;-->
<!-- <field name="perm_read" eval="True"/>-->
<!-- <field name="perm_write" eval="True"/>-->
<!-- <field name="perm_create" eval="True"/>-->
<!-- <field name="perm_unlink" eval="True"/>-->
<!-- </record>-->
</odoo>
@@ -3,7 +3,7 @@
<t t-name="statements_module.ListView.Buttons" t-inherit="web.ListView.Buttons">
<xpath expr="//div[hasclass('o_list_buttons')]" position="after">
<button type="button" class="btn btn-primary" style="margin-left: 10px;" t-on-click="openAllStatementsWizard">
批量对账
一键对账
</button>
</xpath>
</t>
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5
View File
@@ -140,25 +140,30 @@
<menuitem id="yuthon_financial_management_menu"
sequence="17"
name="财务管理"
groups="group_account_user"
parent="yuthon_property_menu_root"/>
<menuitem id="yuthon_accounts_receivable_menu"
sequence="1"
name="应收账单"
groups="group_account_user"
parent="yuthon_financial_management_menu"
action="property_accounts_receivable_action"/>
<menuitem id="yuthon_subject_form_menu"
sequence="5"
name="预算科目表"
groups="group_account_user"
parent="yuthon_financial_management_menu"
action="view_property_subject_action"/>
<menuitem id="yuthon_bank_statement_menu"
sequence="20"
name="对账"
groups="group_account_user"
parent="yuthon_financial_management_menu"
action="view_property_bank_statements_action"/>
<menuitem id="yuthon_bank_statement_menu1"
sequence="23"
name="银行流水"
groups="group_account_user"
parent="yuthon_financial_management_menu"
action="view_property_bank_statements_action1"/>
<menuitem id="yuthon_security_inspection_menu"
@@ -74,10 +74,11 @@
<field name="model_id" ref="yuthon_property.model_property_accounts_receivable"/>
<field name="binding_model_id" ref="yuthon_property.model_property_accounts_receivable"/>
<field name="state">code</field>
<field name="code">action = model.download_template_with_data()</field>
<!-- <![CDATA[-->
<!-- action = env.ref('yuthon_property.template_downloads_invoicing_basic_action').read()[0]-->
<!-- ]]>-->
<field name="code">
<![CDATA[
action = env.ref('yuthon_property.template_downloads_invoicing_basic_action').read()[0]
]]>
</field>
</record>
<record id="template_downloads_invoicing_line_action" model="ir.actions.act_url">
<field name="name">发票明细信息模板下载</field>
@@ -26,7 +26,7 @@
<field name="number" optional="hide"/>
<field name="voucher_type" optional="hide"/>
<field name="is_reconciliation" column_invisible="1"/>
<button name="put_button" type="object" string="推送" class="btn btn-primary"/>
<button name="put_button_cancel" type="object" string="退回" class="btn btn-primary"/>
<button name="unlink" type="object" string="删除" class="btn btn-primary"/>
</tree>
</field>
@@ -57,7 +57,6 @@
<field name="number" optional="hide"/>
<field name="voucher_type" optional="hide"/>
<field name="is_reconciliation" column_invisible="1"/>
<button name="put_button_cancel" type="object" string="退回" class="btn btn-primary"/>
<button name="unlink" type="object" string="删除" class="btn btn-primary"/>
</tree>
</field>
@@ -66,7 +65,7 @@
<field name="name">对账</field>
<field name="res_model">property.bank.statements</field>
<field name="view_mode">tree</field>
<field name="domain">[('is_put', '=', False)]</field>
<field name="domain">[('is_put', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_bank_statements_tree')})]"/>
</record>
@@ -74,15 +73,8 @@
<field name="name">银行流水</field>
<field name="res_model">property.bank.statements</field>
<field name="view_mode">tree</field>
<field name="domain">[('is_put', '=', True)]</field>
<field name="domain">[('is_put', '=', False)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_bank_statements_tree1')})]"/>
</record>
<record id="all_data_property_bank_statements" model="ir.actions.server">
<field name="name">批量对账</field>
<field name="model_id" ref="yuthon_property.model_property_bank_statements"/>
<field name="binding_model_id" ref="yuthon_property.model_property_bank_statements"/>
<field name="state">code</field>
<field name="code">action = model.button_all_reconciliation()</field>
</record>
</odoo>
@@ -17,8 +17,8 @@
<field name="create_time"/>
<field name="remark"/>
<field name="last_update_time" optional="hide"/>
<field name="is_billing"/>
<field name="is_reconciliation"/>
<field name="is_billing" column_invisible="1"/>
<field name="is_reconciliation" column_invisible="1"/>
<button name="unlink" type="object" class="btn-primary" string="删除"/>
</tree>
</field>
+1
View File
@@ -64,6 +64,7 @@
'views/property_sporadic_works_views.xml',
'views/property_service_approval_views.xml',
'views/property_engineering_approval_views.xml',
'views/property_accounts_approval_views.xml',
'views/property_delegated_agent_views.xml',
'views/property_transaction_confirmed.xml',
'wizard/property_add_wizard_views.xml',
+2 -1
View File
@@ -52,4 +52,5 @@ from . import property_borrowing_approval
from . import perperty_claim_approval
from . import property_service_approval
from . import property_engineering_approval
from . import property_current_approval
from . import property_current_approval
from . import property_accounts_approval
@@ -16,30 +16,31 @@ class PropertyBankStatements(models.Model):
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
contract_ids = fields.Many2many('property.lease.contract', string="租赁合同审批")
accounts_id = fields.Many2one('property.accounts.approval', string="关联生成应收审批单")
def button_manage(self):
pass
def button_reconciliation(self):
for record in self:
for contract_id in record.contract_ids:
receivable_id = self.env['property.accounts.receivable'].search([('contract_id', '=', contract_id.id)])
if receivable_id:
dt = datetime.strptime(str(record.start_time), '%Y-%m-%d %H:%M:%S').date()
due = datetime.strptime(str(receivable_id.due_date), '%Y-%m-%d').date()
# 判断是否违约
if receivable_id.due_date > record.start_time and receivable_id.is_reconciliation == False:
original_amount = (due - dt).days * (receivable_id.original_amount - record.original_amount)*0.001
self.env['property.penalty.list'].create({
'contract_id': contract_id.id,
'property_id': contract_id.lease_ids[0].address_id.id,
'lessee_id': contract_id.lessee_id.id,
'original_amount':original_amount
})
receivable_id.is_reconciliation = True
def _handle_contract_penalty(self, record):
for contract_id in record.contract_ids:
receivable_id = self.env['property.accounts.receivable'].search([('contract_id', '=', contract_id.id)])
if receivable_id:
dt = datetime.strptime(str(record.start_time), '%Y-%m-%d %H:%M:%S').date()
due = datetime.strptime(str(receivable_id.due_date), '%Y-%m-%d').date()
# 判断是否违约
if receivable_id.due_date > record.start_time and not receivable_id.is_reconciliation:
original_amount = (due - dt).days * (receivable_id.original_amount - record.original_amount) * 0.001
self.env['property.penalty.list'].create({
'contract_id': contract_id.id,
'property_id': contract_id.lease_ids[0].address_id.id,
'lessee_id': contract_id.lessee_id.id,
'original_amount': original_amount
})
receivable_id.is_reconciliation = True
if self.name:
bank_id = self.env['property.bank.line'].search([('bank', '=', self.name)])
def _get_reconciliation_vals(self, record):
if record.name:
bank_id = self.env['property.bank.line'].search([('bank', '=', record.name)])
total_rent_month = 0
if bank_id:
tenant_id = bank_id.tenant_id
@@ -54,34 +55,38 @@ class PropertyBankStatements(models.Model):
# 应收电费
electricity_ids = self.env['property.tariff.list'].search([('lessee_id', '=', tenant_id.id)])
def create_reconciliation_vals(ids):
def create_reconciliation_vals(ids, collection_type_val):
nonlocal total_rent_month
vals_list = []
for record in ids:
property_id = record.property_id.id if record.property_id else False
contract_id = record.contract_id.id if record.contract_id else False
original_amount = record.original_amount if record.original_amount else 0
for sub_record in ids:
property_id = sub_record.property_id.id if sub_record.property_id else False
contract_id = sub_record.contract_id.id if sub_record.contract_id else False
original_amount = sub_record.original_amount if sub_record.original_amount else 0
vals = {
'property_id': property_id,
'contract_id': contract_id,
'rent_month': original_amount,
'rent': original_amount,
'collection_type': collection_type_val,
}
# 使用 (0, 0, vals) 格式表示创建新记录
total_rent_month += original_amount
vals_list.append((0, 0, vals))
return vals_list
all_vals = []
all_vals.extend(create_reconciliation_vals(rent_ids))
all_vals.extend(create_reconciliation_vals(deposit_ids))
all_vals.extend(create_reconciliation_vals(management_ids))
all_vals.extend(create_reconciliation_vals(water_ids))
all_vals.extend(create_reconciliation_vals(electricity_ids))
all_vals.extend(create_reconciliation_vals(rent_ids, 'rent'))
all_vals.extend(create_reconciliation_vals(deposit_ids, 'deposit'))
all_vals.extend(create_reconciliation_vals(management_ids, 'management_fee'))
all_vals.extend(create_reconciliation_vals(water_ids, 'water_fee'))
all_vals.extend(create_reconciliation_vals(electricity_ids, 'electricity_fee'))
return all_vals, total_rent_month
return [], 0
def _get_context_and_action(self, record, all_vals, total_rent_month):
context = {
"default_account": self.name,
"default_actual_total":self.original_amount,
"default_account": record.name,
"default_actual_total": record.original_amount,
"default_reconciliation_line_ids": all_vals,
"default_receivable_total": total_rent_month
}
@@ -95,6 +100,60 @@ class PropertyBankStatements(models.Model):
"context": context,
}
def button_reconciliation(self):
for record in self:
self._handle_contract_penalty(record)
all_vals, total_rent_month = self._get_reconciliation_vals(record)
return self._get_context_and_action(record, all_vals, total_rent_month)
def button_all_reconciliation(self):
statements_ids = self.env["property.bank.statements"].browse(self._context.get('active_ids', self._context.get('active_id')))
total_all_vals = []
grand_total_rent_month = 0
for record in statements_ids:
self._handle_contract_penalty(record)
all_vals, total_rent_month = self._get_reconciliation_vals(record)
total_all_vals.extend(all_vals)
grand_total_rent_month += total_rent_month
if statements_ids:
first_record = statements_ids[0]
return self._get_context_and_action(first_record, total_all_vals, grand_total_rent_month)
return None
def put_button(self):
form_id = self.env.ref('yuthon_property_approval.view_property_accounts_approval_form').id
bank_list = []
bank_list.append((0, 0, {
'start_time': self.start_time,
'company_id': self.company_id.id if self.company_id else False,
'name': self.name,
'bank_name': self.bank_name,
'name_account': self.name_account,
'purpose': self.purpose,
'journal_date': self.journal_date,
'bank_branch': self.bank_branch,
'extract': self.extract,
'account_code': self.account_code,
'is_put': self.is_put,
'remake': self.remake,
'original_amount': self.original_amount,
'contract_account': self.contract_account,
'contract_penalty': self.contract_penalty,
'property_ids': [(6, 0, self.property_ids.ids)] if self.property_ids else [],
'contract_ids': [(6, 0, self.contract_ids.ids)] if self.contract_ids else [],
'bank_number': self.bank_number,
'message': self.message,
'number': self.number,
'voucher_type': self.voucher_type
}))
return {
"type": "ir.actions.act_window",
"name": "应收账单生成审批单",
"res_model": "property.accounts.approval",
"views": [[form_id, "form"]],
"context": {
"default_bank_ids": bank_list,}}
class PropertyBankLine(models.Model):
_inherit = 'property.bank.line'
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from datetime import datetime, timedelta
class PropertyAccountsApproval(models.Model):
_name = 'property.accounts.approval'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_description = '生成应收审批单'
name = fields.Char(string='名称', required=True)
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code(
'property_claim_approval_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
department_id = fields.Many2one('hr.department', string="部门")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
reason_application = fields.Html(string="事由")
documents_ids = fields.Many2many('ir.attachment', string="附件")
is_issues = fields.Boolean(string="是否上会")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
active = fields.Boolean('Active', default=True, tracking=True)
bank_ids = fields.One2many('property.bank.statements', 'accounts_id', string="银行流水明细")
def _get_default_name_title(self):
return self._description if self._description else self._name
name_title = fields.Char(default=_get_default_name_title)
# 流程结束触发方法
def put_button(self):
for record in self:
record.is_put = True
@@ -50,6 +50,7 @@ class PropertyInformationDetailLines(models.Model):
new_property_id = fields.Many2one('property.management', string="新物业信息")
company_id = fields.Many2one('yuthon.property.company', string="所属公司")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
new_admin = fields.Char(string="新管理员")
admin_id = fields.Many2one('res.users', string="管理员")
new_precincts = fields.Many2one('yuthon.precinct.message', string="新片区")
@@ -93,5 +93,6 @@ access_property_reconciliation_line,property_reconciliation_line,model_property_
access_property_service_approval,property_service_approval,model_property_service_approval,base.group_user,1,1,1,1
access_property_engineering_approval,property_engineering_approval,model_property_engineering_approval,base.group_user,1,1,1,1
access_property_current_approval, property_current_approval,model_property_current_approval,base.group_user,1,1,1,1
access_property_accounts_approval, property_accounts_approval,model_property_accounts_approval,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
93 access_property_engineering_approval property_engineering_approval model_property_engineering_approval base.group_user 1 1 1 1
94 access_property_current_approval property_current_approval model_property_current_approval base.group_user 1 1 1 1
95 access_property_accounts_approval property_accounts_approval model_property_accounts_approval base.group_user 1 1 1 1
96
97
98
@@ -371,11 +371,30 @@
<field name="contract_ids" string="合同编号" widget="many2many_tags"/>
</xpath>
<xpath expr="//field[@name='voucher_type']" position="after">
<button name="button_manage" type="object" string="绑定管理" class="btn btn-primary" invisible="contract_ids"/>
<button name="button_reconciliation" type="object" string="对账" class="btn btn-primary" invisible="is_reconciliation"/>
</xpath>
</field>
</record>
<record id="inherit_property_bank_statements_tree1" model="ir.ui.view">
<field name="name">property.bank.statements.tree1</field>
<field name="model">property.bank.statements</field>
<field name="inherit_id" ref="yuthon_property.view_property_bank_statements_tree1"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_ids']" position="before">
<field name="contract_ids" string="合同编号" widget="many2many_tags"/>
</xpath>
<xpath expr="//field[@name='voucher_type']" position="after">
<button name="put_button" type="object" string="推送" class="btn btn-primary"/>
</xpath>
</field>
</record>
<record id="all_data_property_bank_statements" model="ir.actions.server">
<field name="name">批量对账</field>
<field name="model_id" ref="yuthon_property.model_property_bank_statements"/>
<field name="binding_model_id" ref="yuthon_property.model_property_bank_statements"/>
<field name="state">code</field>
<field name="code">action = model.button_all_reconciliation()</field>
</record>
<record id="inherit_view_property_penalty_list_tree" model="ir.ui.view">
<field name="name">property.penalty.list.tree</field>
<field name="model">property.penalty.list</field>
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_accounts_approval_tree" model="ir.ui.view">
<field name="name">property.accounts.approval.tree</field>
<field name="model">property.accounts.approval</field>
<field name="arch" type="xml">
<tree string="应收账单生成审批单">
<field name="name"/>
<field name="users_id"/>
</tree>
</field>
</record>
<record id="view_property_accounts_approval_form" model="ir.ui.view">
<field name="name">property.accounts.approval.form</field>
<field name="model">property.accounts.approval</field>
<field name="arch" type="xml">
<form string="应收账单生成审批单">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
invisible="urgency_level != 'emergency'"/>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group/>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group string="审批事项">
<field name="users_id"/>
<field name="reason_application"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
<notebook>
<page string="银行流水明细">
<field name="bank_ids" readonly="1">
<tree editable="bottom">
<field name="accounts_id" column_invisible="1"/>
<field name="start_time"/>
<field name="company_id" optional="hide"/>
<field name="name"/>
<field name="bank_name" optional="hide"/>
<field name="name_account"/>
<field name="purpose" optional="hide"/>
<field name="journal_date" optional="hide"/>
<field name="bank_branch" optional="hide"/>
<field name="extract" optional="hide"/>
<field name="account_code" optional="hide"/>
<field name="is_put" column_invisible="1"/>
<field name="remake"/>
<field name="original_amount"/>
<field name="contract_account" optional="hide"/>
<field name="contract_penalty" optional="hide"/>
<field name="property_ids" widget="many2many_tags"/>
<field name="contract_ids" widget="many2many_tags"/>
<field name="bank_number" optional="hide"/>
<field name="message" optional="hide"/>
<field name="number" optional="hide"/>
<field name="voucher_type" optional="hide"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_property_accounts_approval_action" model="ir.actions.act_window">
<field name="name">应收账单生成审批单</field>
<field name="res_model">property.accounts.approval</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
@@ -74,6 +74,7 @@
<field name="company_id"/>
<field name="new_admin"/>
<field name="new_precincts"/>
<field name="purpose_id"/>
<field name="tenure_type"/>
</tree>
</field>
@@ -40,6 +40,12 @@
parent="yuthon_property.yuthon_property_estate_menu"
name="流程"
sequence="10"/>
<menuitem
id="property_accounts_approval_menu"
parent="property_contract_process_menu"
name="应收账单生成审批单"
action="view_property_accounts_approval_action"
sequence="1"/>
<menuitem
id="property_lease_extension_menu"
parent="property_contract_process_menu"
@@ -220,55 +226,66 @@
<menuitem id="yuthon_property_process"
sequence="90"
name="流程"
groups="yuthon_property.group_account_user"
parent="yuthon_property.yuthon_financial_management_menu"/>
<menuitem id="yuthon_property_fee_adjust"
sequence="3"
name="费用调整"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_record_action"/>
<menuitem id="yuthon_property_rent_relief"
sequence="5"
name="租金减免"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_rent_relief_action"/>
<menuitem id="yuthon_property_penalty_relief"
sequence="7"
name="违约金减免"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_penalty_relief_action"/>
<menuitem id="yuthon_property_renovation_application"
sequence="11"
name="装修申请"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_fitment_action"/>
<menuitem id="yuthon_property_increase_application"
sequence="13"
name="增容申请"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_capacity_action"/>
<menuitem id="yuthon_property_management_fee_adjustments"
sequence="15"
name="管理费调整"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_management_fee_action"/>
<menuitem id="yuthon_property_penalty_tweaks"
sequence="17"
name="违约金比例调整"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="property_penalty_proportion_action"/>
<menuitem id="property_reimbursement_form_menu"
sequence="19"
name="体检费报销单"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="view_property_reimbursement_form_action"/>
<menuitem id="property_claim_form_menu"
sequence="20"
name="业务报销单"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="view_property_claim_approval_action"/>
<menuitem id="property_borrowing_approval_menu"
sequence="21"
name="借支申请表"
groups="yuthon_property.group_account_user"
parent="yuthon_property_process"
action="view_property_borrowing_approval_action"/>
<menuitem id="yuthon_property_process_setting"
@@ -278,11 +295,13 @@
<menuitem id="yuthon_property_account_setting_menu"
sequence="1"
name="账户设置"
groups="yuthon_property.group_account_admin"
parent="yuthon_property_process_setting"
action="yuthon_property.yuthon_property_account_setting_action"/>
<menuitem id="yuthon_property_project_setting_menu"
sequence="5"
name="费用项目"
groups="yuthon_property.group_account_admin"
parent="yuthon_property_process_setting"
action="yuthon_property.yuthon_property_project_setting_action"/>
@@ -14,43 +14,6 @@ class PropertyReconciliationWizard(models.Model):
def confirm(self):
pass
@api.onchange('account')
def _onchange_account(self):
if self.account:
bank_id = self.env['property.bank.line'].search([('bank', '=', self.account)])
if bank_id:
tenant_id = bank_id.tenant_id
# 应收租金
rent_ids = self.env['property.rent.list'].search([('lessee_id', '=', tenant_id.id)])
# 应收押金
deposit_ids = self.env['property.deposit.list'].search([('lessee_id', '=', tenant_id.id)])
# 应收管理费
management_ids = self.env['property.management.list'].search([('lessee_id', '=', tenant_id.id)])
# 应收水费
water_ids = self.env['property.water.list'].search([('lessee_id', '=', tenant_id.id)])
# 应收电费
electricity_ids = self.env['property.tariff.list'].search([('lessee_id', '=', tenant_id.id)])
def create_reconciliation_line(ids):
for record in ids:
property_id = record.property_id.id if record.property_id else False
contract_id = record.contract_id.id if record.contract_id else False
original_amount = record.original_amount if record.original_amount else 0
vals = {
# 'reconciliation_id': self.id,
'property_id': property_id,
'contract_id': contract_id,
'rent_month': original_amount,
}
self.sudo().env['property.reconciliation.line'].create(vals)
# 为不同类型的应收款项创建明细行
create_reconciliation_line(rent_ids)
create_reconciliation_line(deposit_ids)
create_reconciliation_line(management_ids)
create_reconciliation_line(water_ids)
create_reconciliation_line(electricity_ids)
class PropertyReconciliationLine(models.Model):
_name = 'property.reconciliation.line'
_description = '对账明细'
@@ -62,5 +25,7 @@ class PropertyReconciliationLine(models.Model):
rent = fields.Float(string='应收租金')
penalty = fields.Float(string='违约金')
amount = fields.Float(string='金额')
collection_type = fields.Char(string='收款类型')
collection_type = fields.Selection([('deposit', '押金'), ('rent', '租金'), ('water_fee', '水费'),
('electricity_fee', '电费'), ('penalty', '违约'), ('management_fee', '管理费'), ('repair_fee', '维修费'),
('other', '其他')], string='收款类型')
remake = fields.Char(string='备注')
@@ -9,6 +9,7 @@ class InheritHrPayslip(models.Model):
full_attendance_award = fields.Float(string='全勤奖', compute='_compute_salary', store=True)
commuting_allowance = fields.Float(string='通信补贴', compute='_compute_salary', store=True)
rank_salary = fields.Float(string='职级工资', compute='_compute_salary', store=True)
account_id = fields.Many2one('yuthon.account.group', string='工资表分组')
@api.depends('line_ids')
def _compute_salary(self):
@@ -8,4 +8,11 @@ class YuthonPayrollTypeSetting(models.Model):
name = fields.Char(string='职级类别')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string='所属公司')
('thlc', '天河粮储')], string='所属公司')
class YuthonAccountGroup(models.Model):
_name = 'yuthon.account.group'
_description = '工资表分组'
name = fields.Char(string='分组名称')
@@ -6,3 +6,4 @@ access_yuthon_payroll_temporary,access_yuthon_payroll_temporary,model_yuthon_pay
access_yuthon_payroll_insurances,access_yuthon_payroll_insurances,model_yuthon_payroll_insurances,base.group_user,1,1,1,1
access_yuthon_payroll_wizard,access_yuthon_payroll_wizard,model_yuthon_payroll_wizard,base.group_user,1,1,1,1
access_salary_compute_wizard,access_salary_compute_wizard,model_salary_compute_wizard,base.group_user,1,1,1,1
access_yuthon_account_group,access_yuthon_account_group,model_yuthon_account_group,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
6 access_yuthon_payroll_insurances access_yuthon_payroll_insurances model_yuthon_payroll_insurances base.group_user 1 1 1 1
7 access_yuthon_payroll_wizard access_yuthon_payroll_wizard model_yuthon_payroll_wizard base.group_user 1 1 1 1
8 access_salary_compute_wizard access_salary_compute_wizard model_salary_compute_wizard base.group_user 1 1 1 1
9 access_yuthon_account_group access_yuthon_account_group model_yuthon_account_group base.group_user 1 1 1 1
@@ -18,6 +18,7 @@
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='net_wage']" position="after">
<field name="account_id" column_invisible="1"/>
<field name="base_salary"/>
<field name="performance_bonuses"/>
<field name="full_attendance_award"/>
@@ -65,5 +66,16 @@
</xpath>
</field>
</record>
<record id="view_hr_payslip_filter_inherit" model="ir.ui.view">
<field name="name">view.hr.payslip.filter.inherit</field>
<field name="model">hr.payslip</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="after">
<group expand="0" string="Group By">
<filter string="工资单" name="group_by_account_id" context="{'group_by': 'account_id'}"/>
</group>
</xpath>
</field>
</record>
</odoo>
@@ -15,4 +15,18 @@
<field name="res_model">yuthon.payroll.type.setting</field>
<field name="view_mode">tree</field>
</record>
<record id="view_yuthon_account_group_tree" model="ir.ui.view">
<field name="name">yuthon.account.group.tree</field>
<field name="model">yuthon.account.group</field>
<field name="arch" type="xml">
<tree string="工资表分组" editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<record id="yuthon_account_group_action" model="ir.actions.act_window">
<field name="name">工资表分组</field>
<field name="res_model">yuthon.account.group</field>
<field name="view_mode">tree</field>
</record>
</odoo>
-2
View File
@@ -23,8 +23,6 @@
'views/yuthon_trade_supportive.xml',
'views/yuthon_none_views.xml',
'views/yuthon_mutual_approval_views.xml',
'views/yuthon_hospital_approval_views.xml',
'views/yuthon_disease_approval_views.xml',
'views/yuthon_care_condolences_views.xml',
'views/yuthon_trade_setting_views.xml',
'views/yuthon_work_condolences_views.xml',
+1 -2
View File
@@ -15,5 +15,4 @@ from . import yuthon_work_condolences
from . import yuthon_trade_setting
from . import yuthon_message_approval
from . import yuthon_mutual_approval
from . import yuthon_hospital_approval
from . import yuthon_disease_approval
from . import yuthon_error
@@ -1,33 +0,0 @@
from odoo import models, fields, api
from odoo.exceptions import UserError
class YuthonDiseaseApproval(models.Model):
_name = 'yuthon.disease.approval'
_description = '重大疾病互助审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
text = fields.Text(string='正文')
name = fields.Char(string="名称")
employee_id = fields.Many2one('hr.employee', string="姓名")
employee_phone = fields.Char(related='employee_id.work_phone', string='联系电话')
sex = fields.Selection([('male', '男'), ('female', '女')], string='性别')
card = fields.Char(string='身份证号')
unit = fields.Char(string='参保单位名称')
contact_user_id = fields.Many2one('hr.employee', string="单位联系人")
phone = fields.Char(related='contact_user_id.work_phone', string='单位联系电话')
disease_type = fields.Char(string='疾病类型')
crediting_id = fields.Many2one('res.users', string="收款人姓名")
bank_phone = fields.Char(string='银行账号')
bank_name = fields.Char(string='开户行')
remake = fields.Text(string='备注')
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
def _get_default_name_title(self):
return self._description if self._description else self._name
name_title = fields.Char(default=_get_default_name_title)
documents_ids = fields.Many2many('ir.attachment', string="附件")
+8
View File
@@ -0,0 +1,8 @@
from odoo import models, fields, api
class YuthonDiseaseApproval(models.Model):
_name = 'yuthon.disease.approval'
class YuthonHospitalApproval(models.Model):
_name = 'yuthon.hospital.approval'
@@ -1,32 +0,0 @@
from odoo import models, fields, api
from odoo.exceptions import UserError
class YuthonHospitalApproval(models.Model):
_name = 'yuthon.hospital.approval'
_description = '住院互助申请表'
_rec_name = 'name'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
text = fields.Text(string='正文')
name = fields.Char(string="参保名称")
employee_phone = fields.Char(related='employee_id.work_phone', string='联系电话')
employee_id = fields.Many2one('hr.employee', string="姓名")
sex = fields.Selection([('male', '男'), ('female', '女')], string='性别')
card = fields.Char(string='身份证号')
bank_name = fields.Char(string='开户行')
contact_user_id = fields.Many2one('hr.employee', string="单位联系人")
phone = fields.Char(related='contact_user_id.work_phone', string='单位联系电话')
bank_phone = fields.Char(string='银行账号')
account = fields.Char('户名')
remake = fields.Text(string='备注')
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
def _get_default_name_title(self):
return self._description if self._description else self._name
name_title = fields.Char(default=_get_default_name_title)
documents_ids = fields.Many2many('ir.attachment', string="附件")
@@ -18,7 +18,5 @@ access_yuthon_work_setting,yuthon_work_setting,model_yuthon_work_setting,base.gr
access_yuthon_message_approval,yuthon_message_approval,model_yuthon_message_approval,base.group_user,1,1,1,1
access_yuthon_publish_type,yuthon_publish_type,model_yuthon_publish_type,base.group_user,1,1,1,1
access_yuthon_mutual_approval,yuthon_mutual_approval,model_yuthon_mutual_approval,base.group_user,1,1,1,1
access_yuthon_hospital_approval,yuthon_hospital_approval,model_yuthon_hospital_approval,base.group_user,1,1,1,1
access_yuthon_disease_approval,yuthon_disease_approval,model_yuthon_disease_approval,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
18 access_yuthon_publish_type yuthon_publish_type model_yuthon_publish_type base.group_user 1 1 1 1
19 access_yuthon_mutual_approval yuthon_mutual_approval model_yuthon_mutual_approval base.group_user 1 1 1 1
20
access_yuthon_disease_approval yuthon_disease_approval model_yuthon_disease_approval base.group_user 1 1 1 1
21
22
@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_yuthon_disease_approval_tree" model="ir.ui.view">
<field name="name">yuthon.disease.approval.tree</field>
<field name="model">yuthon.disease.approval</field>
<field name="arch" type="xml">
<tree string="重大疾病互助审批">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_yuthon_disease_approval_form" model="ir.ui.view">
<field name="name">yuthon.disease.approval.form</field>
<field name="model">yuthon.disease.approval</field>
<field name="arch" type="xml">
<form string="重大疾病互助审批">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
invisible="urgency_level != 'emergency'"/>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group/>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group string="审批事项">
<group>
<field name="name"/>
<field name="text"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
</group>
<group col="2">
<group>
<field name="employee_id"/>
<field name="employee_phone"/>
<field name="sex"/>
<field name="card"/>
<field name="contact_user_id"/>
<field name="phone"/>
</group>
<group>
<field name="disease_type"/>
<field name="phone"/>
<field name="crediting_id"/>
<field name="bank_phone"/>
<field name="bank_name"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_yuthon_disease_approval_action" model="ir.actions.act_window">
<field name="name">重大疾病互助审批</field>
<field name="res_model">yuthon.disease.approval</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
@@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_yuthon_hospital_approval_tree" model="ir.ui.view">
<field name="name">yuthon.hospital.approval.tree</field>
<field name="model">yuthon.hospital.approval</field>
<field name="arch" type="xml">
<tree string="住院互助申请表">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_yuthon_hospital_approval_form" model="ir.ui.view">
<field name="name">yuthon.hospital.approval.form</field>
<field name="model">yuthon.hospital.approval</field>
<field name="arch" type="xml">
<form string="住院互助申请表">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
invisible="urgency_level != 'emergency'"/>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group/>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group string="审批事项">
<group>
<field name="name"/>
<field name="text"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
</group>
<group col="2">
<group>
<field name="employee_id"/>
<field name="employee_phone"/>
<field name="sex"/>
<field name="card"/>
<field name="bank_name"/>
</group>
<group>
<field name="contact_user_id"/>
<field name="phone"/>
<field name="bank_phone"/>
<field name="account"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_yuthon_hospital_approval_action" model="ir.actions.act_window">
<field name="name">主要互助金审批</field>
<field name="res_model">yuthon.hospital.approval</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
-10
View File
@@ -88,16 +88,6 @@
parent="executive_trade_process_ment"
action="view_mutual_approval_action"
sequence="30"/>
<menuitem id="yuthon_hospital_approval_ment"
name="住院互助金申请"
parent="executive_trade_process_ment"
action="view_yuthon_hospital_approval_action"
sequence="40"/>
<menuitem id="yuthon_disease_approval_ment"
name="疾病互助金申请"
parent="executive_trade_process_ment"
action="view_yuthon_disease_approval_action"
sequence="50"/>
<menuitem id="executive_trade_setting"
name="配置"
parent="executive_manage_approval"
+11
View File
@@ -398,6 +398,17 @@
action="hr_work_entry.hr_work_entry_type_action"
groups="yuthon_salary.group_salary_admin,yuthon_salary.group_salary_super_admin"
sequence="50"/>
<menuitem id="human_pay_setting_work_setting"
name="配置"
parent="human_resources_salary_root_board"
sequence="99"
/>
<menuitem id="human_pay_account_group"
name="工资表分组"
parent="human_pay_setting_work_setting"
sequence="1"
action="yuthon_salary.yuthon_account_group_action"
/>
<!-- 培训管理 -->
<menuitem id="training_manager_root_board"