Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1382 Vues

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. 

Avatar
Ignorer
Meilleure réponse

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. 


Avatar
Ignorer
Auteur

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.

Meilleure réponse

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.

Avatar
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
1
avr. 24
1511
2
juil. 21
4687
1
déc. 24
1520
1
juin 24
1510
1
juil. 21
3367