Conversation
…assignment on invoice generation from cron
…different customers
|
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. |
@rlizana Tests are not failing... 😅 |
|
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. |
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.