saleor / saleor-dashboard

A GraphQL-powered, single-page dashboard application for Saleor.
BSD 3-Clause "New" or "Revised" License
842 stars 1.1k forks source link

No reduced tax rates in selection #1482

Closed tmechsner closed 3 years ago

tmechsner commented 3 years ago

What I'm trying to achieve

I want to be able to configure reduced tax rates.

Steps to reproduce the problem

  1. Create a new "default-channel" with currency EUR and default country Germany.
  2. Configure Vatlayer plugin for Germany (Origin Country = DE, Countries for which taxes will be calculated from origin country = DE)
  3. Fetch Taxes under configuration -> taxes. This initially didn't not work because of a rate limitation on Vatlayer side. Your django-prices-vatlayer package sends two requests right one after the other, which is too quickly. I added a delay, now it works - so I have tax data for many countries. Among them is also Germany with the correct standard tax rate (I checked in the database) and several reduced rates. Configuration-wise I have all three checkboxes checked.
  4. Create a Product Type or Product: There is only one Tax rate "standard" available.

What I expected to happen

I expect to see all the reduced tax rates as well.

Http request and response from inspector

The part of the graphql request regarding taxes when opening the page to create a new product in the dashboard:

{
  "operationName": "TaxTypeList",
  "variables": {
    "PERMISSION_HANDLE_PAYMENTS": true,
    "PERMISSION_IMPERSONATE_USER": true,
    "PERMISSION_MANAGE_APPS": true,
    "PERMISSION_MANAGE_CHANNELS": true,
    "PERMISSION_MANAGE_CHECKOUTS": true,
    "PERMISSION_MANAGE_DISCOUNTS": true,
    "PERMISSION_MANAGE_GIFT_CARD": true,
    "PERMISSION_MANAGE_MENUS": true,
    "PERMISSION_MANAGE_ORDERS": true,
    "PERMISSION_MANAGE_PAGES": true,
    "PERMISSION_MANAGE_PAGE_TYPES_AND_ATTRIBUTES": true,
    "PERMISSION_MANAGE_PLUGINS": true,
    "PERMISSION_MANAGE_PRODUCTS": true,
    "PERMISSION_MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES": true,
    "PERMISSION_MANAGE_SETTINGS": true,
    "PERMISSION_MANAGE_SHIPPING": true,
    "PERMISSION_MANAGE_STAFF": true,
    "PERMISSION_MANAGE_TRANSLATIONS": true,
    "PERMISSION_MANAGE_USERS": true
  },
  "query": "fragment TaxTypeFragment on TaxType {\n  description\n  taxCode\n  __typename\n}\n\nquery TaxTypeList {\n  taxTypes {\n    ...TaxTypeFragment\n    __typename\n  }\n}\n"
}

Reponse (only the part regarding taxes)

{
    "data": {
      "taxTypes": [
        {
          "description": "standard",
          "taxCode": "standard",
          "__typename": "TaxType"
        }
      ]
    }
  }

Console output

None

System information

Saleor version:

Operating system:

Browser:

tmechsner commented 3 years ago

Didn't work because of the rate limitation in VatLayer. Have this fixed now by adding a delay between the two vatlayer api calls in django-prices-vatlayer package.

Jopce commented 2 years ago

Hello, @tmechsner, could you please elaborate on how you fixed this issue? Thank you.