mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_available: Migration to 15.0
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
"name": "Stock available to promise",
|
||||
"version": "14.0.1.0.3",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Numérigraphe, Sodexis, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"development_status": "Production/Stable",
|
||||
|
||||
@@ -28,11 +28,9 @@ class ProductTemplate(models.Model):
|
||||
res = {}
|
||||
for template in self:
|
||||
immediately_usable_qty = sum(
|
||||
|
||||
variants_dict[p.id]["immediately_usable_qty"]
|
||||
- variants_dict[p.id]["potential_qty"]
|
||||
for p in template.product_variant_ids
|
||||
|
||||
variants_dict[p.id]["immediately_usable_qty"]
|
||||
- variants_dict[p.id]["potential_qty"]
|
||||
for p in template.product_variant_ids
|
||||
)
|
||||
potential_qty = max(
|
||||
[
|
||||
|
||||
@@ -6,7 +6,6 @@ from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
|
||||
"""Add options to easily install the submodules"""
|
||||
|
||||
_inherit = "res.config.settings"
|
||||
@@ -67,7 +66,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
return res
|
||||
|
||||
def set_values(self):
|
||||
super(ResConfigSettings, self).set_values()
|
||||
res = super(ResConfigSettings, self).set_values()
|
||||
self.env["ir.config_parameter"].sudo().set_param(
|
||||
"stock_available_mrp_based_on", self.stock_available_mrp_based_on
|
||||
)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user