Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 22, 2025

Steps to reproduce:

  • enable qr code
  • create an invoice with a swiss client
  • try to print it

Issue:
An error is raised

Cause:
There is no reference for a Swiss invoice in draft. If there is no reference, it is not possible to print the qr code in Switzerland.

Solution:
We prevent QR code generation whenever the invoice is in draft.

opw-4585574

Forward-Port-Of: #204661
Forward-Port-Of: #198498

@robodoo
Copy link
Contributor

robodoo commented Apr 22, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 22, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 22, 2025

This PR targets saas-18.2 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 22, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 22, 2025

@yosa-odoo @rugo-odoo ci/runbot failed on this forward-port PR

@yosa-odoo yosa-odoo force-pushed the saas-18.2-17.0-opw-4585574-swiss_qr_draft_invoice-yosa-430989-fw branch from 96c2dbf to 1c8fb27 Compare April 23, 2025 08:57
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 23, 2025

@yosa-odoo @rugo-odoo this PR was modified / updated and has become a normal PR. It must be merged directly.

Steps to reproduce:
- enable qr code
- create an invoice with a swiss client
- try to print it

Issue:
An error is raised

Cause:
There is no reference for a Swiss invoice in draft. If there is no reference, it is not possible to print the qr code in Switzerland.

Solution:
We prevent QR code generation whenever the invoice is in draft.
By setting display_qr_code to False we by passe the qr code generation
https://github.com/odoo/odoo/blob/d7770b7027b3668f906b8998d9d63df84ec1a7b3/addons/account/models/account_move.py#L4592-L4593

Note:
Two tests have been modified to take into account that a move should be qr_valid
https://github.com/odoo/odoo/blob/9e7ae71933e691205e21567d1b71c384fece7d3f/addons/l10n_ch/models/account_invoice.py#L44

Which is possible only if not in draft

opw-4585574

______ correction from odoo#205879
Through the many iteration, one of the condition was removed: odoo#198498

and `move.display_qr_code` is not enough to translate the apparently necessary condition `move.company_id.account_fiscal_country_id.code == 'CH'` odoo@84152f2

Testing the flow is quite complex without tour hence the the `assert`

X-original-commit: be08386
@yosa-odoo yosa-odoo force-pushed the saas-18.2-17.0-opw-4585574-swiss_qr_draft_invoice-yosa-430989-fw branch from 1c8fb27 to 4955c91 Compare April 23, 2025 11:02
@yosa-odoo yosa-odoo closed this Apr 29, 2025
@fw-bot fw-bot deleted the saas-18.2-17.0-opw-4585574-swiss_qr_draft_invoice-yosa-430989-fw branch May 6, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants