Skip to content

Conversation

@yvaucher
Copy link
Member

Forward port of #22

In case of recurring invoicing you might have multiple lines with different levels, however you don't want to multiply the communications to the creditor.

This adds the possibility to communicate only the highest due and attach the lower levels to it to not de-multiply the communications.

Compared to Apply max policy level, the aim is to keep distinct level values on credit lines and not create them at the same level.

"Auto Process Lower levels" means that you have to care only about the highest level and that other lines for the same partner, policy will be communicated as well.

@yvaucher yvaucher requested a review from qgroulard July 11, 2025 12:30
Copy link
Contributor

@len-foss len-foss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ADD] is supposed to be for new modules. Here there's a small [REF] refactoring of the module, and mostly [IMP] improvements to it. Which I'm not sure should go into it and not into another module. The rationale for that is that this module is already quite buggy, so I would think keeping it as lightweight as possible would be best.

@yvaucher yvaucher force-pushed the 18.0-credit_control_auto_process_lower_levels-ypt branch from 195a0ab to b47175e Compare July 15, 2025 09:05
@yvaucher
Copy link
Member Author

@len-foss Thanks for your input, I'll modify this PR to create a module account_credit_control_aggregate_level to extract this feature.

@len-foss
Copy link
Contributor

len-foss commented Jul 15, 2025

@yvaucher that's great!
Since you're working on it, it would be good if you also have a check at #467
This PR mainly makes sure that it's the postprocess that update the line status based on whether the mail was really sent or not.

There's another that you're unlikely to catch with simple test:
#430
introduced a threading mechanism that makes that a good part of the emails are never sent because they're opened with their own cursor, they get a PoolError('The Connection Pool Is Full'), so the run is partly done. The lines have been marked as queued so without modifying data with a server action you have no way to recover from this state.
(so to test it, you need a number of lines that exceeds ODOO_MAX_HTTP_THREADS)
I'll push a PR this afternoon.

@yvaucher yvaucher changed the title [18.0][ADD] account_credit_control - Auto process lower levels [18.0][ADD] account_credit_control_aggregate_level - Aggregate multiple levels in credit lines to make single communications Jul 15, 2025
@yvaucher yvaucher force-pushed the 18.0-credit_control_auto_process_lower_levels-ypt branch 7 times, most recently from 3b739fb to 926387a Compare July 16, 2025 08:11
qgroulard and others added 2 commits July 22, 2025 10:29
Add the possibility to mark a policy so that processing a line generated by this policy
will also process lower level lines for the same partner (and policy).

Also add a filter for credit control line tree view in order to only display
highest level lines for each partner and policy.
Revert to the SQL query and extend it with auto_process, ignoring level to group more lines.
Revert the yielding method to simply order lines on search to get the highest level in an auto_process group.
@yvaucher yvaucher force-pushed the 18.0-credit_control_auto_process_lower_levels-ypt branch 4 times, most recently from 8ec67c9 to 12ffa8f Compare July 22, 2025 09:05
This is an extraction of the feature added in account_credit_control
@qgroulard qgroulard force-pushed the 18.0-credit_control_auto_process_lower_levels-ypt branch from 12ffa8f to a9017b1 Compare November 4, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants