Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Sales order import skipping sequence

By
Keenmeng Lew
on 8/11/16, 5:03 AM 200 views

Hi,


I am importing one sales order at a time into Odoo using a CSV file.  The CSV files contains one order with two order lines.  The issue I have is the sequence for sales order number increments by three.  Is there a way to fix this?


My CSV structure for the import of a single sales order of multiple order lines looks like this: -

project_id/id | partner_id/id | client_order_ref | date_order | order_line/product_id/id | order_line/product_uom_qty | order_line/price_unit | order_line/tax_id/id | pricelist_id/id

With the exception of non-sequential numbering, it works.


Cheers!

km

There must be some fields, by which you can identify in CSV file, that these order lines belongs to same Sales Order.

Do you have any column in csv file, whose value is unique per Sales Order?

Asmita Chavan
on 8/12/16, 8:30 AM

Thanks for your feedback, Asmita. I have updated the original question with the CSV structure I am using.

Keenmeng Lew
on 8/12/16, 8:47 AM
1
Asmita Chavan
On 8/16/16, 8:41 AM

With your revised Question, and CSV format you shared,

I consider that, client_order_ref column in csv is unique, per Sales Order.

If my consideration is correct,

Then, whenever you are importing this CSV file, create method gets called ; And you must be mapping client_order_ref column with one of the field of sale.order model, So in create method you can handle this duplication of Sales Order Record.

You can write the condition in create method, which will check if any Sales Order with mentioned client_order_ref exists or not, and if exists do not create another Sales Order, just link existing Sales Order to that Sale Order line.

Hope, this works!

Thank you

Thanks for sharing your thoughts Asmita. If I understand you correctly, Odoo is behaving as designed, albeit slightly nonintuitively, and the only way to fix this would be to change it programatically.

KM

Keenmeng Lew
on 8/16/16, 9:59 AM

yes, we have to follow the framework in Odoo. So, this can be only fixed at coding level.

Asmita Chavan
on 8/16/16, 10:05 AM

Thanks Asmita. You've been a great help.

Keenmeng Lew
on 8/17/16, 10:34 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/11/16, 5:03 AM
Seen: 200 times
Last updated: 8/17/16, 10:34 PM