Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2708 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 22
2854
2
sie 23
4131
0
paź 21
1717
1
wrz 19
5144
1
cze 25
766