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")
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1509
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
Compute Fields
Solved
|
|
2
Jul 24
|
410 | |
|
1
Jan 24
|
421 | ||
|
2
Apr 24
|
1925 | ||
|
1
Jul 22
|
892 | ||
|
0
Oct 24
|
12814 |