コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
17103 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
5月 25
728
1
7月 24
2920
2
10月 23
2124
2
3月 24
2961
1
2月 22
2112