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

[MIG] internal_transfer_with_agreed_amount: Migration to 17.0 t#71297 #1670

Merged

Conversation

CLaurelB
Copy link
Contributor

@CLaurelB CLaurelB commented Jun 13, 2024

Changelog:

  • Replace attrs with an expression for the invisible attribute in the view.
  • Add payment amount and currency update after the move is set to draft. This is because the undoing of the reconciliation triggers an update on the payment, and the amount gets updated to the previous agreed amount along with its corresponding currency. This happens when the agreed amount is edited.
  • Enable the euro currency in the test since it's required for multicurrency transfers.
  • Fix ambiguous variable name.

edy1192 and others added 16 commits June 13, 2024 13:36
- When foreign currencies are bought, in some cases an amount is agreed
for the transaction and it is not exactly that resulting from the
official exchange rate.

- When payments are made or received in foreign currency and the customer
or payment service uses its own exchange rate.

For these cases this module allows an internal transfer between
different currencies, setting an agreed amount.

This agreed amount will be used to set the amount currency in the
journal entries.

A new module is created to avoid duplication of code in different
clients that require this process.
…e&MX

The module depended on the enterprise's modules `account_accountant` and
`l10n_mx_edi`, which are not necessary.

In addition, tests were re-written to:
- Use currency EUR instead of MXN
- Use the Form class for the wizard
This removes:
- Hencoding headers, fixing lint `utf8-coding-comment`
- Headers like `# Part of Odoo`
- And other ones
Changelog:
- Apply the automatic changes from pre-commit-vauxoo
Changelog:
- Add or modify the header of xml files having the encoding as UTF-8
… their models

Following guidelines

Changelog:
- Every xml file must have have one model, the name of that model and
  the kind of the data, e.g. _data or _demo.
…and performance purposes

Changelog:
- Modify data putting IDs or names in the first position and then their
  values
- Make improvements in the code for performance or readability purposes
Changelog:
- Modify setUp to setUpClass improving performance for tests
…nherited records

Following guidelines, the inherited record must have the same external
ID as same as the original record.
After refactoring of code to update terms or assigning to the new
external IDs and move the translation file to i18n folder.
… to v16.0

- Update module version
- Update button name in the account payment views
- Remove update_posted field from account journal references in test
- Update act_window to field
- Refactor to the wizard to apply the functionality when there are two
  currencies in the internal transfer

Co-authored-by: Rolando Duarte <[email protected]>
…method

Modify in a single method the values that will be written in the account
move lines so that the method can be inherited in case it is necessary
to modify more values in the lines.

In addition, two methods are added to pre and post process payments, to
be used if modifications are required in an inheritance.

Finally, obtaining currencies related to the internal transfer have been
moved to a separate method to facilitate the inheritance of the method
that validates the number of currencies.

Changelog:
- Set debit and credit values to write in _prepare_values_from_lines
  method when the exchange currency is the same as the company currency.
- Add methods to be inherited when payments also needs modifications.
- Get the currencies in a new method named _get_currencies.
…ny currency

Change journal and currency in USD to use the company currency in order
to be able to run the tests when the company currency is different from
USD.

Chagelog:
- Change USD to the company currency.
- Remove USD from variables and replace them with local in some cases.
- Allow reconciliation to the company transfer account.
- Remove unused parameter from create_multicurrency_transfer method.
…internal_transfer_with_agreed_amount test

The test was failing due to an attempt to write to the invisible field
'destination_journal_id'. This occurred because the
'destination_journal_id' field was set to be invisible when the
'is_internal_transfer' field is not True. Consequently, when the
'journal_id' field changed in the form, the 'is_internal_transfer' value
changed to False, triggering the error.

This commit resolves the issue and prevents the AssertionError.
…ce path

This update corrects the path to the images in the README, ensuring they
are displayed properly.
@CLaurelB CLaurelB force-pushed the 17.0-mig-internal_transfer_with_agreed_amount branch 3 times, most recently from b654fd2 to 5387ace Compare June 13, 2024 22:27
@CLaurelB
Copy link
Contributor Author

@randall-vx @luisg123v could you review, please?

@CLaurelB CLaurelB changed the title [MIG] internal_transfer_with_agreed_amount: Migration to 17.0 [MIG] internal_transfer_with_agreed_amount: Migration to 17.0 t#71297 Jun 14, 2024
@luisg123v luisg123v self-requested a review June 14, 2024 01:47
CLaurelB added 2 commits June 18, 2024 15:32
Changelog:
- Replace `attrs` with an expression for the `invisible` attribute in
  the view.
- Add payment amount and currency update after the move is set to draft.
  This is because the undoing of the reconciliation triggers an update
  on the payment, and the amount gets updated to the previous agreed
  amount along with its corresponding currency. This happens when the
  agreed amount is edited.
- Enable the euro currency in the test since it's required for
  multicurrency transfers.
- Update translations file.
@CLaurelB CLaurelB force-pushed the 17.0-mig-internal_transfer_with_agreed_amount branch from 5387ace to 64c240c Compare June 18, 2024 15:47
@CLaurelB CLaurelB requested a review from luisg123v June 18, 2024 15:53
Copy link
Contributor

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@luisg123v luisg123v merged commit b87952b into Vauxoo:17.0 Jun 18, 2024
3 checks passed
@luisg123v luisg123v deleted the 17.0-mig-internal_transfer_with_agreed_amount branch June 18, 2024 18:40
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.

4 participants