-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
[17.0][MIG] account_statement_import_move_line: Migration to version 17.0 #732
[17.0][MIG] account_statement_import_move_line: Migration to version 17.0 #732
Conversation
…atement_import_move_line It was renamed already in v14, so it must be this new name here, but it was incorrectly migrated and merged. For keeping compatibility, a copy is done instead.
bb215d7
to
8e15b15
Compare
/ocabot migration account_statement_import_move_line |
account_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py
Outdated
Show resolved
Hide resolved
0a5d507
to
630da1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and functional review OK
bank_journal = self.env["account.journal"].search( | ||
[("type", "=", "bank")], limit=1 | ||
) | ||
statement.journal_id = bank_journal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not necessary because it will be defined automatically when a line is created; if you should specify in the _prepare_statement_line_vals()
method the journal_id
that corresponds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An statement assigns journals of type "bank" or "cash" to its lines when they are created. In version 15, statement lines did not have an associated journal and the journal of the statement was set. The wizard imports invoice lines that may have a journal other than ‘bank’ or ‘cash’ and when creating them, it must be done with the journal associated with the extract if it already contains previous lines that have established it or, as is done when creating them from the form, establish by default a journal of type ‘bank’ in this case, as they are created from that journal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being a computed field, you need to infer the journal other way. Include it in the wizard, and fill it depending on the context (I think it's included in the context when coming from the dashboard).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have decided to keep the current logic for cases where a statement with added lines already exists, in case more lines need to be added, limiting the visibility of the current button to the condition "not journal_id."
Additionally, I have added the option to import lines from the dashboard by creating a new statement.
If at some point you permanently lose the form view of the statement, you can continue with the new dashboard option.
b8c8ca1
to
593a240
Compare
Maybe it's better to reorder the commits to put the fix before migration commits. |
…ment lines The ‘ref’ field is not visible on invoices of type ‘out_invoice’. In the tests, it is adding value to this field and therefore does not fail to create a bank statement line where the ‘payment_ref’ field is required. To solve this, the value of the ‘payment_ref’ field of the bank statement lines is set as the reference of a supplier invoice (‘ref’ in invoice lines) or as the reference of the payment ‘payment_reference’ (‘name’ in invoice lines).
593a240
to
f2e2d73
Compare
f2e2d73
to
86111d3
Compare
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 633ad9f. Thanks a lot for contributing to OCA. ❤️ |
cc @Tecnativa TT51242
@pedrobaeza @victoralmau please review