Skip to Content
Menu
This question has been flagged
1 Reply
1976 Views

Dear Forum,

In the application 'Repairs' you make your Repair Orders. Within a Repair Order you have the option in the Actions to Duplicate it. This only works if the Repair Order itself is empty in the Repair Lines, but if there is something within the Parts or the Operations tab. You will get the error message: "The name of the Repair Order must be unique!". It has nothing to do with the name because when there is nothing within those tabs and you simply have your name and customer stated, it will just generate the same order, without a name. So it should do the same when the order is fully filled with lines.

The same function of Duplicate is within the Sales Orders, within this application it is not a problem if you have Sale Order Lines. I am guessing this is a mistake in the code. Anyone any idea what an easy fix could be?

Sometimes these orders are re-occuring repairs and then it would be much easier to just duplicate the entire order with lines. It should be an easy fix but I don't know how.



Avatar
Discard
Best Answer

I have Odoo 13 and I was able to duplicate any order even if there is Parts and Operations. The default repair name is / and its updated automatically once the order created and it depends on repair.order sequence to get the next sequence value.

Update answer:

The order name is unique for all companies and you have multi company, You need to create sequence for each company with different prefix because of the constraint of the name to be unique in all company. as per below line:

_sql_constraints = [
('name', 'unique (name)', 'The name of the Repair Order must be unique!'),
]

Avatar
Discard
Author

Hi Waleed, interesting. Ours works exactly the same with the '/' when duplicating. But the moment you use a line in Parts or Operations, it stops working. I wonder what caused that then.

Do you have a repair order created with / as a name? if Yes then that's what cause the issue just change the name of this order and try to duplicate.
Do you have any custom module for repair module?
When you duplicate an empty order is the order number increasing?
Do you have multi company?

Author

Hi Waleed. Sorry for the late reply. No, the one that I want to copy does have a different name, not the default '/', but 'FM-002'. We do not have any custom modules in the repair module. The ID number is increasing when duplicating an 'empty' order yes. And yes, we have a multi-company system.

Since you have multi company, do you have a sequence for each company for repair order. The prefix of the sequence need to be different for each company because the order name is unique but not for each company.

Author

Oh wow. You might be right, it has something to do with that. I just found out what fixed it when meddling with sequences and the prefix '/'. So, when there is a repair order that was duplicated but just not updated, it keeps the name with '/'. The moment that is the case, you cannot duplicate any other repairs. Doesn't matter in which company you are, there is an existing repair order with the name '/' and it just stops working. Now I deleted the one named '/', now there is no problem with duplications. Interesting. THank you for your help!

Great. You need to create sequence for each company with different prefix because of the constraint of the name to be unique in all company. as per below line:

_sql_constraints = [
('name', 'unique (name)', 'The name of the Repair Order must be unique!'),
]

Author

I will discuss the wishes of the sequences with the corresponding companies. Not everyone wants numbering, so might just change the default to 'Title' so everyone knows they should change '/'. Perfect thanks.

Related Posts Replies Views Activity
1
Nov 24
3360
0
Sep 24
79
1
Sep 24
145
1
Sep 24
166
2
Sep 24
400