Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Get the manager id of a logged in user & Serial Number generator

By
Abul Hassan
on 8/27/13, 5:22 AM 1,870 views

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.

0
Xsias
On 8/27/13, 11:33 AM

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.

Abul Hassan
on 8/28/13, 8:33 AM

Maybe users is void ? Try to print variable.

Xsias
on 8/28/13, 9:22 AM
0

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 8/27/13, 11:37 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 8/27/13, 5:22 AM
Seen: 1870 times
Last updated: 3/16/15, 8:10 AM