跳至内容
菜单
此问题已终结

I want to duplicate an attribute of a product after the user selects it. However, I want it to only contain the previously selected values in its attributes and not the values of all the attributes of the original product, in order to only create 1 product variable.

I tried this:

for attribute in self.customization_attribute_line_ids.article_id:
   attribute.copy({
      'name': "{} - {}".format(attribute.name, self.name)
   })

If anyone has any suggestions I would appreciate it.

形象
丢弃
最佳答案

Hi,

We can use article.copy for that, try like below.

self.article_id.copy( default={ 'name': self.article_id.name, 'list_price': self.production_price() } )

Regards

形象
丢弃
最佳答案

Olá.

Você pode tentar uma função que monitora a seleção desses produtos algo do tipo @api.onchange('nome da variavel de seleção'), e a partir disto adicionar os atributos deste produto especifico em uma lista.

形象
丢弃
相关帖文 回复 查看 活动
0
10月 22
2924
2
8月 23
4199
0
10月 21
1748
1
9月 19
5173
1
6月 25
815