Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2073 Vizualizări
  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") 


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iun. 25
15525
3
apr. 25
5754
2
iul. 24
3588
1
ian. 24
1890
1
iul. 22
2325