Thursday, June 26, 2025
2 changes · saas-18.1
Resolved issues and error corrections
This fix prevents duplicate Indian e-way bills from being created when demo data is loaded. It avoids invoice page errors and ensures demo invoices behave correctly for Indian localization users.
Original PR description
[FIX] l10n_in_ewaybill: Prevent duplicate e-way bills during demo data load
Steps to Reproduce:
1. Run the Odoo app from the terminal without installing demo data.
2. Install the l10n_in_ewaybill module.
3. Load demo data from the App Settings.
4. Select the IN Company.
5. Open any invoice.
Issue:
- An error occurs when opening the invoice page.
Reason:
- The method that generates demo data was being called twice during demo data loading.
- As a result, two e-way bills were created per invoice instead of one, which led to errors.
- Additionally, the condition in the account.move model was assuming only one e-way bill per invoice, causing incorrect logic.
Fix:
- Added a check before creating the e-way bill to verify whether it has already been created or not
- Also fixed the logic in the account.move model to properly handle the e-way bill state check.
task: 4777642This fix blocks E-way bill creation when the required e-invoice reference is missing or when the related document is not in an eligible state. It helps avoid failed submissions and compliance errors by ensuring users only generate E-way bills from valid documents.
Original PR description
In this commit: --- - Introduced a check to raise a UserError when attempting to generate an E-way bill without a IRN from the E-invoice. - Added state validations to ensure E-waybill is generated only when the document is in the correct state. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr