This commit is contained in:
李鹏宇
2026-03-10 10:23:40 +08:00
4 changed files with 20 additions and 14 deletions
@@ -399,7 +399,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
partners = self.env['res.partner'].search([])
bus_message = {'type': 'wkf_notify'}
notifications = [[partner, 'sun_badge_menu.reload_menu_data', [bus_message]] for partner in partners]
self.env["bus.bus"]._sendmany(notifications)
# self.env["bus.bus"]._sendmany(notifications) # 浏览器叮咚
def add_comment(self):
self.ensure_one()
@@ -9,9 +9,9 @@ import {escape, sprintf} from "@web/core/utils/strings";
import {Component, markup, onMounted, xml} from "@odoo/owl";
export function clickRefreshButton() {
document.querySelector('button[name="sh_refresh"].sh_refresh')?.click();
}
// export function clickRefreshButton() {
// document.querySelector('button[name="sh_refresh"].sh_refresh')?.click();
// }
/**
* Client action to go back home.
*/
@@ -5,7 +5,7 @@ import { patch } from "@web/core/utils/patch";
import { deepCopy } from "@web/core/utils/objects";
import { useService } from "@web/core/utils/hooks";
import { url } from "@web/core/utils/urls";
import { clickRefreshButton } from "../actions/client_actions"
// import { clickRefreshButton } from "../actions/client_actions"
const WKF_NOTIFY_TYPE = 'wkf_notify'
@@ -28,13 +28,19 @@ patch(NavBar.prototype, {
for (const d of detail) {
if (d?.type === WKF_NOTIFY_TYPE) {
this.menuService.reload();
return this.audio.play()
.then(() => {
clickRefreshButton();
}).catch((e) => {
console.log(e)
});
return this.audio.play().catch((e) => {
console.log(e)
});
}
// if (d?.type === WKF_NOTIFY_TYPE) {
// this.menuService.reload();
// return this.audio.play()
// .then(() => {
// clickRefreshButton();
// }).catch((e) => {
// console.log(e)
// });
// }
}
const oldMenuApps = deepCopy(this.menuService.getApps())
@@ -63,7 +69,7 @@ patch(NavBar.prototype, {
}
}
}
clickRefreshButton();
// clickRefreshButton();
}, 300)
});
}
@@ -35,14 +35,14 @@ class PropertyRentalWizard(models.Model):
rent_id = self.env['property.rent.list'].search([
('contract_id', '=', record.id),
('property_id', '=', property_id),
('due_date', '>=', first_day_of_month),
('due_date', '>', first_day_of_month),
('due_date', '<=', last_day_of_month),
])
# 判断是否有已生成应收
existing_receivable = self.env['property.accounts.receivable'].search([
('lessee_id', '=', record.lessee_id.id),
('due_date', '>=', first_day_of_month),
('due_date', '>', first_day_of_month),
('due_date', '<=', last_day_of_month),
('management_type_id.name', '=', '租金'),
('contract_id', '=', record.id),