From b4ba3202e73f24a07ebb4de1de56f8f4bf560007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 18 Nov 2023 00:25:19 +0100 Subject: [PATCH] Use moveable types from sale line for Shopify Inventory Item --- modules/web_shop_shopify/product.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/web_shop_shopify/product.py b/modules/web_shop_shopify/product.py index e5d2337fd9..7cb0fe61c5 100644 --- a/modules/web_shop_shopify/product.py +++ b/modules/web_shop_shopify/product.py @@ -310,9 +310,8 @@ class ShopifyInventoryItem(IdentifiersMixin, ModelSQL, ModelView): def get_shopify(self, shop): pool = Pool() Product = pool.get('product.product') - Move = pool.get('stock.move') - # TODO: replace with product_types from sale line - move_types = Move.get_product_types() + SaleLine = pool.get('sale.line') + movable_types = SaleLine.movable_types() shopify_id = self.get_shopify_identifier(shop) inventory_item = None @@ -333,8 +332,8 @@ class ShopifyInventoryItem(IdentifiersMixin, ModelSQL, ModelView): inventory_item = shopify.InventoryItem.find( variant.inventory_item_id) inventory_item.tracked = ( - self.product.type in move_types and not self.product.consumable) - inventory_item.requires_shipping = self.product.type in move_types + self.product.type in movable_types and not self.product.consumable) + inventory_item.requires_shipping = self.product.type in movable_types return inventory_item