Unique on inventory problem

139 views
Skip to first unread message

Rhys

unread,
Aug 8, 2017, 6:05:06 PM8/8/17
to tryton, Rhys Lewis
Hello

I recently updated Tryton from 3.8 -> 4.0 ->4.2.

Now when I create an inventory, even with only one product listed and press "Confirm", I get an error dialogue:

'Line "<my product name>" is not unique on Inventory "51". '

Do you know what could be causing that?

Cédric Krier

unread,
Aug 8, 2017, 7:45:10 PM8/8/17
to tryton
You have entered more than one times the same product.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Rhys

unread,
Aug 9, 2017, 5:50:06 AM8/9/17
to tryton
Thank you for the reply Cédric

The product only exists once on the inventory (it is the only item I have on the inventory). Is there a way I track down what is causing the problem?

Regards Rhys

Cédric Krier

unread,
Aug 9, 2017, 6:35:08 AM8/9/17
to tryton
On 2017-08-09 02:15, Rhys wrote:
> Thank you for the reply Cédric
>
> The product only exists once on the inventory (it is the only item I have
> on the inventory). Is there a way I track down what is causing the problem?


This is very strange because the code it pretty simple:
http://hg.tryton.org/modules/stock/file/4.2/inventory.py#l123

Rhys

unread,
Aug 9, 2017, 8:50:06 PM8/9/17
to tryton
I am not much of a Python programmer so I can't really interpret what the code is doing. 
What value is Tryton looking for to be unique? Is it the product id?

Regards Rhys

Sergi Almacellas Abellana

unread,
Aug 10, 2017, 3:41:26 AM8/10/17
to try...@googlegroups.com
El 09/08/17 a les 19:27, Rhys ha escrit:
> I am not much of a Python programmer so I can't really interpret what
> the code is doing.
> What value is Tryton looking for to be unique? Is it the product id?
>
Is the product id on the default stock module. The product id and the
lot if if you have the stock_lot module installed.

P.S: Please don't top post on this mailing list. See:
http://groups.tryton.org/netiquette

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Ul

unread,
Aug 10, 2017, 10:07:08 AM8/10/17
to try...@googlegroups.com
Am 09.08.2017 um 19:27 schrieb Rhys:
> I am not much of a Python programmer so I can't really interpret what
> the code is doing.
> What value is Tryton looking for to be unique? Is it the product id?

Once I had this problem too. To debug it I was running the whole server
with a copy of the database on my local Computer in an IDE (Wingware)
with debugging mode, setting stop points and checking the stack-data.
This way i followed it down to the SQL-Querry.

In the end it was a error in the data in the database, that resulted in
the Query giving back multiple records for this one line.
The wrong data originated from me messing by hand in the database when
testing. I don't remember what was wrong exactly and i didn't take notes
as it usually can't happen.

I hope it helps even as I'm not very specific.

Best Regards,

Ulrich
Reply all
Reply to author
Forward
0 new messages