예제 #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],
                })
예제 #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)
예제 #3
0
파일: view.py 프로젝트: kret0s/tryton3_8
    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)
예제 #4
0
파일: view.py 프로젝트: openlabs/trytond
    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)