Skip to content

[15.0][ADD] sale_stock_warehouse_partner: New module#3916

Merged
OCA-git-bot merged 1 commit intoOCA:15.0from
Tecnativa:15.0-add-sale_stock_warehouse_partner
Oct 23, 2025
Merged

[15.0][ADD] sale_stock_warehouse_partner: New module#3916
OCA-git-bot merged 1 commit intoOCA:15.0from
Tecnativa:15.0-add-sale_stock_warehouse_partner

Conversation

@eduezerouali-tecnativa
Copy link
Copy Markdown

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch 2 times, most recently from 3088ac0 to 5cb5624 Compare October 1, 2025 16:06
Comment on lines +33 to +36
sale_order_type_module = self.env["ir.module.module"].search(
[("name", "=", "sale_order_type")]
)
if sale_order_type_module or sale_order_type_module.state == "installed":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use registry instead of search to minimize DB calls.

Suggested change
sale_order_type_module = self.env["ir.module.module"].search(
[("name", "=", "sale_order_type")]
)
if sale_order_type_module or sale_order_type_module.state == "installed":
if "sale_order_type" in self.env.registry._init_modules and "sale_stock_warehouse_order_type" not in self.env.registry._init_modules:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No longer that need it, but good to know.

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch 3 times, most recently from a33d00c to 0bf64ef Compare October 2, 2025 07:00
@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch 2 times, most recently from 514a629 to 27dddc3 Compare October 6, 2025 06:25
@rousseldenis rousseldenis added this to the 15.0 milestone Oct 6, 2025
class ResPartner(models.Model):
_inherit = "res.partner"

warehouse_id = fields.Many2one(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be company dependent IMHO

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eduezerouali-tecnativa Can you attend this comment?? Thanks..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@rousseldenis You're right, makes it more flexible for multi-company scenario. Changes done. Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One more thing, could you change the field name like sale_warehouse_id ? Thanks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here, not on sale.order level 😅

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch 2 times, most recently from a34f6fd to 63c5841 Compare October 8, 2025 08:11
comodel_name="stock.warehouse",
company_dependent=True,
string="Warehouse",
help="Set deafult warehouse for Sale Order",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
help="Set deafult warehouse for Sale Order",
help="Set default warehouse for Sale Order",

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch 5 times, most recently from 2e5bf47 to 09cd558 Compare October 16, 2025 11:58
@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-sale_stock_warehouse_partner branch from 09cd558 to a59b876 Compare October 16, 2025 12:17
@eduezerouali-tecnativa
Copy link
Copy Markdown
Author

@rousseldenis changes done, could you review please.

Copy link
Copy Markdown
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

LGTM

@eduezerouali-tecnativa
Copy link
Copy Markdown
Author

ping @sergio-teruel @carlosdauden

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 15.0-ocabot-merge-pr-3916-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 826be3d into OCA:15.0 Oct 23, 2025
11 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

@pedrobaeza pedrobaeza deleted the 15.0-add-sale_stock_warehouse_partner branch October 23, 2025 10:27
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.

6 participants