← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 802526] Re: update button in new product page->real stock value creates directly a product which cannot be deleted

 

Dear Rucha,

The way I was doing it is that while creating a new stockable product
and before saving it, I clicked on the update inventory and set the
number of items of the product I am creating.

After I clicked on apply button, openerp created another instance of the
same new product I am still editing. This other instance had the
quantity set to the number I entered in the update inventory while the
new product page that I initially opened for editing had the stock
quantity showing 0 quantity

The first time i was creating a product, I didn't notice this effect and
I kept trying to update the quantity to the desired number. When I
checked the list of products, I saw a list of products of the same name
and each with the quantity I entered except one product item which had 0
quantity in stock. This is the product instance I initially edited and
the other are all automatically created after clicking on the apply
button.

When I tried to delete the products instances to keep one, I was able
only to delete the instance with 0 quantity. The rest complained that
they can't be deleted due to certain dependencies. to remove
dependencies, I've tried to delete the inventory listing, it was
successful but I wasn't able to delete the entry of the stock move....

Intuitively, I think one should be able to delete products from its
database in case he committed a mistake in entering... this can be
desired like in my case where entries of products were wrongly
entered...

Best regards

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/802526

Title:
  update button in new product page->real stock value creates directly a
  product which cannot be deleted

Status in OpenERP Modules (addons):
  Incomplete

Bug description:
  I tried to create a new product of type stockable
  The real stock was set by clicking on the update button next to it
  however, the apply button opens a new webpage where it shows that the product was directly edited
  problem is that this unwanted and still-yet-to-be-edited instance cannot be deleted giving the following error:

  ERROR:db.cursor:bad query: delete from product_template where id IN (4)
  Traceback (most recent call last):
    File "/usr/local/openerp-server-6.0.2/bin/sql_db.py", line 131, in execute
      res = self._obj.execute(query, params)
  IntegrityError: null value in column "product_id" violates not-null constraint
  CONTEXT:  SQL statement "UPDATE ONLY "public"."stock_move" SET "product_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "product_id""

  Kindly note that the inventory entry corresponding to this undesired
  product instance can be successfully deleted

  platform: ubuntu
  version used: 6.0.2

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/802526/+subscriptions


References