Merge branch 'dev' of gitee.com:jinan-pengyusen-data/gzth into dev
This commit is contained in:
+12
-9
@@ -1,12 +1,11 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { Component, useState, onWillStart } from "@odoo/owl";
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
export class QuickFilter extends Component {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.orm = useService("orm");
|
||||
this.state = useState({ filters: [] });
|
||||
this.activeFilterIds = this.env.searchModel.headerSearchInfo.quickFilter[this.props.groupId]?.filters || [];
|
||||
onWillStart(async () => {
|
||||
await this.loadFilters();
|
||||
@@ -17,8 +16,13 @@ export class QuickFilter extends Component {
|
||||
* 返回过滤器列表
|
||||
*/
|
||||
get filters() {
|
||||
// 这里直接返回 state,避免在 getter 里做异步
|
||||
return this.state.filters;
|
||||
// 通过ID查询过滤器列表
|
||||
const filters = this.env.searchModel.headerSearchInfo.headerQuickFilter[this.props.id].filters || [];
|
||||
filters.forEach((filter, fdx) => {
|
||||
filter.isChecked = this.activeFilterIds.includes(filter.inputId);
|
||||
filter.index = fdx + 1;
|
||||
});
|
||||
return filters;
|
||||
}
|
||||
|
||||
async loadFilters() {
|
||||
@@ -27,12 +31,11 @@ export class QuickFilter extends Component {
|
||||
const filters = searchModel.headerSearchInfo.headerQuickFilter[this.props.id]?.filters || [];
|
||||
for (let [idx, filter] of filters.entries()) {
|
||||
const domain = this.safeParseDomain(filter.domain);
|
||||
const count = await this.orm.searchCount(resModel, domain);
|
||||
filter.count = count;
|
||||
filter.isChecked = this.activeFilterIds.includes(filter.inputId);
|
||||
filter.index = idx + 1;
|
||||
if (filter.show_number) {
|
||||
const count = await this.orm.searchCount(resModel, domain);
|
||||
filter.count = count;
|
||||
}
|
||||
}
|
||||
this.state.filters = filters;
|
||||
}
|
||||
/**
|
||||
* 设置活动的过滤器
|
||||
|
||||
@@ -59,6 +59,7 @@ class HrAttendance(models.Model):
|
||||
is_month = fields.Boolean(string="是否为本月数据", compute='_compute_month_status', store=True)
|
||||
is_last_month = fields.Boolean(string="是否为上月数据", compute='_compute_month_status', store=True)
|
||||
is_holiday = fields.Boolean(string="是否是假期")
|
||||
correct_result = fields.Text(string="修正原因")
|
||||
|
||||
def create_attendance_data_holiday(self):
|
||||
"""
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
<field name="is_approval" optional="hidden"/>
|
||||
<field name="is_check_in_red" column_invisible="1"/>
|
||||
<field name="is_check_out_red" column_invisible="1"/>
|
||||
<field name="is_holiday"/>
|
||||
<field name="is_holiday" optional="hidden"/>
|
||||
<field name="correct_result" optional="hidden"/>
|
||||
<field name="is_warning" optional="hidden"/>
|
||||
<field name="is_workflow" optional="hidden"/>
|
||||
<field name="workflow_id" optional="hidden"/>
|
||||
|
||||
@@ -13,11 +13,13 @@ class AttendanceCorrectWizard(models.TransientModel):
|
||||
_description = "考勤修正弹窗"
|
||||
|
||||
attendance_id = fields.Many2one('hr.attendance', string="考勤记录")
|
||||
correct_result = fields.Text(string="修正原因")
|
||||
|
||||
def confirm(self):
|
||||
for record in self:
|
||||
# 准备更新的值
|
||||
values = {
|
||||
'correct_result': self.correct_result,
|
||||
'is_approval': True,
|
||||
'is_abnormal': False,
|
||||
'is_no_card': False,
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="修正">
|
||||
<div>你确定要修正吗?</div>
|
||||
<group>
|
||||
<field name="correct_result" placeholder="请填写备注原因"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="confirm" string="确认" type="object" class="oe_highlight"/>
|
||||
<button string="返回" class="btn-secondary" special="cancel"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
'data/sale_renting_code_data.xml',
|
||||
'data/property_contract_time.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/property_group.xml',
|
||||
'report/lease_contract_report.xml',
|
||||
'report/lease_contract_templates.xml',
|
||||
'report/property_accounting_templates.xml',
|
||||
|
||||
@@ -399,7 +399,8 @@ class PropertyAccountsReceivable(models.Model):
|
||||
management_area = fields.Float(related='contract_id.total_area', string='面积')
|
||||
title_deed = fields.Char(string="产权证号", compute='_compute_title_deed')
|
||||
lessee_id = fields.Many2one(related='contract_id.lessee_id', string='承租方', store=True)
|
||||
company_id = fields.Many2one(related='contract_id.lessor_id', string="公司", store=True)
|
||||
company_id = fields.Many2one(related='contract_id.lessor_id', string="出租方公司", store=True)
|
||||
company_id1 = fields.Many2one(related='contract_id.admin_id.company_id', string="管理员公司", store=True)
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True)
|
||||
tenure_type = fields.Selection(related='contract_id.tenure_type', string="权属类型", store=True)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record model="ir.rule" id="accounts_receivable_rule">
|
||||
<field name="name">应收账单多公司</field>
|
||||
<field name="model_id" ref="model_property_accounts_receivable"/>
|
||||
<field name="domain_force">[('company_id1', 'in', company_ids)]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -299,6 +299,7 @@
|
||||
<field name="lessee_id" options="{'no_create': True}" readonly="1"/>
|
||||
<field name="title_deed" readonly="1"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
<field name="company_id1"/>
|
||||
<field name="contract_id" string="合同编号" options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='receivable_log']" position="after">
|
||||
|
||||
Reference in New Issue
Block a user