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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
2069
查看
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
6月 25
|
15525 | ||
|
3
4月 25
|
5753 | ||
Compute Fields
已解决
|
|
2
7月 24
|
3571 | |
|
1
1月 24
|
1889 | ||
|
1
7月 22
|
2324 |