nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.32k stars 5.33k forks source link

Nop.Plugin.Tax.Avalara Settings Error TaxOriginAddressType Value 0 Error #7310

Closed abodehq closed 2 months ago

abodehq commented 3 months ago

nopCommerce version:

Steps to reproduce the problem:

when we upgrade from 4.70.1 to 4.70.4

we received an error on migration file on Nop.Plugin.Tax.Avalara plugin [NopMigration("2021-09-06 00:00:00", "Tax.Avalara 2.50. Add certificates feature", MigrationProcessType.Update)]

the error show that it cant insert setting for TaxOriginAddressType as value 0

the suggested solution is just to add a new checkup as below:

if (!_settingService.SettingExists(_avalaraTaxSettings, settings => settings.TaxOriginAddressType)) _avalaraTaxSettings.TaxOriginAddressType = Domain.TaxOriginAddressType.DefaultTaxAddress;

skoshelev commented 2 months ago

Hi, @abodehq.

The TaxOriginAddressType setting was added to the plugin back in nopCommerce version 4.00 (plugin version 2.03), I don't see a way to reproduce the problem other than removing the setting from the database before updating the plugin.

abodehq commented 2 months ago

@skoshelev

this is when u have it already install in then try to upgrade the version !