Skip to content

Commit

Permalink
Update Shopify API version and clean up code
Browse files Browse the repository at this point in the history
Changed the Shopify API version from "2024-01" to "2023-10" to ensure compatibility with current API specifications. Also removed an outdated comment related to committing every 50 products.
  • Loading branch information
cbusillo committed Jul 19, 2024
1 parent 9ca9427 commit c77cd15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions product_connect/models/shopify_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def sync_with_shopify(self) -> None:
def initialize_shopify_session(self) -> None:
shop_url = self.env["ir.config_parameter"].sudo().get_param("shopify.shop_url")
token = self.env["ir.config_parameter"].sudo().get_param("shopify.api_token")
shopify_session = shopify.Session(f"{shop_url}.myshopify.com", token=token, version="2024-01")
shopify_session = shopify.Session(f"{shop_url}.myshopify.com", token=token, version="2023-10")
shopify.ShopifyResource.activate_session(shopify_session)

def fetch_import_timestamps(self) -> tuple[str, datetime, datetime]:
Expand Down Expand Up @@ -339,7 +339,6 @@ def import_from_shopify(self) -> None:
last_import_time_str,
)
if total_count % self.COMMIT_AFTER == 0:
# Commit every 50 products to avoid re downloading all images if the import fails
self.env.cr.commit()

if shopify_products:
Expand Down

0 comments on commit c77cd15

Please sign in to comment.