Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3232 Переглядів

Hi all, 

When a user log on, I want that when he creates a sale order, he gets the default shop affected to him.

For that I created a field named x_usr on sale.shop, type many2one, relation : res.users.

on the sales module, I updated the sale.py file, exactly the get_default_shop method like this :

def _get_default_shop(self, cr, uid, context=None):
        shop_ids = self.pool.get('sale.shop').search(cr, uid, [('x_usr','=',uid)], context=context)
        if not shop_ids:
            raise osv.except_osv(_('Error!'), _('There is no default shop for the current user\'s company!'))
        return shop_ids

But there is no change, I restarted the openerp server, and updated modules list, but with no success. 

Any suggestions please.

Regards.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 15
3971
1
серп. 25
156
My account will expire. Вирішено
2
лип. 25
651
2
черв. 25
1201
1
трав. 25
1165