-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] account_move_line_sale_info: Migration to 18.0 #2033
Conversation
…d to use the product.
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/
…n to credit notes
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/
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/it/
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/it/
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.
👍 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:
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.
0506b20
to
9ff9d6a
Compare
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.
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])], |
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.
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']" |
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.
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): |
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.
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'))]" /> |
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.
Maybe use Command.link
here.
|
||
|
||
class TestAccountMoveLineSaleInfo(common.TransactionCase): | ||
def setUp(self): |
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.
Refactor to use setUpClass
Migration to 18.0