Skip to Content
Menu
This question has been flagged
3 Replies
5092 Views


Having some issues saving this PO. 

We are using Odoo to do some very basic purchasing and receiving.  I have about 50 items saved that could be purchased/received and only 2 locations. I built and received 13 PO's for the first location and those went great.

I tried to then build the first PO for the 2nd location, which does happen to have 1 line, which is already been purchased and received at the other location ( but why would that matter anyhow?) But when i build the new PO, with this 1 line i get this error.  When i change the location back to the 1st one it does save fine... I do not get what is different from my 2nd location. Based on all that i can see i added this second location the same as i did the first. Any thoughts on this?   

Thanks  - Aaron      


Avatar
Discard
Best Answer


I can reproduce you issue and got the same error as below.

Error

This error raised from constraints in the stock_picking.py 

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

You have two operation type and each one has its sequence, that's mean you linked each operation type to different sequence and the sequence prefix is the same WH/IN/ and your locations create same sequence which already used so you got the error.

Operations

Sequences

Solution 1:

To solve the issue Go to Inventory -> Configurations -> Operation Types and change the sequence of the operation used for location2 to the same of the location 1.


Solution 2:

If you want to use different sequence for the operation of location2, enable developer mode go to settings ->Technical -> Sequences and search for sequence used in the operation of location2 and change prefix to something else  WH/IN/ lets say WH/IN/LOC2/ and Save and it will work with you.

I have tested this in my environment.

Please let me know if you have any doubts.


Avatar
Discard
Best Answer

Thanks Waleed. This help me resolve the same error from the POS module. Appreaciate

Avatar
Discard
Author Best Answer

Thanks for your very detailed reply.  I also received a reply direct from Odoo support and this is what they told me, which i tried before doing what you said and i am now able to load Purchase Orders for Location #2.


Will you please confirm the behavior now as I have increment number to next sequence. The system tries to create Incoming shipment with number 025/IN/00017 but since it's already existed in the system it's not possible to use the same sequence number. The shipment should be generated with sequence number 025/IN/00018

I look forward to the result at your end. Thank you and have a great day!


Avatar
Discard

Yes, if the shipment number already exits, you will not be able to use it so increment it and it will work.