Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2078 Zobrazení
  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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvn 25
15528
3
dub 25
5756
Compute Fields Vyřešeno
2
čvc 24
3618
1
led 24
1893
1
čvc 22
2327