2021-07-18

1.如何筛选到低昂前用户可访问的归口

归口管理分类

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报表的将多列合并

ws.merge_range(line_number, 0, row_pos - 1, 0, line['sequence'], font_format_vcenter)

3.报表js动作注册

core.action_registry.add('supplier_purchase_amount_report', SupplierPurchaseAmountReport);

第一个参数是定义的tag 第二个参数是初始化的名称

var SupplierPurchaseAmountReport = Widget.extend({

4.定义js动作时一定要有,不然在模板中就会获取不到数据了

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;
    },

你可能感兴趣的:(2021-07-18)