hi am in multi company odoo accounting in v.11 i have 13 company each company have user a i want to know how i can know the connected user in datatbase , i need it for a report that i created.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
thanks for your reponse but am using query clause to create report and i want to add consition to get just the connected company because this company get all record
SELECT
code as x_compte , account_move_line.name as x_designation ,account_move_line.debit as x_debit ,account_move_line.credit as x_credit, account_move.narration as x_observation
FROM account_account JOIN account_move_line on account_account.id = account_move_line.account_id
JOIN account_move on account_move_line.move_id = account_move.id
JOIN res_users on account_move_line.company_id = res_users.company_id
JOIN login_detail on login_detail.name = res_users.login
where substring (code,1,1) ='5'
You can get the current user in a variable and print in your report.
current_user_name = self.env.user.name
current_user_id = self.env.user
in your python code you can get active user id :
current_uid = self._context.get('uid')
user_obj = self.env['res.users'].browse(current_uid)
after that you can access the company or companies of that user (user_obj )
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 9 22
|
7145 | ||
|
1
thg 8 22
|
4692 | ||
|
5
thg 2 20
|
11973 | ||
|
2
thg 2 19
|
2785 | ||
|
0
thg 2 19
|
3841 |
try this: https://www.pinterest.com/pin/711005859915282446/