Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1.     def create_accountant_user(self):
  2.         Group = Model.get('res.group')
  3.         accountant = Model.get('res.user')
  4.         accountant.name = 'Accountant'
  5.         accountant.login = 'accountant'
  6.         accountant.password = 'accountant'
  7.         account_group, = Group.find([('name', '=', 'Account')])
  8.         accountant.groups.append(account_group)
  9.         accountant.save()
  10.  
  11.         self.accountant = accountant
  12.  
  13. Traceback (most recent call last):
  14.   File "test_stock_invoice.py", line 42, in setUp
  15.     self.create_accountant_user()
  16.   File "test_stock_invoice.py", line 97, in create_accountant_user
  17.     accountant.groups.append(account_group)
  18.   File "/usr/local/lib/python2.7/dist-packages/proteus/__init__.py", line 224, in __get__
  19.     relation = Model.get(self.definition['relation'], instance._config)
  20. AttributeError: 'NoneType' object has no attribute '_config'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement