Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
17123 มุมมอง

I'm using Odoo v12.0 
I have added some attributes with values and i want to import my products from Excel file and use those attributes in it.

Problem is it won't let me because it can't find the attribute i'm using in Excel file,.

On the other hand if i use Odoo's default attributes it will import without errors.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Amin: 

You can do this in 3 steps.

  1. Go to Inventory > Configuration > Attributes and define the product attributes manually in Odoo. This is the attribute definition.

  2. Go to Inventory > Configuration > Attribute Values and use the import feature to import the valid attribute values.

  3. Go to Inventory > Master Data > Products and import the attribute values for each product.

You will need to create Excel templates for steps 2 and 3. Step 1 can be done manually if the number of attributes is small. If the number of attributes is large you can create a template for this too.

 Hope this helps.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
Hello,
you need to create the attribute in the product template configuration
this is an example:
if data['ATTRIBUTES']:

for attr in data['ATTRIBUTES']:

attribute, value = attribute.strip(), value.strip()

# Attribute get / create
attribute_id = Attribute.search([
('name', '=', attribute)
])
if not attribute_id:
attribute_id = Attribute.create({'name': attribute,
'create_variant': 'always'})
value_id = AttrValue.create({'name': value,
'attribute_id': attribute_id.id})

else:
# Attribute value get / create
value_id = attribute_id.value_ids \
.filtered(lambda attr_value: attr_value.name == value)

if not value_id:
value_id = AttrValue.create({'name': value,
'attribute_id': attribute_id.id})
value_ids.append(value_id.id)

# Attribute line get / create
attr_line_id = tmpl_id.attribute_line_ids.filtered(
lambda line: line.attribute_id.id == attribute_id.id
)
if not attr_line_id:
AttributeLine.create({
'product_tmpl_id': tmpl_id.id,
'attribute_id': attribute_id.id,
'value_ids': [(4, value_id.id)]
})
else:
attr_line_value_id = attr_line_id.filtered(
lambda line: value_id.id in line.value_ids.ids
)
if not attr_line_value_id:
attr_line_id.value_ids = [(4, value_id.id)]
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi, you can follow https://youtu.be/SgFmOD9Q2S4?si=46y7nPM_rumGs9NU

I hope it helps, thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Paresh,


I do not have an "Attribute Values" menu - do you know how to configure it?

Thank you,

Kristina

อวตาร
ละทิ้ง

You can directly import it from Attributes. Try to export [value_ids/id] and [value_ids/name], you can add extra line and fill and re-import.

Alternatively,
If you are familiar with parent-child relation and wanted to import it from Attribute Values, you can use Odoo Studio in order to add the menu.

คำตอบที่ดีที่สุด

Hi  Amin Dehghani,

I think this module can help you: https://apps.odoo.com/apps/modules/12.0/vks_import_excel

Demo: https://www.youtube.com/watch?v=UOBxxnYDIsM&list=PLSKcWRTtEl5qzvRaI-VTGavfReiHS_EEb&index=1

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 25
731
1
ก.ค. 24
2924
2
ต.ค. 23
2128
Import Products by SKU แก้ไขแล้ว
2
มี.ค. 24
2968
PRODUCT LISTS IMPORTING ISSUE แก้ไขแล้ว
1
ก.พ. 22
2115