Skip to content
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

[18.0][MIG] account_move_line_sale_info: Migration to 18.0 #2033

Open
wants to merge 39 commits into
base: 18.0
Choose a base branch
from

Conversation

IsabelAForgeFlow
Copy link

Migration to 18.0

AaronHForgeFlow and others added 30 commits February 18, 2025 17:13
Currently translated at 100.0% (8 of 8 strings)

Translation: account-financial-tools-15.0/account-financial-tools-15.0-account_move_line_sale_info
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_move_line_sale_info/es_AR/
Currently translated at 100.0% (8 of 8 strings)

Translation: account-financial-tools-16.0/account-financial-tools-16.0-account_move_line_sale_info
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_move_line_sale_info/es/
Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

👍 Code + functional. Just please fix the minor lint issues.

BTW there is a minor issue not related to this migration with the the post_init_hook. It is filling the sales order in the account.move.line related to the income account:

image

While working with Odoo normally and using this module, this is not happening, and only the other account.move.line in the image gets the link to the sales order. It is not a major issue but it would be fine to adjust the queries for that.

@IsabelAForgeFlow IsabelAForgeFlow force-pushed the 18.0-mig-account_move_line_sale_info branch from 0506b20 to 9ff9d6a Compare February 19, 2025 14:12
Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Some small nitpicks

@@ -87,7 +87,7 @@ def _create_account(self, acc_type, name, code, company):
"name": name,
"code": code,
"account_type": acc_type,
"company_id": company.id,
"company_ids": [(6, 0, [company.id])],
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use fields.Command

@@ -75,7 +75,7 @@
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='line_ids']/tree//field[@name='partner_id']"
expr="//field[@name='line_ids']//field[@name='partner_id']"
Copy link
Member

Choose a reason for hiding this comment

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

Please use /list/ to make it more readable (there are multiple partner_id fields in under line_ids, although one in the list view is the first so it will indeed be selected as is).

@api.depends_context("so_line_info")
def _compute_display_name(self):
res = super()._compute_display_name()
if self.env.context.get("so_line_info", False):
Copy link
Member

Choose a reason for hiding this comment

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

No need to call super if this is the case.

<record id="group_account_move_sale_info" model="res.groups">
<field name="name">Sale info in Journal Items</field>
<field name="category_id" ref="base.module_category_hidden" />
<field name="users" eval="[(4, ref('base.user_admin'))]" />
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use Command.link here.



class TestAccountMoveLineSaleInfo(common.TransactionCase):
def setUp(self):
Copy link
Member

Choose a reason for hiding this comment

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

Refactor to use setUpClass

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.