-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Odoo 15.0] - [om_account_followup] - Subject Line on PDF Report #75
Comments
Thanks for the code snippet, we have tried this update locally before merging, if you have time, can you connect us in email or show us what changes it will be bring to the report by updating the above code |
Yes of course, the yellow marked text is added to the report which is the
name of the current follow-up level
[image: subjectline on pdf.JPG][image: title origin.JPG]
Am Fr., 22. Juli 2022 um 06:20 Uhr schrieb Odoo Mates <
***@***.***>:
… Thanks for the code snippet, we have tried this update locally before
merging, if you have time, can you connect us in email or show us what
changes it will be bring to the report by updating the above code
—
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2BY72QURMSWYBDPZGCO7G3VVIOQ7ANCNFSM54DLZKBA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
mit freundlichen Grüßen
Frank Härtwig
|
seems the image doesn't get uploaded |
i've send the mail to your gmail.com address again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue: Missing subject line on printed payment follow-up report
Howto: Steps to add subject line similar to text
File: \om_account_followup\report\followup_print.py
Function: def _get_report_values
original code:
return { 'docs': docs, 'doc_ids': docids, 'doc_model': model, 'time': time, 'ids_to_objects': self._ids_to_objects, 'getLines': self._lines_get, 'get_text': self._get_text, 'data': data and data['form'] or {}}
possible change:
return { 'docs': docs, 'doc_ids': docids, 'doc_model': model, 'time': time, 'ids_to_objects': self._ids_to_objects, 'getLines': self._lines_get, 'get_text': self._get_text, 'get_title': self._get_title, 'data': data and data['form'] or {}}
File: \om_account_followup\report\followup_print.py
Function: def _get_title
possible change:
def _get_title(self, stat_line, followup_id, context=None): fp_obj = self.env['followup.followup'] fp_line = fp_obj.browse(followup_id).followup_line if not fp_line: raise ValidationError( _("The followup plan defined for the current company does not " "have any followup action.")) default_title = '' li_delay = [] for line in fp_line: if not default_title and line.description: default_title = line.description li_delay.append(line.delay) li_delay.sort(reverse=True) partner_line_ids = self.env['account.move.line'].search( [('partner_id', '=', stat_line.partner_id.id), ('full_reconcile_id', '=', False), ('company_id', '=', stat_line.company_id.id), ('blocked', '=', False), ('debit', '!=', False), ('account_id.user_type_id.type', '=', 'receivable'), ('followup_line_id', '!=', False)]) partner_max_delay = 0 partner_max_title = '' for i in partner_line_ids: if i.followup_line_id.delay > partner_max_delay and \ i.followup_line_id.description: partner_max_delay = i.followup_line_id.delay partner_max_title = i.followup_line_id.name title = partner_max_delay and partner_max_title or default_title return title
opinion: its the same function which used for the _get_text but changed to return the title
File: \om_account_followup\views\report_followup.xml
original code:
<p t-raw="get_text(o,data['followup_id']).replace('\n', '<br>')"/>
possible change:
<p t-esc="get_title(o,data['followup_id'])"/> <p t-raw="get_text(o,data['followup_id']).replace('\n', '<br>')"/>
opinion: I'd prefer to have the title a bit bigger like the original odoo report subject lines but couldn't find a smart way to do it, for the moment i use
<p style="font-size:2em;" t-esc="get_title(o,data['followup_id'])"/>
The text was updated successfully, but these errors were encountered: