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_tier_validation_approver: Migration to 18.0 #1831

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

Conversation

kevinkhao
Copy link

@kevinkhao kevinkhao commented Nov 2, 2024

based on #1491
depends on OCA/server-ux#966 #1830

@kevinkhao kevinkhao force-pushed the 18.0-mig-account_move_tier_validation_approver branch 2 times, most recently from c1e5919 to 8904706 Compare November 2, 2024 14:11
@kevinkhao kevinkhao marked this pull request as draft November 5, 2024 08:55
@kevinkhao kevinkhao force-pushed the 18.0-mig-account_move_tier_validation_approver branch 2 times, most recently from 979d2b6 to 02aba64 Compare November 11, 2024 07:07
@kevinkhao kevinkhao marked this pull request as ready for review November 11, 2024 07:07
Comment on lines 6 to 26


class TestAccountMoveTierValidationApprover(TransactionCase):
def setUp(self):
super().setUp()
self.res_partner_1 = self.env["res.partner"].create(
{"name": "Wood Corner", "email": "example@yourcompany.com"}
)
self.product_1 = self.env["product.product"].create(
{"name": "Desk Combination"}
)
self.currency_usd = self.env["res.currency"].search([("name", "=", "USD")])
self.test_user_1 = self.env["res.users"].create(
{"name": "User", "login": "test1", "email": "example@yourcompany.com"}
)
self.test_approver = self.env["res.users"].create(
{"name": "Approver", "login": "test2", "email": "example@yourcompany.com"}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class TestAccountMoveTierValidationApprover(TransactionCase):
def setUp(self):
super().setUp()
self.res_partner_1 = self.env["res.partner"].create(
{"name": "Wood Corner", "email": "example@yourcompany.com"}
)
self.product_1 = self.env["product.product"].create(
{"name": "Desk Combination"}
)
self.currency_usd = self.env["res.currency"].search([("name", "=", "USD")])
self.test_user_1 = self.env["res.users"].create(
{"name": "User", "login": "test1", "email": "example@yourcompany.com"}
)
self.test_approver = self.env["res.users"].create(
{"name": "Approver", "login": "test2", "email": "example@yourcompany.com"}
)
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
class TestAccountMoveTierValidationApprover(TransactionCase):
def setUp(self):
super().setUp()
self.env = self.env(context=dict(self.env.context, **DISABLED_MAIL_CONTEXT))
self.res_partner_1 = self.env["res.partner"].create(
{"name": "Wood Corner", "email": "example@yourcompany.com"}
)
self.product_1 = self.env["product.product"].create(
{"name": "Desk Combination"}
)
self.currency_usd = self.env["res.currency"].search([("name", "=", "USD")])
self.test_user_1 = self.env["res.users"].create(
{"name": "User", "login": "test1", "email": "example@yourcompany.com"}
)
self.test_approver = self.env["res.users"].create(
{"name": "Approver", "login": "test2", "email": "example@yourcompany.com"}
)

Odoo is trying to sent emails for the users created here.
It can be made more efficient by using DISABLED_MAIL_CONTEXT

Like done in sale_tier_validation module
https://github.com/OCA/sale-workflow/blob/17.0/sale_tier_validation/tests/test_tier_validation.py#L6-L31

@kevinkhao kevinkhao force-pushed the 18.0-mig-account_move_tier_validation_approver branch from 02aba64 to 6763e36 Compare November 12, 2024 06:45
Copy link
Contributor

@CasVissers-360ERP CasVissers-360ERP left a comment

Choose a reason for hiding this comment

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

Functional review

<xpath expr='//field[@name="ref"]' position="after">
<field
name="approver_id"
readonly="review_ids != False"
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinkhao I think this shoul be readonly="review_ids"

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@CasVissers-360ERP CasVissers-360ERP left a comment

Choose a reason for hiding this comment

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

Minor feedback

@kevinkhao kevinkhao force-pushed the 18.0-mig-account_move_tier_validation_approver branch from 6763e36 to eb67009 Compare November 26, 2024 13:20
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.

9 participants