-
-
Couldn't load subscription status.
- Fork 577
[18.0][MIG] account_payment_mode_default_account #1488
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] account_payment_mode_default_account #1488
Conversation
65a1c9c to
a21e369
Compare
| account_common.AccountTestInvoicingCommon.collect_company_accounting_data = classmethod( | ||
| _patched_collect_company_accounting_data | ||
| ) |
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.
could you explain why is this needed?
| ) | ||
|
|
||
|
|
||
| class TestAccountPaymentModeDefaultAccount(TransactionCase): |
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.
you can try using BaseCommon class to inherit for the test instead of TransactionCase
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.
The problem is here:
| super().setUpClass() |
One option could be to do a PR to account_payment_order to use BaseCommon there. What do you think is cleaner, a patch in this module or changing account_payment_order
| class AccountChartTemplate(models.AbstractModel): | ||
| _inherit = "account.chart.template" | ||
|
|
||
| def generate_properties(self, acc_template_ref, company): |
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.
this method does not exist anymore in v18, could you check if it needs to be changed to something else? It may be _get_property_accounts()
|
|
||
| def uninstall_hook(cr, registry): | ||
| env = api.Environment(cr, SUPERUSER_ID, {}) | ||
| fields_mapping = [ |
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.
odoo is not using ir.property anymore, but the company dependent fields are stored in the DB as jsonb to keep the values for the different companies. Therefore, you still need the hooks, but simply they should now be managing the filling of data directly in the field of the res.partner table
d6b436e to
37341d1
Compare
| from odoo import fields | ||
|
|
||
|
|
||
| def monkey_patch(cls): |
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.
could you add a comment to explain that you are basing this on the module base_sparse_field where this is also used?
|
|
||
|
|
||
| @monkey_patch(fields.Field) | ||
| def get_company_dependent_fallback(self, records): |
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.
could you add a comment saying that this is necessary because odoo makes an 'assert self.company_dependent'
37341d1 to
3e01396
Compare
Currently translated at 100.0% (17 of 17 strings) Translation: bank-payment-14.0/bank-payment-14.0-account_payment_mode_default_account Translate-URL: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_mode_default_account/es/
3e01396 to
3e8483a
Compare
Migration of #1358