account-invoicing icon indicating copy to clipboard operation
account-invoicing copied to clipboard

[14.0][MIG] account_invoice_refund_reason: Migration to 14.0

Open Reyes4711-S73 opened this issue 2 years ago • 5 comments

Standard migration to 14.0

Reyes4711-S73 avatar Apr 13 '22 10:04 Reyes4711-S73

This PR could be merged? @OCA/accounting-maintainers

Reyes4711-S73 avatar May 16 '22 14:05 Reyes4711-S73

@Reyes4711 I ran test on my compute and got some error. Here are the steps,

  1. Create new database,
  2. 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
  1. 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 avatar May 17 '22 04:05 kittiu

@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,

Reyes4711-S73 avatar May 17 '22 06:05 Reyes4711-S73

Hi @Reyes4711-S73

I would like to review to get this merged, could you rebase?

JordiMForgeFlow avatar Oct 17 '22 12:10 JordiMForgeFlow

@JordiMForgeFlow rebase done

Reyes4711-S73 avatar Oct 17 '22 13:10 Reyes4711-S73

please cherry-pick f43f1e703c71e0491b47d3bd2eae5ff32cf76bf7

MiquelRForgeFlow avatar Oct 21 '22 10:10 MiquelRForgeFlow

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?

AaronHForgeFlow avatar Oct 24 '22 12:10 AaronHForgeFlow

@MiquelRForgeFlow Cherry pick done

Reyes4711-S73 avatar Oct 24 '22 13:10 Reyes4711-S73

@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 avatar Oct 24 '22 13:10 Reyes4711-S73

@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.

AaronHForgeFlow avatar Oct 24 '22 13:10 AaronHForgeFlow

@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

AaronHForgeFlow avatar Oct 27 '22 11:10 AaronHForgeFlow

Sorry, the module is already on the base branch I am closing this to prevent confusion.

AaronHForgeFlow avatar Nov 02 '22 09:11 AaronHForgeFlow

@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 avatar Nov 02 '22 11:11 Reyes4711-S73

@Reyes4711-S73 Good to know :) Thanks!

AaronHForgeFlow avatar Nov 02 '22 12:11 AaronHForgeFlow