Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Reference must be unique per company

Avatar
odoo
Avatar
Discard
7 Answers
0
Avatar
odoo
Best Answer

our client just had the same issue when he try to confirm the SO.

this is the reason why this error is happening:

_sql_constraints = [    ('name_uniq', 'unique(name, company_id)', 'Reference must be unique per company!'),]

this is a sql constrain in the "stock.picking" model, from it we can understand that the name should be unique and after a little tracing , it looks like some one changed the Next number in the  WH/OUT Sequences  to 1,after changing it back to it's proper value,the issue has been fixed.

in your case you should look for the sequence with the prefix WH/IN/

I hope this would help somebody. 

1 Comment
Avatar
Discard
Avatar
odoo
-

@mohammed
You saved my life

0
Avatar
odoo
Best Answer

First, you need to identify the error, mine is:
ERROR: duplicate key value violates unique constraint "stock_picking_name_uniq"
DETAIL: Key (name, company_id)=(WH/POS/00012, 1) already exists.

Next, you search the 'stock.picking' table in Postgres, check the largest number in name of the sequence in error (e.g., mine is WH/POS/00014, but the Next Number in WH/POS sequence is also 14.

I changed it to 15, then it works. This solution should be applicable to all of prefix (e.g. WH/IN/)

Avatar
Discard
0
Avatar
odoo
Best Answer

I am also facing the same error while taking return the Delivery Challan. Still Tracing it.

Avatar
Discard
0
Avatar
odoo
Best Answer

You didn't post a question (ending with "?") in your title - that could be why.

Not everyone will open your post to see if you have a question in it.

Review https://www.odoo.com/forum/help-1/question/meta-why-do-some-questions-get-answers-and-others-don-t-25620

Avatar
Discard
0
Avatar
odoo
Best Answer

I saw your post, as I have the same issue while developing a module that automates invoices. Will do more research and post back if I find an answer.

Avatar
Discard
0
Avatar
odoo
Best Answer

I Saw your post :)

Avatar
Discard
0
Avatar
odoo
Best Answer

As I received no answer ever to any of my posts here, If you read this post, no matter how long it is passed from the date of my post, and no matter you have an answer or not, if you can login, please post a comment like:
I saw your post.

I just want to know if anybody is reading this forum! That's enough for me. Thanks!

Avatar
Discard