跳至内容
菜单
此问题已终结
2 回复
6798 查看

Hi All,

  1. I want to get the Manager id of the current Logged in user in OpenERP.

  2. I also need how to develop Serial number generator like HTK-001,HTK-002 etc for each row in a table.

Thanks in advance for your valuable help.

形象
丢弃
最佳答案

For the first you can try something like that (in python) :

users = self.pool.get('res.users').browse(cr, uid, uid)
manager_id = users.default_section_id.user_id.id

For the second, you can take a look on the sequence system already in use in OpenERP (Configuration > Technical > Sequence and Id > Sequences) and add your own.

形象
丢弃
编写者

Thanks for your valuable answer. But I got this ('NoneType' object has no attribute 'id') error when i used the first one. Kindly give a idea for that.

Maybe users is void ? Try to print variable.

最佳答案

Both items needs more flushing out to give you a good answer but:

  1. You can use the uid passed to a function to get any other information associated with the user that you need.

  2. This can be done with serial numbers, you can enable them in settings > User > Access Rights > Manage Serial Numbers and then enable them in the product Sales > Products > click on a product or add a new one > inventory tab > Track manufacturing lots.

形象
丢弃
相关帖文 回复 查看 活动
3
6月 25
1540
0
6月 24
2
1
9月 23
2759
5
3月 15
21298
0
3月 15
4377