Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4340 Lượt xem

Hello,

I've been trying for a long time to start sending an e-mail in Odoo8 with the employee's current timesheet by pressing the confirm button. I created a module in Python but I still don't know how to get the current employee timesheet.


I created a module in Python: 

I'm using smtplib to send email by SMTP Host.


And I change XML FormView in hr.timesheet.sheet.form

<button name="x_my_button_action_sending_email" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>

and it works!


But I don't know how to get current timesheet information to Python and then send it by email to current employee.

I need current employee email and his current timesheet information. I don't know how to get them from Odoo8.

Do you have any suggestion?

Ảnh đại diện
Huỷ bỏ

Send email on button click: https://goo.gl/z16PBZ

Tác giả

Thank you for your reply. It's really helpful but the point is I don't know how can I get current timesheet current user and his email address. Of course by Python.

Maybe different way:

I want send my timesheet to manager and to me by e-mail.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 16
3640
0
thg 8 16
2918
1
thg 6 16
3361
0
thg 6 16
3696
0
thg 5 16
3439