Esempio n. 1
0
    def set_width(self, model, fields):
        '''
        Set width for the current user on the model.
        fields is a dictionary with key: field name and value: width.
        '''
        ids = self.search([
            ('user', '=', Transaction().user),
            ('model', '=', model),
            ('field', 'in', fields.keys()),
            ])
        self.delete(ids)

        for field in fields.keys():
            self.create({
                'model': model,
                'field': field,
                'user': Transaction().user,
                'width': fields[field],
                })
Esempio n. 2
0
    def set_width(cls, model, fields):
        '''
        Set width for the current user on the model.
        fields is a dictionary with key: field name and value: width.
        '''
        records = cls.search([
            ('user', '=', Transaction().user),
            ('model', '=', model),
            ('field', 'in', fields.keys()),
        ])
        cls.delete(records)

        to_create = []
        for field in fields.keys():
            to_create.append({
                'model': model,
                'field': field,
                'user': Transaction().user,
                'width': fields[field],
            })
        if to_create:
            cls.create(to_create)
Esempio n. 3
0
    def set_width(cls, model, fields):
        '''
        Set width for the current user on the model.
        fields is a dictionary with key: field name and value: width.
        '''
        records = cls.search([
            ('user', '=', Transaction().user),
            ('model', '=', model),
            ('field', 'in', fields.keys()),
            ])
        cls.delete(records)

        to_create = []
        for field in fields.keys():
            to_create.append({
                    'model': model,
                    'field': field,
                    'user': Transaction().user,
                    'width': fields[field],
                    })
        if to_create:
            cls.create(to_create)
Esempio n. 4
0
    def set_width(cls, model, fields):
        """
        Set width for the current user on the model.
        fields is a dictionary with key: field name and value: width.
        """
        records = cls.search([("user", "=", Transaction().user), ("model", "=", model), ("field", "in", fields.keys())])
        cls.delete(records)

        to_create = []
        for field in fields.keys():
            to_create.append({"model": model, "field": field, "user": Transaction().user, "width": fields[field]})
        if to_create:
            cls.create(to_create)