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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
2060
Widoki
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
cze 25
|
15522 | ||
|
3
kwi 25
|
5740 | ||
Compute Fields
Rozwiązane
|
|
2
lip 24
|
3532 | |
|
1
sty 24
|
1888 | ||
|
1
lip 22
|
2321 |