Skip to content

Commit

Permalink
[14.0][MIG] stock_product_pack: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Usdoo Wedoo committed Sep 18, 2021
1 parent 43468af commit 478836f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stock_product_pack/models/stock_rule.py
Expand Up @@ -7,7 +7,7 @@ class ProcurementGroup(models.Model):
_inherit = "procurement.group"

@api.model
def run(self, procurements,raise_user_error=True):
def run(self, procurements, raise_user_error=True):
"""If 'run' is called on a pack product storable.
we remove the procurement with this product pack.
"""
Expand All @@ -20,4 +20,4 @@ def run(self, procurements,raise_user_error=True):
):
procurements.remove(procurement)

return super().run(procurements,raise_user_error=raise_user_error)
return super().run(procurements, raise_user_error=raise_user_error)
3 changes: 2 additions & 1 deletion stock_product_pack/tests/test_stock_product_pack.py
Expand Up @@ -110,6 +110,7 @@ def test_compute_quantities_dict(self):
location_id = (self.env.ref("stock.stock_location_suppliers").id,)
location_dest_id = (self.env.ref("stock.stock_location_stock").id,)
components = self.pack_dc.pack_line_ids.mapped("product_id")

picking = self.env["stock.picking"].create(
{
"partner_id": self.env.ref("base.res_partner_4").id,
Expand Down Expand Up @@ -148,7 +149,7 @@ def test_compute_quantities_dict(self):
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 0)
wizard_dict = picking.button_validate()
wizard = self.env[wizard_dict["res_model"]].browse(wizard_dict["res_id"])
wizard = self.env[wizard_dict["res_model"]].browse(picking.id)
wizard.process()
self.product_obj.invalidate_cache()
self.assertEqual(self.pack_dc.virtual_available, 5)
Expand Down

0 comments on commit 478836f

Please sign in to comment.