- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在odoo会计模块中,有一个导入银行对账单的选项。导入完成后,它会自动将您重定向到对帐 View ,但我想将其重定向到会计仪表板。
我发现重定向是由这段 JavaScript 代码完成的:
enterprise-13.0/account_bank_statement_import_csv/static/src/js/import_bank_stmt.js:58
exit: function () {
this.do_action({
name: _t("Reconciliation on Bank Statements"),
context: {
'statement_line_ids': this.statement_line_ids
},
type: 'ir.actions.client',
tag: 'bank_statement_reconciliation_view'
});
},
我尝试修改代码以重定向到会计仪表板,但没有成功。
exit: function () {
var self = this;
console.log("JavaScript redirection after importing");
// var model_obj = new instance.web.Model('ir.model.data');
// var view_id = false;
// model_obj.call('get_object_reference', ['ir.ui.view', 'account.account_journal_dashboard_kanban_view']).then(function (result) {
// view_id = result[1];
// });
// console.log('view_id');
// console.log(view_id);
// this._rpc({
// model: 'account.move',
// method: 'redirect_return', // Python code that returns the data of the view action.
// }).then(function (result) {
// self.do_action(result);
// });
this.do_action({
name: _t("Reconciliation on Bank Statements"),
context: {
'statement_line_ids': this.statement_line_ids
},
type: 'ir.actions.client',
tag: 'bank_statement_reconciliation_view'
});
},
请您帮忙。
最佳答案
您可以使用 this._rpc
获取 View id,然后调用 do_action
进行重定向。
self._rpc({
model: "ir.model.data",
method: 'get_object_reference',
args: ['account', 'view_account_invoice_report_graph']
}).then(function (result) {
self.do_action({
name: _t('Invoices Analysis'),
type: 'ir.actions.act_window',
res_model: 'account.invoice.report',
views: [[result[1], 'graph']],
view_mode: 'graph',
});
});
您还可以使用操作外部id来读取操作数据
self._rpc({
model: "ir.model.data",
method: 'get_object_reference',
args: ['account', 'action_account_invoice_report_all']
}).then(function (result) {
self._rpc({
model: "ir.actions.act_window",
method: 'read',
args: [[result[1]]]
}).then(function (actions){
self.do_action(actions[0]);
});
});
关于javascript - 当我完成导入数据提取后,如何重定向到会计仪表板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60962254/
我正在制作一份会计报告,其中一份报告需要列出给定日期后过去四个星期内的所有发布日期。 发布日期是一周的最后一天,在我们的例子中是周日或者该月的最后一天。 例如。如果我输入 12/1/2019 那么我将
如果苹果用户收到来自 firebase 应用程序分发的邀请,他需要一个谷歌帐户才能加入测试组,这是否正确? 在没有谷歌帐户的情况下使用它有什么建议吗? 最佳答案 当您创建 Google 帐户时,您会自
背景:我们构建了一个产品,通过注释和自定义类加载器向 Java 添加各种功能(事务、基于共享内存的对象持久性、索引和查询、基于集群的高可用性和复制)。这些功能的大部分实现都在 C++ 库中,这些库可通
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
我有一个 Go/AppEngine 应用程序,我正在尝试对其进行微调以优化当前受 cpu 限制的并发请求。在这样做的过程中,我看到日志中的 cpu_ms 和仪表板中的 average runtime
我是一名优秀的程序员,十分优秀!