Skip to content
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

[IMP] account,*: check invoice report in separate function #147124

Closed
wants to merge 1 commit into from

Conversation

remi-filament
Copy link
Contributor

@remi-filament remi-filament commented Dec 21, 2023

*: account_edi, account_edi_ubl_cii, l10n_ch

Description of the issue/feature this PR addresses:
This PR moves the check whether requested report is an invoice one in a separate function so that it can be inherited in case we need to have extra invoice report formats.

Current behavior before PR:
In case you generate new invoice reports, EDI document will not be included unless you rewrite (or copy/update) the full code of _render_qweb_pdf() and _render_qweb_pdf_prepare_streams() functions.

Desired behavior after PR is merged:
With this PR, you can only inherits _is_invoice_report() function to add your new report name.

Since this is a IMP PR, I am not sure it would be OK to have it in 16.0 (which is where I would need the functionality for now) ? So I made this PR on v16.0 but also another one on master : #147120 (since in 17.0 and master account_edi_ubl_cii does not need update there)


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Dec 21, 2023

Copy link
Contributor

@FlorianGilbert FlorianGilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only a comment on your hook function
IMO, it's okay to add it in 16.0 but I'm not sure to understand why it's not necessary for 17.0 but for master?

addons/account/models/ir_actions_report.py Outdated Show resolved Hide resolved
@remi-filament
Copy link
Contributor Author

Thanks @FlorianGilbert, it makes sense !
Great if this can be added to 16.0, then I would make another PR for 17.0 that could then be forwarded to master (I did not make the 17.0 yet, since I was not sure if this could go in stable, but the requested change to be made for 17.0 is the same as for master)

@remi-filament remi-filament force-pushed the 16.0-imp-account_report branch 2 times, most recently from dae69ba to a89fecc Compare January 8, 2024 16:27
Copy link
Contributor

@FlorianGilbert FlorianGilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @remi-filament

It seems your runbot is red, could you please rebase your branch, it should fix it :)
Thank you

@remi-filament
Copy link
Contributor Author

@FlorianGilbert done

@@ -44,10 +44,13 @@ def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
}
return collected_streams

def _is_invoice_report(self, report_ref):
return True if self._get_report(report_ref).report_name in ('account.report_invoice_with_payments', 'account.report_invoice') else False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems your rebase changes this part of code for the original code you made. Could you please simplify as requested before? Thank you :)

*: account_edi, l10n_ch

Co-authored-by: Florian Gilbert <flg@odoo.com>
@remi-filament
Copy link
Contributor Author

Sorry about that, I thought it was the other way around... Just fixed it

Copy link
Contributor

@FlorianGilbert FlorianGilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, thank you for your contribution 😄

@robodoo r+

robodoo pushed a commit that referenced this pull request Jan 11, 2024
*: account_edi, l10n_ch

closes #147124

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Co-authored-by: Florian Gilbert <flg@odoo.com>
@robodoo robodoo closed this Jan 11, 2024
remi-filament added a commit to lefilament/odoo that referenced this pull request Jan 12, 2024
*: account_edi, l10n_ch

closes odoo#147124

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Co-authored-by: Florian Gilbert <flg@odoo.com>
@fw-bot
Copy link
Contributor

fw-bot commented Jan 15, 2024

2 similar comments
@fw-bot
Copy link
Contributor

fw-bot commented Jan 16, 2024

@fw-bot
Copy link
Contributor

fw-bot commented Jan 17, 2024

1 similar comment
luanjubica pushed a commit to luanjubica/odoo-code that referenced this pull request Feb 14, 2024
*: account_edi, l10n_ch

closes odoo#147124

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Co-authored-by: Florian Gilbert <flg@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants