Merge PR #1489 into 13.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-09-28 07:03:54 +00:00
3 changed files with 14 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Reserve Sales",
"version": "13.0.1.0.0",
"version": "13.0.1.1.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"category": "Warehouse",
"license": "AGPL-3",

View File

@@ -0,0 +1,12 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
orders = env["sale.order"].search(
[("state", "=", "sent"), ("is_stock_reservable", "=", False)]
)
orders._compute_stock_reservation()

View File

@@ -157,7 +157,7 @@ class SaleOrderLine(models.Model):
reservable = False
if (
not (
line.state != "draft"
line.state not in ("draft", "sent")
or line._get_procure_method() == "make_to_order"
or not line.product_id
or line.product_id.type == "service"