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

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

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

rlizana
Copy link

@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
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
Member

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

@rousseldenis
Copy link
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... 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants