Skip to content

Commit ce2e316

Browse files
committed
[ADD] stock_orderpoint_variant_mto_as_mts
1 parent ec6cc15 commit ce2e316

File tree

13 files changed

+640
-0
lines changed

13 files changed

+640
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
===================================
6+
Stock Orderpoint Variant MTO as MTS
7+
===================================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:fba59931517ad2e10732e30f4e3e969d138737e893163feedd3c7e7a305f784f
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
22+
:alt: License: LGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--orderpoint-lightgray.png?logo=github
24+
:target: https://github.com/OCA/stock-logistics-orderpoint/tree/18.0/stock_orderpoint_variant_mto_as_mts
25+
:alt: OCA/stock-logistics-orderpoint
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/stock-logistics-orderpoint-18-0/stock-logistics-orderpoint-18-0-stock_orderpoint_variant_mto_as_mts
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-orderpoint&target_branch=18.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
Glue module between ``stock_orderpoint_mto_as_mts`` and
36+
``product_variant_route_mto`` to trigger reordering rules for product
37+
variants
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Configuration
45+
=============
46+
47+
48+
49+
Usage
50+
=====
51+
52+
53+
54+
Bug Tracker
55+
===========
56+
57+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-orderpoint/issues>`_.
58+
In case of trouble, please check there if your issue has already been reported.
59+
If you spotted it first, help us to smash it by providing a detailed and welcomed
60+
`feedback <https://github.com/OCA/stock-logistics-orderpoint/issues/new?body=module:%20stock_orderpoint_variant_mto_as_mts%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
61+
62+
Do not contact contributors directly about support or help with technical issues.
63+
64+
Credits
65+
=======
66+
67+
Authors
68+
-------
69+
70+
* Camptocamp SA
71+
72+
Contributors
73+
------------
74+
75+
- Henry Backman <[email protected]>
76+
77+
Maintainers
78+
-----------
79+
80+
This module is maintained by the OCA.
81+
82+
.. image:: https://odoo-community.org/logo.png
83+
:alt: Odoo Community Association
84+
:target: https://odoo-community.org
85+
86+
OCA, or the Odoo Community Association, is a nonprofit organization whose
87+
mission is to support the collaborative development of Odoo features and
88+
promote its widespread use.
89+
90+
This module is part of the `OCA/stock-logistics-orderpoint <https://github.com/OCA/stock-logistics-orderpoint/tree/18.0/stock_orderpoint_variant_mto_as_mts>`_ project on GitHub.
91+
92+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2025 Camptocamp SA
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
3+
4+
{
5+
"name": "Stock Orderpoint Variant MTO as MTS",
6+
"summary": "Stock Orderpoint Variant MTO as MTS",
7+
"version": "18.0.1.0.0",
8+
"license": "LGPL-3",
9+
"website": "https://github.com/OCA/stock-logistics-orderpoint",
10+
"author": "Camptocamp SA, Odoo Community Association (OCA)",
11+
"category": "Warehouse Management",
12+
"depends": ["stock_orderpoint_mto_as_mts", "product_variant_route_mto"],
13+
"data": [],
14+
"installable": True,
15+
"auto_install": True,
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import product_product
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 Camptocamp SA
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class ProductProduct(models.Model):
8+
_inherit = "product.product"
9+
10+
def write(self, vals):
11+
if self.env.context.get("orderpoint_mto_as_mts"):
12+
return super().write(vals)
13+
if "is_mto" in vals:
14+
original_mto_products = self.filtered("is_mto")
15+
res = super().write(vals)
16+
if "is_mto" in vals:
17+
# is_mto may have changed
18+
original_mto_products._archive_orderpoints_on_mto_removal()
19+
original_not_mto_products = self - original_mto_products
20+
original_not_mto_products._ensure_default_orderpoint_for_mto()
21+
return res
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Henry Backman \<[email protected]\>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Glue module between `stock_orderpoint_mto_as_mts` and `product_variant_route_mto` to
2+
trigger reordering rules for product variants

stock_orderpoint_variant_mto_as_mts/readme/USAGE.md

Whitespace-only changes.

0 commit comments

Comments
 (0)