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

Management wants to be included in PDF report the person who approved and when did they approved it, also when did the manager approved it?


Here in qweb, i find it difficult to pull an information like that. 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Anton, 

In your expense report these fields are available or not if these fields available in case you can add into PDF.

If this fields not available in that case kindly add these fields into backend (database) and based on that you can add into PDF. 

approve_id = fields.Many2one('res.users', string='Approved By')
approve_date_time = fields.Datetime(string='Approval Time')

def _get_approval(self):
​for res in self:
​res.approve_id = self.env.uid
​res.approve_date_time = datetime.now()

Thanks. 


Ảnh đại diện
Huỷ bỏ
Tác giả

Is there any way to do this in studio only? We are refraining to modify the backend code due to we are waiting for Odoo 18.

Yes you can achieve using odoo sutdio.

First you can add the fields using odoo studio and after you can add one automation rule base on your conditions.
Automation rule will help you to add the approval user and time input.
Add the custom field in your pdf.
Thanks.

Câu trả lời hay nhất

You can archive this by tracking, 

Example :  We have a Approve Button, by tracking that button using following fields,

button_click_time = fields.Datetime(string="Button Click Time", readonly=True, tracking=True)
button_clicked_by = fields.Many2one('res.users', string="Button Clicked By", readonly=True, tracking=True)

And add this function for the approve button,

def action_approve_button(self):
self.button_click_time = datetime.now()
self.button_clicked_by = self.env.user.id

By this we can easily show the data in a report.

Check and Clarify your doubts.

Ảnh đại diện
Huỷ bỏ
Tác giả

Is there any way to do this in studio only? We are refraining to modify the backend code.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 24
1525
2
thg 7 21
4713
1
thg 12 24
1556
1
thg 6 24
1537
1
thg 7 21
3375