dvdl16 / woocommerce_fusion

WooCommerce connector for ERPNext v15
https://finfoot.tech
Other
28 stars 24 forks source link

[BUG] Can not synchronise Gift Card #102

Closed dvdl16 closed 3 months ago

dvdl16 commented 4 months ago

Current Behavior

Can not synchronise a Gift Card WooCommerce Product

Steps To Reproduce

  1. Create a Gift Card product in WooCommerce
  2. Sync to ERPNext
  3. See Error

Expected Behavior

Product should sync successfully

Anything else?

Traceback (most recent call last):
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_item_prices.py", line 134, in sync_items_with_woocommerce_products
    wc_product.save()
  File "apps/frappe/frappe/model/document.py", line 337, in save
    return self._save(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 376, in _save
    self._validate()
  File "apps/frappe/frappe/model/document.py", line 576, in _validate
    self._validate_selects()
  File "apps/frappe/frappe/model/base_document.py", line 885, in _validate_selects
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 645, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 610, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 561, in _raise_exception
    raise exc
frappe.exceptions.ValidationError:  Type cannot be "pw-gift-card". It should be one of "", "simple", "grouped", "external", "variable", "variation"

Environment and Versions

Agriculture: v0.0.1
Customisations for [redacted]: v1.2.3
South Africa Customisations: v0.1.6
ERPNext: v15.27.7
Frappe Framework: v15.29.2
Frappe HR: v15.22.3
WooCommerce Fusion: v1.7.1

Operating System

Windows

What browsers are you seeing the problem on?

No response

dvdl16 commented 3 months ago

Relevant?

  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_items.py", line 260, in sync_wc_product_with_erpnext_item
    self.update_woocommerce_product(self.woocommerce_product, self.item)
      self = <woocommerce_fusion.tasks.sync_items.SynchroniseItem object at 0x72f6c50a3850>
  File "apps/woocommerce_fusion/woocommerce_fusion/tasks/sync_items.py", line 291, in update_woocommerce_product
    wc_product.save()
      self = <woocommerce_fusion.tasks.sync_items.SynchroniseItem object at 0x72f6c50a3850>
      wc_product = <WooCommerceProduct: www.somesite.co~1099>
      item = ERPNextItemToSync(item=<Item: Gift Voucher>, item_woocommerce_server_idx=1)
      wc_product_dirty = True
  File "apps/frappe/frappe/model/document.py", line 337, in save
    return self._save(*args, **kwargs)
      self = <WooCommerceProduct: www.somesite.co~1099>
      args = ()
      kwargs = {}
  File "apps/frappe/frappe/model/document.py", line 376, in _save
    self._validate()
      self = <WooCommerceProduct: www.somesite.co~1099>
      ignore_permissions = None
      ignore_version = None
  File "apps/frappe/frappe/model/document.py", line 574, in _validate
    self._validate_mandatory()
      self = <WooCommerceProduct: www.somesite.co~1099>
  File "apps/frappe/frappe/model/document.py", line 911, in _validate_mandatory
    raise frappe.MandatoryError(
      self = <WooCommerceProduct: www.somesite.co~1099>
      missing = [('regular_price', 'Error: Value missing for WooCommerce Product: Regular Price')]
      idx = 'regular_price'
      msg = 'Error: Value missing for WooCommerce Product: Regular Price'
frappe.exceptions.MandatoryError: [WooCommerce Product, www.somesite.co~1099]: regular_price