@@ -33,12 +33,6 @@ class YuthonUserRole(models.Model):
|
||||
personnel_id.write({'user_role_id': record.id})
|
||||
return res
|
||||
|
||||
@api.depends('department_id', 'name')
|
||||
def _compute_display_name(self):
|
||||
for record in self:
|
||||
if record.department_id and record.name:
|
||||
record.display_name = record.department_id.name + ' - ' + record.name
|
||||
|
||||
@api.depends('name')
|
||||
def _compute_pinyin(self):
|
||||
for employee in self:
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<field name="name"/>
|
||||
<field name="department_id" widget="ztree_select"/>
|
||||
<searchpanel>
|
||||
<field name="department_id" enable_counters="1"/>
|
||||
<field name="department_id" enable_counters="1" select="multi"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<field name="model">hr.attendance</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="employee_id" widget="ztree_select"/>
|
||||
<field name="employee_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -354,7 +354,8 @@
|
||||
<field name="use_user_type"/>
|
||||
<field name="salary_group_id" column_invisible="1"/>
|
||||
<field name="user_number" optional="hide"/>
|
||||
<field name="mobile_phone"/>
|
||||
<field name="mobile_phone" optional="hide"/>
|
||||
<field name="user_role_id"/>
|
||||
<field name="confirmation_date" optional="hide"/>
|
||||
<field name="user_number_start_time" optional="hide"/>
|
||||
<field name="nation" optional="hide"/>
|
||||
@@ -383,8 +384,14 @@
|
||||
<xpath expr="//field[@name='attendance_manager_id']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='work_phone']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='work_phone']" position="before">
|
||||
<field name="number"/>
|
||||
<field name="number"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -397,6 +404,9 @@
|
||||
<field name="pinyin_name"/>
|
||||
<field name="pinyin_min"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='department_id']" position="after">
|
||||
<field name="user_role_id" select="multi"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="all_data_write_user" model="ir.actions.server">
|
||||
|
||||
@@ -15,4 +15,17 @@
|
||||
<field eval="False" name="doall"/>
|
||||
</record>
|
||||
</data>
|
||||
<record forcecreate="True" id="update_yuthon_property_time" model="ir.cron">
|
||||
<field name="name">定时任务:更新物业状态</field>
|
||||
<field name="model_id" ref="model_yuthon_property"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model.get_yuthon_property_time()</field>
|
||||
<field eval="True" name="active"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="nextcall" eval="(DateTime.now()).strftime('%Y-%m-%d 00:00:00')"/>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -10,6 +10,19 @@ class YuthonProperty(models.Model):
|
||||
|
||||
property_contract_ids = fields.One2many('property.contract.line', 'yuthon_property_id', string="关联物业合同明细行")
|
||||
|
||||
def get_yuthon_property_time(self):
|
||||
unique_property_ids = set()
|
||||
for record in self.search([('state', '=', 'to'), ('property_contract_ids', '=', False)]):
|
||||
contracts = self.env['property.evaluation.plan'].search([])
|
||||
for contract in contracts:
|
||||
for property_id in contract.property_ids:
|
||||
if property_id.id not in unique_property_ids:
|
||||
unique_property_ids.add(property_id.id)
|
||||
if record.id not in unique_property_ids:
|
||||
record.put_assessment_approval()
|
||||
else:
|
||||
continue
|
||||
|
||||
# 银行流水
|
||||
class PropertyBankStatements(models.Model):
|
||||
_inherit = 'property.bank.statements'
|
||||
|
||||
@@ -132,7 +132,7 @@ class PropertyLeaseContract(models.Model):
|
||||
lease_bank_ids = fields.One2many('property.bank.line', 'contract_id', string="承租方账户明细行")
|
||||
bank_statements_ids = fields.One2many('property.bank.statements', 'contract_id', string="银行流水明细行")
|
||||
management_list_ids = fields.One2many('property.management.list', 'contract_id', string="管理费用明细行")
|
||||
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中')], string="状态", default='to')
|
||||
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中')], string="状态")
|
||||
# 附件
|
||||
license_id = fields.Many2one('ir.attachment', string="营业执照")
|
||||
card_id = fields.Many2one('ir.attachment', string="经办人身份证")
|
||||
@@ -1088,14 +1088,19 @@ class PropertyLeaseContract(models.Model):
|
||||
record.admin_id = record.lease_ids[0].admin_id.id
|
||||
|
||||
def get_property_contract_time(self):
|
||||
for record in self.search([]):
|
||||
if record.term_start_time:
|
||||
current_date = date.today()
|
||||
if record.condition != 'cancel':
|
||||
if current_date >= record.term_start_time:
|
||||
record.write({'condition': 'executed'})
|
||||
elif current_date < record.term_start_time:
|
||||
record.write({'condition': 'be_executed'})
|
||||
unique_property_ids = set()
|
||||
lease_contracts = self.env['property.lease.contract'].search([('end_comparison', 'in', ['red', 'yellow', 'blue'])])
|
||||
for record in lease_contracts:
|
||||
contracts = self.env['property.evaluation.plan'].search([])
|
||||
for contract in contracts:
|
||||
for property_id in contract.property_ids:
|
||||
unique_property_ids.add(property_id.id)
|
||||
|
||||
lease_id_list = [lease.address_id.id for lease in record.lease_ids]
|
||||
should_process = any(lease_id not in unique_property_ids for lease_id in lease_id_list)
|
||||
if should_process:
|
||||
record.put_evaluation_plan()
|
||||
record.write({'state': 'to'})
|
||||
# 续租
|
||||
def button_lease_extension(self):
|
||||
form_id = self.env.ref('yuthon_property_approval.view_property_lease_extension_form').id
|
||||
@@ -1148,22 +1153,24 @@ class PropertyLeaseContract(models.Model):
|
||||
return self.search_count([('expiration_coming', '=', 'due'), ('admin_id', '=', self.env.user.id)])
|
||||
|
||||
def put_evaluation_plan(self):
|
||||
property_ids = []
|
||||
property_id = self.lease_ids[0].address_id
|
||||
for record in self:
|
||||
property_ids = []
|
||||
rent_area = 0
|
||||
first_address_id = record.lease_ids[0].address_id if record.lease_ids else None
|
||||
for lease_id in record.lease_ids:
|
||||
property_ids.append(lease_id.address_id.id)
|
||||
rent_area += lease_id.address_id.rent_area
|
||||
self.env['property.evaluation.plan'].create({
|
||||
'name': record.name,
|
||||
'property_ids': property_ids,
|
||||
'evaluation_area': property_id.rent_area,
|
||||
'owner_id': property_id.title_information_ids[0].owner_id.id if property_id.title_information_ids else None,
|
||||
'registered_id': property_id.title_information_ids[0].registered_id.id if property_id.title_information_ids else None,
|
||||
'rent_id': property_id.reference_ids[0].rent_id.id if property_id.reference_ids else None,
|
||||
'start_lease_period': property_id.reference_ids[0].start_lease_period if property_id.reference_ids else None,
|
||||
'end_lease_period': property_id.reference_ids[0].end_lease_period if property_id.reference_ids else None,
|
||||
'annual_increase_percentage': property_id.reference_ids[0].annual_increase_percentage if property_id.reference_ids else None,
|
||||
'remake': property_id.remark,
|
||||
'property_ids': [(6, 0, property_ids)],
|
||||
'evaluation_area': rent_area,
|
||||
'owner_id': first_address_id.title_information_ids[0].owner_id.id if first_address_id and first_address_id.title_information_ids else None,
|
||||
'registered_id': first_address_id.title_information_ids[0].registered_id.id if first_address_id and first_address_id.title_information_ids else None,
|
||||
'rent_id': first_address_id.reference_ids[0].rent_id.id if first_address_id and first_address_id.reference_ids else None,
|
||||
'start_lease_period': first_address_id.reference_ids[0].start_lease_period if first_address_id and first_address_id.reference_ids else None,
|
||||
'end_lease_period': first_address_id.reference_ids[0].end_lease_period if first_address_id and first_address_id.reference_ids else None,
|
||||
'annual_increase_percentage': first_address_id.reference_ids[0].annual_increase_percentage if first_address_id and first_address_id.reference_ids else None,
|
||||
'remake': first_address_id.remark if first_address_id else None,
|
||||
'assessment_category': 'rent_money',
|
||||
})
|
||||
record.write({'state': 'ing'})
|
||||
@@ -1181,8 +1188,10 @@ class PropertyLeaseContract(models.Model):
|
||||
property_id = record.lease_ids[0].address_id
|
||||
if record.state == 'done':
|
||||
raise UserError(f'{record.name}该物业已评估,请勿重复评估')
|
||||
rent_area = 0
|
||||
for lease_id in record.lease_ids:
|
||||
property_ids.append(lease_id.address_id.id)
|
||||
rent_area += lease_id.address_id.rent_area
|
||||
self.env['property.evaluation.plan'].create({
|
||||
'name': record.name,
|
||||
'property_ids': property_ids,
|
||||
|
||||
@@ -418,6 +418,7 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="use_address"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="deposit_status" invisible="1"/>
|
||||
<field name="address_for_delivery"/>
|
||||
<field name="condition" invisible="1" readonly="1"/>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
'views/yuthon_payroll_project_views.xml',
|
||||
'views/yuthon_payroll_type_setting_views.xml',
|
||||
'views/yuthon_payroll_labor_views.xml',
|
||||
'views/yuthon_salary_documents_views.xml',
|
||||
'views/yuthon_payroll_retired_views.xml',
|
||||
'wizard/yuthon_salary_wizard_views.xml',
|
||||
'wizard/temporary_payslip_wizard_views.xml',
|
||||
@@ -35,6 +36,7 @@
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'yuthon_salary/static/scss/approval.scss',
|
||||
'yuthon_salary/static/src/js/salary_documents_button.js',
|
||||
'yuthon_salary/static/src/js/salary_create_button.js',
|
||||
'yuthon_salary/static/src/js/salary_payslip_button.js',
|
||||
'yuthon_salary/static/src/js/salary_labor_button.js',
|
||||
@@ -44,6 +46,7 @@
|
||||
'yuthon_salary/static/src/xml/salary_labor_button.xml',
|
||||
'yuthon_salary/static/src/xml/salary_retired_button.xml',
|
||||
'yuthon_salary/static/src/xml/salary_payslip_button.xml',
|
||||
'yuthon_salary/static/src/xml/salary_documents_button.xml',
|
||||
'yuthon_salary/static/src/xml/salary_return_button.xml',
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,4 +5,5 @@ from . import inherit_hr_payslip
|
||||
from . import yuthon_payroll_type_setting
|
||||
from . import yuthon_payroll_project
|
||||
from . import yuthon_payroll_labor
|
||||
from . import yuthon_payroll_retired
|
||||
from . import yuthon_payroll_retired
|
||||
from . import yuthon_salary_documents
|
||||
@@ -0,0 +1,24 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class YuthonSalaryDocuments(models.Model):
|
||||
_name = 'yuthon.salary.documents'
|
||||
_description = '薪资附件管理'
|
||||
|
||||
current_year = fields.Integer(string='年份')
|
||||
current_month = fields.Selection([
|
||||
('1', '1月份'),
|
||||
('2', '2月份'),
|
||||
('3', '3月份'),
|
||||
('4', '4月份'),
|
||||
('5', '5月份'),
|
||||
('6', '6月份'),
|
||||
('7', '7月份'),
|
||||
('8', '8月份'),
|
||||
('9', '9月份'),
|
||||
('10', '10月份'),
|
||||
('11', '11月份'),
|
||||
('12', '12月份')
|
||||
], string="月份")
|
||||
company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company)
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
@@ -17,4 +17,5 @@ access_temporary_payslip_wizard,access_temporary_payslip_wizard,model_temporary_
|
||||
access_yuthon_payroll_labor,access_yuthon_payroll_labor,model_yuthon_payroll_labor,base.group_user,1,1,1,1
|
||||
access_yuthon_payroll_retired,access_yuthon_payroll_retired,model_yuthon_payroll_retired,base.group_user,1,1,1,1
|
||||
access_payroll_labor_wizard,access_payroll_labor_wizard,model_payroll_labor_wizard,base.group_user,1,1,1,1
|
||||
access_payroll_retired_wizard,access_payroll_retired_wizard,model_payroll_retired_wizard,base.group_user,1,1,1,1
|
||||
access_payroll_retired_wizard,access_payroll_retired_wizard,model_payroll_retired_wizard,base.group_user,1,1,1,1
|
||||
access_yuthon_salary_documents,access_yuthon_salary_documents,model_yuthon_salary_documents,base.group_user,1,1,1,1
|
||||
|
@@ -0,0 +1,28 @@
|
||||
/** @odoo-module */
|
||||
import { ListController } from "@web/views/list/list_controller";
|
||||
import { registry } from '@web/core/registry';
|
||||
import { listView } from '@web/views/list/list_view';
|
||||
|
||||
export class CustomDocumentsController extends ListController {
|
||||
setup() {
|
||||
super.setup();
|
||||
}
|
||||
|
||||
openDocumentsWizard() {
|
||||
this.actionService.doAction({
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'yuthon.salary.documents',
|
||||
name: '薪资附件管理',
|
||||
view_mode: 'tree',
|
||||
view_type: 'tree',
|
||||
views: [[false, 'tree']],
|
||||
context: {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
registry.category("views").add("custom_documents_button", {
|
||||
...listView,
|
||||
Controller: CustomDocumentsController,
|
||||
buttonTemplate: "salary_documents.ListView.Buttons",
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<templates>
|
||||
<t t-name="salary_documents.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="openDocumentsWizard">
|
||||
薪资附件管理
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<!-- <attribute name="js_class">custom_salary_button</attribute>-->
|
||||
<attribute name="js_class">custom_documents_button</attribute>
|
||||
<attribute name="default_order">employee_id</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='basic_wage']" position="attributes">
|
||||
@@ -28,7 +28,7 @@
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='net_wage']" position="after">
|
||||
<field name="struct_id" string="职级"/>
|
||||
<field name="struct_id" string="职级"/>
|
||||
<field name="bank_account"/>
|
||||
<field name="actual_salary" decoration-danger="1"/>
|
||||
<field name="base_salary"/>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_salary_documents_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.salary.documents.tree</field>
|
||||
<field name="model">yuthon.salary.documents</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="薪资附件管理" editable="bottom">
|
||||
<field name="current_year"/>
|
||||
<field name="current_month"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="company_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_salary_documents_action" model="ir.actions.act_window">
|
||||
<field name="name">薪资附件管理</field>
|
||||
<field name="res_model">yuthon.salary.documents</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -370,6 +370,11 @@
|
||||
parent="human_resources_salary_root_board"
|
||||
action="yuthon_salary.view_yuthon_payroll_temporary_action"
|
||||
sequence="30"/>
|
||||
<menuitem id="yuthon_salary_documents"
|
||||
name="薪资附件管理"
|
||||
parent="human_resources_salary_root_board"
|
||||
action="yuthon_salary.view_yuthon_salary_documents_action"
|
||||
sequence="40"/>
|
||||
<menuitem id="human_pay_setting_work_setting"
|
||||
name="配置"
|
||||
parent="human_resources_salary_root_board"
|
||||
|
||||
Reference in New Issue
Block a user