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

[18.0][MIG] account_credit_control: Migration to version 18.0 #437

Open
wants to merge 129 commits into
base: 18.0
Choose a base branch
from

Conversation

carlos-lopez-tecnativa
Copy link

Supersedes #418
TT54066
@Tecnativa @pedrobaeza @sergio-teruel @victoralmau @StefanRijnhart could you please review this?

@pedrobaeza
Copy link
Member

/ocabot migration account_credit_control

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Mar 10, 2025
@OCA-git-bot
Copy link
Contributor

The migration issue (#401) has not been updated to reference the current pull request because a previous pull request (#418) is not closed.
Perhaps you should check that there is no duplicate work.
CC @kevinkhao

@pedrobaeza
Copy link
Member

/ocabot migration account_credit_control

@OCA-git-bot OCA-git-bot mentioned this pull request Mar 10, 2025
7 tasks
@victoralmau
Copy link
Member

Please, cherry-pick #438 to commit history (before migration commit).

@StefanRijnhart
Copy link
Member

@victoralmau Just curious, but does the order of the commits matter?

@victoralmau
Copy link
Member

@victoralmau Just curious, but does the order of the commits matter?

IMO there are several reasons:

  • Readability: adding the commit in the right place will help to know quickly in the commit history whether that change was made before the migration or after.
  • Pre-commit: The right thing to do is to add the commit before the pre-commit commit so that if it is necessary to apply any change it is “separated” in that commit and does not confuse.
  • Migration: Adding the commit before will help to apply the changes that are necessary for the migration in the migration commit and thus to know the changes that really have been done in the migration (only those).

@ and others added 21 commits March 24, 2025 06:01
* Modify scenarios to be compatible with python scenarios
* Voucher/statement related steps
* Deprecated step implementation
* Print report generation
* All tests green
* Mail + print of reminder
* Broken translations
* Fix failure to confirm invoice when both account_credit_control  and account_constraints are installed
* use except_orm instead of except_osv
* reindent code
* Cleanup
* use of deprecated field user_email causes permission error in multicompany setting fixed by using the correct 'email' field in the template
* Address in mako template to make sure address is displayed
* Remove 'more info here' from report
* Add some css to reminder report and set texts taking the whole width of the document
* Add a subject in reminder report
* Report use precise mode by default
* date_entry fields on line model to be used by report or in next MP on filter group by
* reporting layer, + add hook function to get contact address
* credit control mail are not in plain text but send as attachement
* policy level name is now translatable as it is use in report and mail
* permission on invoices because onetomany widget load data even if hidden ...
* translation files + lang source
* french translation
* Translation + report invoice address layout
* Label Force credit control policy + french translation
* pep8 (space after comma, reduced length of lines)
* does not need to check if there is ids before calling unlink, it will return early
* remove unused import
* 'raise a new invoice' is a British English expression for 'issue a new invoice'
* scenarios: We fix year of scenario on 2013 to have reproducable setup, and ensure test maintnability. The credit control scenarios are based on base_finance setup scenario provided in the project OpenERP Scenarios. This setup provide a financial setup for 2012 2013. We also fix some value as precision computation has been improved in OpenERP.
* bug 1287072 Level calculation error if previous credit line is ignored
* unifing wizard views to respect UI guide lines
* credit control policy changer. Add a wizard on Invoice that will add a credit line and deprecate exisiting one on the invoice
* test to ensure that wizard run on customer invoice
* Scenario that test coherence of credit run after manually altering an invoice level
* multicurrency in communication
* ...
* Partner Form view: field "credit_limit" is defined in account module, not base
* Minimal Danish translation
* Do not link e-mails to Transient records

Transient records are deleted periodically so res_id will point to ID which
does not exists. And when reading email records system would also check if
res_id can be read by user which would cause an exception because res_id
might not exist at that point.
This fix seems ugly, but I cant figure why I've a security error when an invoice is  displayed for a user without right on credit_control despite the attribute 'groups' declared on the field definition in the form view
weblate and others added 27 commits March 24, 2025 06:01
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-16.0/credit-control-16.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_credit_control/
Currently translated at 100.0% (282 of 282 strings)

Translation: credit-control-16.0/credit-control-16.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_credit_control/es/
…eporting

This fixes the layout of the 'Credit Control Policy' notebook-page 'Mail and
reporting'.
Several related labels and fields not aligned (not on same line) and also the
translation buttons are invisible.
- Create setUpClass method if necessary
- Include context keys for avoiding mail operations overhead.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-16.0/credit-control-16.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_credit_control/
The method _generate_emails sets the credit.control.line record(s)
with state 'to_be_sent' to state 'queued' after sending the mail(s),
which is not right.
The state 'queued' is now set (from 'to_be_sent') before sending the
emails!

The mail.mail _postprocess_sent_message method sets the final state to
'sent' or 'error'.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/
Currently translated at 100.0% (278 of 278 strings)

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/it/
Before this commit, the existing code was obsolete because, in V17, the body field is computed, and _onchange_template_id no longer exists.
This commit adapts the code to correctly include invoice details in the email body.
…mail template

When a user with the group_account_credit_control_manager group tries to select a mail template, an access error is raised because model_id has permissions restricted to Administration/Access Rights. Instead of using a many2one field, the model field is used, as it is related and stored.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/
…the maximum level for one control run

Some ux improvements and minor fixes
Currently translated at 100.0% (280 of 280 strings)

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/it/
…to auto-subscribe in credit control lines

TT55207
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/
Currently translated at 100.0% (281 of 281 strings)

Translation: credit-control-17.0/credit-control-17.0-account_credit_control
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control/it/
…ation email

Changes done:
- Defined date_entry for the Invoice date column.
- Define amount_due for Invoice amount column
- Set balance_due for the Amount Due column

This data is the same as already shown in the Credit Control Summary report.

TT55608
…nd in the report for correct visualization

TT55608
@carlos-lopez-tecnativa carlos-lopez-tecnativa force-pushed the 18.0-mig-account_credit_control branch from e880b63 to f268c6d Compare March 24, 2025 11:06
@carlos-lopez-tecnativa
Copy link
Author

Please, cherry-pick #438 to commit history (before migration commit).

Done

<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
Copy link
Member

Choose a reason for hiding this comment

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

This should be better for performance (here and further below).

Suggested change
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
>['|', ('company_id','in',company_ids + [False])]</field>

@@ -270,7 +271,7 @@ def _generate_policy_lines_with_max_level(
return policy_lines_generated

@api.model
def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None):
def _search_display_name(self, operator, value):
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a test, given that the change went unnoticed on the original PR because there was no test before?

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.