Skip to content

[16.0][TEST] Add unit test to demonstrate incorrect customer assignment when generating contract invoices#1142

Closed
rlizana wants to merge 2 commits intoOCA:16.0from
rlizana:16.0-contract_gen_invoice_several_partners
Closed

[16.0][TEST] Add unit test to demonstrate incorrect customer assignment when generating contract invoices#1142
rlizana wants to merge 2 commits intoOCA:16.0from
rlizana:16.0-contract_gen_invoice_several_partners

Conversation

@rlizana
Copy link
Copy Markdown

@rlizana rlizana commented Nov 8, 2024

This Pull Request adds a unit test in the contract module that highlights an error in the invoice generation process using the cron_recurring_create_invoice cron job.

Error Description
The issue occurs when multiple invoices are generated for contracts with different customers. Although the cron successfully creates the required invoices, the customer assigned to all the invoices is incorrect. Instead of assigning the correct customer to each invoice, the same customer is for all invoices.

Unit Test
The unit test configures multiple contracts with different customers and runs the cron job to generate recurring invoices. It checks that each invoice has the correct customer assigned, but the test fails, demonstrating the existing error.

@rlizana
Copy link
Copy Markdown
Author

rlizana commented Nov 8, 2024

The correct field to use for invoice customer assignment is invoice_partner_id, not partner_id. Despite the confusion, I’m leaving the unit test here in case it’s useful for extending the test coverage or as a reference for future use.

@rafaelbn rafaelbn added this to the 16.0 milestone Nov 14, 2024
@rafaelbn
Copy link
Copy Markdown
Member

@yajo please, could you review? Thank you! Ping @fcvalgar

@rousseldenis
Copy link
Copy Markdown
Contributor

Unit Test
The unit test configures multiple contracts with different customers and runs the cron job to generate recurring invoices. It checks that each invoice has the correct customer assigned, but the test fails, demonstrating the existing error.

@rlizana Tests are not failing... 😅

@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 16, 2025
@github-actions github-actions Bot closed this Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants