importing product doesn't ignore inactive products

Description

while importing products all updates ignore the active field of m_product. Thus having an active and an inactive product with e.g. the same upc this leads to the annoying message 'TaxCategory' because up to then SQLExecption only lead to an ignored -1 as count.

Environment

None

Activity

Show:
Martin Schönbeck
April 23, 2020, 11:30 AM

Hi ,

Patch created.

Regards,

Martin

Carlos Ruiz
April 29, 2020, 3:55 PM

, I didn't do tests on the patch, but I think the IsActive validation maybe is OK on the UPC.

Not the best scenario but you can have two products with same UPC (wondering if we want to allow that - even knowing that one is inactive and the other is active)

But, you cannot have two products with same value - the second validation I see in the patch - because of the unique index, did you test that scenario?

Regards,

Carlos Ruiz

Martin Schönbeck
April 29, 2020, 7:44 PM
Edited

Hi ,

you are right. No excuse. When preparing the change for upc as separate patch I saw that IsActive is also ignored on searching by value. And thought it should be evaluated there, too. But this would of course lead to an error when later trying to create that product.

In the situation where value points to an inactive product, the product is updated but left inactive. I don’t know whether it’s a good idea, to import a product over an inactive one. But if it is done, the product should be active than, as nobody will import a product without going to use it.

Martin Schönbeck
July 7, 2020, 7:42 PM

Hi ,

when tapping in the pitfall you mentioned above I remembered to take action to complete this task. And I found that errors when updating a product are not bracketed by a savepoint so all further actions fail and the error itself is not written to the i_product line. So I changed this, too. I created a pull request for the changes and they are tested completely this time. But please have a look whether my savepoint handling is complete.

Regards,
Martin

Martin Schönbeck
July 17, 2020, 10:15 AM

while working with the product import I found that errormessages on subtables are rolled back if the next product is in error, too. While correcting this a smother version for the previous correction of missing errorhandling on updates of the product itself. A new pull request is already created.

Assignee

Martin Schönbeck

Reporter

Martin Schönbeck

Labels

None

Tested By

None

Components

Fix versions

Affects versions

Priority

Minor
Configure