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

[16.0][IMP] purchase_request + purchase_request_type: Misc changes (hide company_id field + set groups to group_id field) #2440

Merged
merged 14 commits into from
Mar 13, 2025

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Oct 18, 2024

Changes done:

  • purchase_request: Hide the company_id field from the lines + add index.
  • purchase_request: Set groups to group_id field
  • purchase_request: Add company_id field (invisible) to form view.
  • purchase_request_type: Show request_type field always (not only when you have Multi-company permission.
  • purchase_request_type: Leave the company_id field empty.
  • purchase_request: Leave the company_id field empty in the sequence.
  • purchase_request_tier_validation: Leave the company_id field empty in the definition.
  • purchase_order_uninvoiced_amount: Avoid warning log.
  • purchase_product_packaging_container_deposit: Change method to invalidate_cache() to invalidate_model() to avoid warning log.
  • purchase_request_department: Change Environment.manage() method.
  • purchase_request_tier_validation: Change tier.definition data to demo data.
  • purchase_request_type: Change purchase.request.type data to demo data.
  • purchase_request: Add kanban view.
    ejemplo

Changes done:

  • purchase_request_type: Change toggle_active to web_ribbon + Archived filter.

Before
ejemplo

After
despues

@Tecnativa TT51248 TT55213

@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch 3 times, most recently from 93cd5f4 to 357c542 Compare October 22, 2024 13:01
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from 357c542 to 87eb11a Compare October 29, 2024 11:08
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from f06a2ea to ebdc9fd Compare November 13, 2024 16:16
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from 8dfb9af to 1b0f77f Compare January 16, 2025 11:47
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from 1b0f77f to aab262b Compare February 28, 2025 09:37
@victoralmau victoralmau changed the title [16.0][WIP] purchase_request: Add Approver user to requests [16.0][IMP] purchase_request: Misc changes (subtypes + hide company_id field + set groups to group_id field) Feb 28, 2025
@victoralmau
Copy link
Member Author

Locked by purchase_triple_discount #2579 (comment)

Finally the change of the approver has been removed because the focus is changed to purchase_request_tier_validation.

Please @carlos-lopez-tecnativa can you review it?

@victoralmau victoralmau marked this pull request as ready for review February 28, 2025 09:44
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from cc27604 to af2d130 Compare March 5, 2025 12:56
@victoralmau victoralmau changed the title [16.0][IMP] purchase_request: Misc changes (subtypes + hide company_id field + set groups to group_id field) [16.0][IMP] purchase_request + purchase_request_type: Misc changes (hide company_id field + set groups to group_id field) Mar 5, 2025
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch 3 times, most recently from 681342d to d668e22 Compare March 10, 2025 15:17
@pedrobaeza pedrobaeza added this to the 16.0 milestone Mar 10, 2025
@@ -74,6 +74,7 @@ def test_compute_purchase_request_type(self):
self.assertEqual(request2.reduce_step, self.type2.reduce_step)

def test_purchase_request_type_company_error(self):
self.type1.company_id = self.env.company
Copy link
Member

Choose a reason for hiding this comment

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

This sounds weird if you need to assign the company explicitly. Isn't this revealing a problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right, the data tier.definition has no company_id defined and this test is intended to check what happens if a tier.definition has company_id defined but, again, if you want this to work differently comment it and I will modify it.

@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from af5c41c to 71b5ad5 Compare March 11, 2025 07:35
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from 71b5ad5 to d95f44a Compare March 11, 2025 07:51
…invalidate_cache() to invalidate_model() to avoid warning log

Change the method to invalidate_model() to avoid the error:

WARNING devel py.warnings: /opt/odoo/auto/addons/purchase_product_packaging_container_deposit/tests/test_purchase_product_packaging_container_deposit.py:277: DeprecationWarning: Deprecated method invalidate_cache(), use invalidate_model(), invalidate_recordset() or env.invalidate_all() instead
Change the Environment.manage() method to avoid the warning log:

WARNING odoo py.warnings: /usr/lib/python3.10/contextlib.py:135: DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless.
@victoralmau victoralmau force-pushed the 16.0-imp-purchase_request-TT51248 branch from d95f44a to 92e7b88 Compare March 11, 2025 08:09
Copy link

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

LGTM

@pedrobaeza
Copy link
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-2440-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at fb40987. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit a10be35 into OCA:16.0 Mar 13, 2025
8 of 9 checks passed
@pedrobaeza pedrobaeza deleted the 16.0-imp-purchase_request-TT51248 branch March 13, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants