Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Thursday, January 29, 2015

Put multiple images for a product in Odoo 8 ecommerce web page

I really like the idea that Odoo provide both a powerfull ERP solution as well as a quite functional ecommerce solution. However compare to other ecommerce solution Odoo is missing some functions, One concern is on Ebay, Amazon as well as many e-commerce websites, they use slides to show multiple pictures at the left-top section. But Odoo only allow one pictures. So I raised a question here: 
"Can an e-commerce pages show multiple pictures at the left top part of the page in V8?"

Luke Branch now provides a addon. (check https://github.com/OdooCommunityWidgets/website_multi_image). It works great and I want to share how I install this addon with you. 

Here is how I install the addon, please be aware you configuration/odoo folders may be different, if you follow my post to install Odoo you should be able to follow this instruction without issue.  

First stop odoo server and run the following to get the custom module. 


sudo su - odoo -s /bin/bash
mkdir custom_modules
cd /opt/odoo/custom_modules/
git clone -b 8.0 https://github.com/OdooCommunityWidgets/website_multi_image.git 
Now you have the file you need to Scaffolding this module. Still run as odoo user:
cd ..
./odoo.py scaffold website_multi_image addons
cp -R custom_modules/website_multi_image addons/.
At this point you need to start odoo server. Log into Odoo as admin, make sure "Technical Features" is turned on for admin, if not, go to Settings->Users, edit admin user by check "Technical Features" checkbox. 

No go to Settings->Modules->Update Modules List and click Update button. When finished, install "Product Multi-Image". 

Then you can go to Product configuration page -> product images and add more images for the product. 

Well here is how it looks like on website: 




And here is how it looks in product maintain page: 



Thursday, July 3, 2014

Import and Export in Odoo V8

In order to be able to export/import we have to go to Settings->Configuration->General settings. check the box "Allow users to import data from CSV files" and apply the change.

Now let's see an example of import/export a product:

Go to any products view and change it to "list view", for some reason Kanban View and Form View do not have import/export as an option.

You will only see "Import" in "list view" if you don't choose any product. For export, first choose some or all products by choose the check box(s) in left, then click "more" button on top of the view, choose "Export" from there.

Export:
After click Export, set export type to be "import-compatible Export", choose Export Formats as "CSV".

Import: 
My suggestion: It's better you check the export file to make sure your import file is based on the columns you need):

To use import to create a new record: 
Although your first field will always be ID, be sure to leave that empty when you are importing so ERP will assign IDs to your items instead of using your items to overwrite the fields on existing items.
when you choose your file to improt be sure to click "file format options", if the encoding is UTF-8 change it to latin1 so it can accept a wider variety of characters like the degree symbol and the like.

So how to load a new product that has multiple variants and variants values? Here is an example(copy those in blue and open as csv file to see better format):


Products / External_id,cost_method,categ_id/id,valuation,name,type,Products / Product Attributs / Attribute,Products / Product Attributs / Product Attribute Value,uom_po_id/id,uom_id/id
,Standard Price,product.ipad,Periodical (manual),iPad Retina Display Duplicate3,Stockable Product,Memory,"16 Go,32 Go",product.product_uom_unit,product.product_uom_unit
,,,,,,Color,"White,Black",,
,,,,,,Wi-Fi,2.4 GHz,,

I will explain the structure of this a little bit:
Products / External_id will be empty for new product
Products / Product Attributs / Attribute is for attribute
Products / Product Attributs / Product Attribute Value: You can put multiple values there, but when you do that, using comma(,) to seperate values. e.g. "16 Go,32 Go". Odoo will not create new attribute values when import product, you only can put the value existing in Odoo.

Even though it has multiple records for one product, Odoo know how to deal with it. Be sure only the first line has product's other information, and Odoo know the following lines is for the product of first line. And be sure to define the right column mapping information when load the variants' attributes and attributes values.

To use import to update a record: 
The only difference is you need to add a reference so Odoo know that is to update a record, not create a new record. My suggestion is use id from the export to identify the records you need to import, be aware that id is called External_id when you import.