Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2717 Visualizzazioni

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.

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ott 22
2860
2
ago 23
4132
0
ott 21
1722
1
set 19
5146
1
giu 25
770