Skip to content

Conversation

@RicardCForgeFlow
Copy link

Migration of #1358

@RicardCForgeFlow RicardCForgeFlow force-pushed the 18.0-mig-account_payment_mode_default_account branch from 65a1c9c to a21e369 Compare July 25, 2025 09:56
Comment on lines 99 to 101
account_common.AccountTestInvoicingCommon.collect_company_accounting_data = classmethod(
_patched_collect_company_accounting_data
)
Copy link
Contributor

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):
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is here:

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):
Copy link
Contributor

@JordiMForgeFlow JordiMForgeFlow Jul 31, 2025

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 = [
Copy link
Contributor

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

@RicardCForgeFlow RicardCForgeFlow marked this pull request as draft August 4, 2025 14:31
@RicardCForgeFlow RicardCForgeFlow force-pushed the 18.0-mig-account_payment_mode_default_account branch 3 times, most recently from d6b436e to 37341d1 Compare August 5, 2025 08:34
from odoo import fields


def monkey_patch(cls):
Copy link
Contributor

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):
Copy link
Contributor

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'

@RicardCForgeFlow RicardCForgeFlow force-pushed the 18.0-mig-account_payment_mode_default_account branch from 37341d1 to 3e01396 Compare September 8, 2025 13:41
@RicardCForgeFlow RicardCForgeFlow marked this pull request as ready for review September 8, 2025 13:42
@RicardCForgeFlow RicardCForgeFlow force-pushed the 18.0-mig-account_payment_mode_default_account branch from 3e01396 to 3e8483a Compare September 8, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants