account-invoicing
account-invoicing copied to clipboard
[14.0][MIG] account_invoice_refund_reason: Migration to 14.0
Standard migration to 14.0
This PR could be merged? @OCA/accounting-maintainers
@Reyes4711 I ran test on my compute and got some error. Here are the steps,
- Create new database,
- Install this module + test during install got following,
2022-05-17 04:48:18,576 1 INFO devel odoo.addons.account_invoice_refund_reason.tests.test_account_invoice_refund_reason: ======================================================================
2022-05-17 04:48:18,576 1 ERROR devel odoo.addons.account_invoice_refund_reason.tests.test_account_invoice_refund_reason: ERROR: TestAccountInvoiceRefundReason.test_onchange_reason_id
Traceback (most recent call last):
File "/opt/odoo/auto/addons/account_invoice_refund_reason/tests/test_account_invoice_refund_reason.py", line 25, in setUp
self.journalrec = self.journal_obj.search([("type", "=", "sale")])[0]
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5690, in __getitem__
return self.browse((self._ids[key],))
IndexError: tuple index out of range
- The module can be installed though. But then, I ran test again and got following,
2022-05-17 04:48:51,649 1 INFO devel odoo.addons.account_invoice_refund_reason.tests.test_account_invoice_refund_reason: ======================================================================
2022-05-17 04:48:51,649 1 ERROR devel odoo.addons.account_invoice_refund_reason.tests.test_account_invoice_refund_reason: ERROR: TestAccountInvoiceRefundReason.test_onchange_reason_id
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5166, in _update_cache
field_values = [(fields[name], value) for name, value in values.items()]
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5166, in <listcomp>
field_values = [(fields[name], value) for name, value in values.items()]
KeyError: 'payment_term_id'
May be some problem with the Test Script? Can you check please.
Note: Test manually, it is ok.
@kittiu I review your suggestions and I refactor the test code, and they are done. Otherwise, I restore the original name of the model account.invoice.refund.reason. If you see this ok, could you approve this PR? Thank you,
Hi @Reyes4711-S73
I would like to review to get this merged, could you rebase?
@JordiMForgeFlow rebase done
please cherry-pick f43f1e703c71e0491b47d3bd2eae5ff32cf76bf7
Hi @Reyes4711-S73 , there is an older PR for the migration of this module: https://github.com/OCA/account-invoicing/pull/1041 This PR should be closed in favor of that one, unless the author of the other PR agrees, or the migration of that that PR is invalid. Can you ask in the other PR?
@MiquelRForgeFlow Cherry pick done
@AaronHForgeFlow I think the other PR must be closed due to the fact that their test fail and my test pass. This supposes more reliability in the code and nowadays is more updated.
@Reyes4711-S73 I understand that this migration could be a better one. However, the convention says: first come, first serve. Unless the other author abandons the PR or agrees to close it. I will ask in the other PR is he/she agrees to close that one.
@Reyes4711-S73 another PR was done for this: https://github.com/OCA/account-invoicing/pull/1273, that one takes into account all the work done in all the migration attempts and putting everyone as author of the commit. Is it ok to continue with that one? If it is ok to you I will merge https://github.com/OCA/account-invoicing/pull/1273
Sorry, the module is already on the base branch I am closing this to prevent confusion.
@AaronHForgeFlow Sorry, but I hadn't been at the office and I couldn't review all messages. I think your PR was OK.
@Reyes4711-S73 Good to know :) Thanks!