1.如何篩選到低昂前用戶可訪問(wèn)的歸口
歸口管理分類
def _get_centralized_cls_ids(self):
ids = []
user = self.env.user
for rec in self.env['kthrp.base.centralized.classification'].search([]):
users = rec.group_ids.mapped('users')
if user.id in users.ids or not users:
ids.append(rec.id)
return ids
2.excel報(bào)表的將多列合并
ws.merge_range(line_number, 0, row_pos - 1, 0, line['sequence'], font_format_vcenter)
3.報(bào)表js動(dòng)作注冊(cè)
core.action_registry.add('supplier_purchase_amount_report', SupplierPurchaseAmountReport);
第一個(gè)參數(shù)是定義的tag 第二個(gè)參數(shù)是初始化的名稱
var SupplierPurchaseAmountReport = Widget.extend({
4.定義js動(dòng)作時(shí)一定要有,不然在模板中就會(huì)獲取不到數(shù)據(jù)了
init: function (parent, context) {
this._super(parent);
if (context.context.active_id) {
this.report_id = context.context.active_id;
sessionStorage.setItem("report_id", this.report_id);
}
else {
this.report_id = parseInt(sessionStorage.getItem("report_id"));
}
this.context = context.context;
},