c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #26259
Re: [Bug 793407] Re: [trunk] IntegrityError: duplicate key value violates unique constraint "product_uom_factor_category_id_uniq"
Please see this Bug 731035 for functional discussion. This is the reported
bug that introduced regression and is being reviewed after reopening.
And this one for more info too 734686.
On Fri, Jun 10, 2011 at 10:58 PM, Phong Nguyen-Thanh <
793407@xxxxxxxxxxxxxxxxxx> wrote:
> @Amit: did you restart server with options -u to update the DB? I create
> a new DB and its always produces that error.
>
> --
> You received this bug notification because you are subscribed to OpenERP
> Addons.
> https://bugs.launchpad.net/bugs/793407
>
> Title:
> [trunk] IntegrityError: duplicate key value violates unique constraint
> "product_uom_factor_category_id_uniq"
>
> Status in OpenERP Modules (addons):
> New
>
> Bug description:
> I experience this error when loading data into a newly created DB.
> This seems to be a regression as it doesn't happen on 6.0 release. I'm
> not sure that assuming the factor must be uniq per category is a
> valid.
>
> [2011-06-06 15:02:13,286][dev60] INFO:init:module crclinic_data: loading
> data/crclinic_data-product.uom.xml
> [2011-06-06 15:02:13,357][dev60] ERROR:db.cursor:bad query: insert into
> "product_uom"
> (id,"active","name","factor","rounding","category_id","uom_type",create_uid,create_date)
> values (15,E'True',E'cái',1.0,E'1.000',6,E'reference',1,now())
> Traceback (most recent call last):
> File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 131,
> in execute
> res = self._obj.execute(query, params)
> IntegrityError: duplicate key value violates unique constraint
> "product_uom_factor_category_id_uniq"
>
> [2011-06-06 15:02:13,358][dev60] ERROR:tools.convert.xml_import:Parse
> error in
> /media/data/Projects/openerp-6.0/server/bin/addons/crclinic_data/data/crclinic_data-product.uom.xml:55:
> <record id="product_uom_unit_cai" model="product.uom">
> <field name="category_id" ref="product_uom_categ_cai"/>
> <field name="name">cái</field>
> <field name="factor_inv" eval="1"/>
> <field name="factor" eval="1"/>
> <field name="rounding" eval="1"/>
> <field name="uom_type">reference</field>
> <field name="active">True</field>
> </record>
> Traceback (most recent call last):
> File "/media/data/Projects/openerp-6.0/server/bin/tools/convert.py",
> line 865, in parse
> self._tags[rec.tag](self.cr, rec, n)
> File "/media/data/Projects/openerp-6.0/server/bin/tools/convert.py",
> line 832, in _tag_record
> id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model,
> self.module, res, rec_id or False, not self.isnoupdate(data_node),
> noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
> File
> "/media/data/Projects/openerp-6.0/server/bin/addons/base/ir/ir_model.py",
> line 691, in _update
> res_id = model_obj.create(cr, uid, values, context=context)
> File
> "/media/data/Projects/openerp-6.0/server/bin/addons/product/product.py",
> line 94, in create
> return super(product_uom, self).create(cr, uid, data, context)
> File "/media/data/Projects/openerp-6.0/server/bin/osv/orm.py", line
> 3649, in create
> cr.execute('insert into "'+self._table+'" (id'+upd0+") values
> ("+str(id_new)+upd1+')', tuple(upd2))
> File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 78,
> in wrapper
> return f(self, *args, **kwargs)
> File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 131,
> in execute
> res = self._obj.execute(query, params)
> IntegrityError: duplicate key value violates unique constraint
> "product_uom_factor_category_id_uniq"
>
>
> $ bzr version-info
> revision-id:
> launchpad_translations_on_behalf_of_openerp-20110606054349-hi2fwldkfbzht3rv
> date: 2011-06-06 05:43:49 +0000
> build-date: 2011-06-06 15:11:09 +0700
> revno: 4631
> branch-nick: addons
>
> $ bzr info
> Standalone tree (format: 2a)
> Location:
> branch root: .
>
> Related branches:
> parent branch:
> http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/793407/+subscriptions
>
--
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/793407
Title:
[trunk] IntegrityError: duplicate key value violates unique constraint
"product_uom_factor_category_id_uniq"
Status in OpenERP Modules (addons):
New
Bug description:
I experience this error when loading data into a newly created DB.
This seems to be a regression as it doesn't happen on 6.0 release. I'm
not sure that assuming the factor must be uniq per category is a
valid.
[2011-06-06 15:02:13,286][dev60] INFO:init:module crclinic_data: loading data/crclinic_data-product.uom.xml
[2011-06-06 15:02:13,357][dev60] ERROR:db.cursor:bad query: insert into "product_uom" (id,"active","name","factor","rounding","category_id","uom_type",create_uid,create_date) values (15,E'True',E'cái',1.0,E'1.000',6,E'reference',1,now())
Traceback (most recent call last):
File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 131, in execute
res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint "product_uom_factor_category_id_uniq"
[2011-06-06 15:02:13,358][dev60] ERROR:tools.convert.xml_import:Parse error in /media/data/Projects/openerp-6.0/server/bin/addons/crclinic_data/data/crclinic_data-product.uom.xml:55:
<record id="product_uom_unit_cai" model="product.uom">
<field name="category_id" ref="product_uom_categ_cai"/>
<field name="name">cái</field>
<field name="factor_inv" eval="1"/>
<field name="factor" eval="1"/>
<field name="rounding" eval="1"/>
<field name="uom_type">reference</field>
<field name="active">True</field>
</record>
Traceback (most recent call last):
File "/media/data/Projects/openerp-6.0/server/bin/tools/convert.py", line 865, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/media/data/Projects/openerp-6.0/server/bin/tools/convert.py", line 832, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/media/data/Projects/openerp-6.0/server/bin/addons/base/ir/ir_model.py", line 691, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/media/data/Projects/openerp-6.0/server/bin/addons/product/product.py", line 94, in create
return super(product_uom, self).create(cr, uid, data, context)
File "/media/data/Projects/openerp-6.0/server/bin/osv/orm.py", line 3649, in create
cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 78, in wrapper
return f(self, *args, **kwargs)
File "/media/data/Projects/openerp-6.0/server/bin/sql_db.py", line 131, in execute
res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint "product_uom_factor_category_id_uniq"
$ bzr version-info
revision-id: launchpad_translations_on_behalf_of_openerp-20110606054349-hi2fwldkfbzht3rv
date: 2011-06-06 05:43:49 +0000
build-date: 2011-06-06 15:11:09 +0700
revno: 4631
branch-nick: addons
$ bzr info
Standalone tree (format: 2a)
Location:
branch root: .
Related branches:
parent branch: http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/793407/+subscriptions
References