Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1537 Widoki

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. 

Awatar
Odrzuć
Najlepsza odpowiedź

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. 


Awatar
Odrzuć
Autor

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.

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 24
1661
2
lip 21
4860
1
gru 24
1701
1
cze 24
1640
1
lip 21
3464