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
[14.0][REF] account_payment_*: Use native payment object #979
[14.0][REF] account_payment_*: Use native payment object #979
Conversation
@alexis-via @sbidoul @HaraldPanten @ValentinVinagre @carlosdauden here it's the long awaited refactoring to make use of the native See individual commits in order to have better comprehension of the process. Working on the migration scripts now. |
b614d96
to
ea0c8d7
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.
At some point we should extend the account.move method def _get_invoice_in_payment_state(self):
to return 'in_payment' to activate the payment status "In process" at the invoices.
https://github.com/odoo/odoo/blob/e337a7b4b0da970041ea26d6fdc6e2d39eb3e5be/addons/account/models/account_move.py#L1389
Indeed, but that's the next step not included in this PR. |
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 reviewed and tested and everything is correct, I am waiting for the migration scripts to approve
10a5c79
to
5f96b29
Compare
First tests seem to be working fine. But I'll need more time to check it properly. Have you tested it in "semi-real" use cases? |
48ef4f9
to
927ac5e
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.
We should synchronize PR merge with changes in these modules so as not to cause malfunctions:
e54f205
to
347d38e
Compare
Migration scripts are completed and tested on a real environment with all the possible cases, as well as the features of the module. We have an slower payment order confirmation due to the full creation of the account.payment + account.move, but faster times later on "File successfully uploaded" phase. |
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
Done on: |
347d38e
to
121913d
Compare
…payment refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
I'm removing that leftovers in #1015, but there can't be equivalent options, as now each |
They are ignored since OCA#979, and there can't be equivalent.
Great work, thank you ! |
Yes, indeed. I want to do it for 15.0, but no time for now. Do you want to do it? I will review it. It should be pretty straight-forward. |
Adapt to the "revolution" in account_payment_order that now uses native payment object, introduced by PR OCA/bank-payment#979
They are ignored since OCA#979, and there can't be equivalent.
They are ignored since OCA#979, and there can't be equivalent.
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
@@ -281,18 +278,19 @@ def generated2uploaded(self): | |||
to_expire_mandates = abmo.browse([]) | |||
first_mandates = abmo.browse([]) | |||
all_mandates = abmo.browse([]) | |||
for bline in order.bank_line_ids: | |||
if bline.mandate_id in all_mandates: | |||
for payment in order.payment_ids: |
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.
@pedrobaeza This field payment_ids
doesn't exist on account.payment.order
model.
Or maybe there is a missing dependency?
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.
… refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
… refactoring Following OCA/bank-payment#979
They are ignored since OCA#979, and there can't be equivalent.
…payment refactoring Following OCA/bank-payment#979
…payment refactoring Following OCA/bank-payment#979
The previous approach creates manually the journal entries and does all the hard work, plus not being 100% compatible with the bank statement reconciliation widget (requiring a patch on OCB to see blue lines).
That decision made sense on the moment it was done (v9), where the native payment model (account.payment) was very limited, and wasn't able to store all the needed information for the bank transaction.
Now that the limitations are gone, we can get rid off this extra model, and generate instead
account.payment
records, using both the native model + methods to perform the same operations.This serves also to workaround the problem found in #966.
All the code, views and tests of main module have been adapted to this new approach
@Tecnativa TT39832