콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
7719 화면

Because quiet often importing data from external sources, decided to create a module as flexible as possible so I can change set of fields depending on CSV source and map it into product_template table columns.

So i have a source selector [ebay, opencart, stock, end more], choosing source, loading data from CSV,  (product_name=> name, price=>sale_price ... etc) into fields.

Once CSV is loaded i can use all the records to create new product by selectiong records from list or all in one go.

self.env['product.template'].create({'name': record.product_name,'sale_price': record.price,.......})

The only problem I have now is: if I add image_stream to the query/API it generate an error, once I remove image_stream everything works fine.

The question is: how can I use image binary stream(converted image) while new product is created?

Tried already a few methods but regardless of what I'm doing it still displaying error:

2016-05-11 08:18:05,679 49329 ERROR Farmore openerp.http: Exception during JSON request handling.

MissingError: ('MissingError', u'One of the documents you are trying to access has been deleted, please try again after refreshing.')

아바타
취소
작성자 베스트 답변

This is my import product page view and here the product image is displayed. Just abowe there is a button "ProCreator" clicking this button new product is created with all required data ...... unfortunately without image and I'm getting this error:

Creating product!

2016-05-11 08:18:05,679 49329 ERROR Farmore openerp.http: Exception during JSON request handling.

MissingError: ('MissingError', u'One of the documents you are trying to access has been deleted, please try again after refreshing.')

Maybe because the image is already converted and while product is created "create" method is trying to do it again ?

Apart of that it works pretty well ;)


Problem solved, another module causing this issue.

Now it works just fine!

Thank You Pawan!

아바타
취소
베스트 답변

I'm interested by the response cause I want to do the same thing.

아바타
취소
베스트 답변

If your question is how to create products by importing a csv file then the answer is yes.I do it frequently. 


The matching of the csv file columns with the Odoo field names is essential;

to avoid errors, start exporting a list of articles with all the fields that you need for the import. Some fields are mandatory (name etc...); they are colored in blue in the exporting interface.

Then reuse this exported format with your new products.

You will import product, not variants


아바타
취소
작성자

Read changed post above.

작성자

When you importing data from CSV into your products, what is the content of the image column ? Is it a link yo file ? is it an image itself ?