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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
2068
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 6 25
|
15524 | ||
|
3
thg 4 25
|
5751 | ||
Compute Fields
Đã xử lý
|
|
2
thg 7 24
|
3559 | |
|
1
thg 1 24
|
1889 | ||
|
1
thg 7 22
|
2324 |