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

hi, i want to give an automatic value to my field idarticle with fuction detarticle but it doesn't work. below is my code

[code]

@api.onchange('idcuve')
def getarticle(self):
    for rec in self:
        if rec.idcuve != False :

            rec.idarticle = idcuve.idarticle 

[/code]

my others class are 

class ostation_cuve(models.Model):
_name = "ostation.cuve"

name = fields.Char(string='Libellé', required=True)
idarticle = fields.Many2one('ostation.article', 'Article', required=True )


class ostation_article(models.Model):
_name = "ostation.article"
_description = "article"

name = fields.Char(string='Nom', required=True)
prix = fields.Char(string='Prix de vente', required=True)
cout = fields.Char(string="Coût d'achat")

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 25
25832
2
lip 22
4556
1
wrz 21
4212
3
wrz 21
9007
2
wrz 21
10130