[IMP] stock_available: black, isort, prettier

This commit is contained in:
Jasmin Solanki
2022-01-21 16:58:21 +05:30
parent 318b397062
commit bbb8974698
4 changed files with 13 additions and 6 deletions

View File

@@ -0,0 +1 @@
../../../../stock_available

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@@ -28,11 +28,11 @@ 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
]
)
potential_qty = max(
[

View File

@@ -10,10 +10,10 @@ class TestStockLogisticsWarehouse(TransactionCase):
"""Test the config file"""
stock_setting = self.env["res.config.settings"].create({})
self.assertEquals(stock_setting.stock_available_mrp_based_on, "qty_available")
self.assertEqual(stock_setting.stock_available_mrp_based_on, "qty_available")
stock_setting.stock_available_mrp_based_on = "immediately_usable_qty"
stock_setting.set_values()
self.assertEquals(
self.assertEqual(
stock_setting.stock_available_mrp_based_on, "immediately_usable_qty"
)
@@ -142,8 +142,8 @@ class TestStockLogisticsWarehouse(TransactionCase):
compare_product_usable_qty(templateAB, 4)
# Potential Qty is set as 0.0 by default
self.assertEquals(templateAB.potential_qty, 0.0)
self.assertEquals(productA.potential_qty, 0.0)
self.assertEqual(templateAB.potential_qty, 0.0)
self.assertEqual(productA.potential_qty, 0.0)
def test_available_stock_multiple_location(self):
uom_unit = self.env.ref("uom.product_uom_unit")