Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2087 Visualizzazioni
  1. Hello, i got a model (book) where i can add books and assign authors to them (res.partner) in many2many: authors = fields.Many2many('res.partner', string='Authors')
    
    I then made another model which inherits from res partner to add a boolean 'isAuthor', that way i can filter them in a graph.
    
    
    
    Now i want to add a computed field that counts how many books an author has.
    
    I made this:
    
    nbBooks = fields.Integer('Number of authored books', compute='nombre_livre_auteur', store=True)
    
    #@api.depends("author") 


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 25
15539
3
apr 25
5779
2
lug 24
3763
1
gen 24
1898
1
lug 22
2336