I am working on Chap 8 of "Getting Started" (Titled "(Relations of Models)").I have a One2many fields in a model named estate.estate as below:
offer_ids = fields.One2many('estate.property.offer', 'partner_id', string='Offers4')
In the co-model estate.property.offer I have a Many2one counterpart:
partner_id = fields.Many2one('res.partner', string='Property Offers', required=True)
In the form view of the model estate.estate, I have the following XML data
estate.estate.form
estate.estate
I get the correct display, but in the field where the One2many field offer_ids supposed to work,
when I hit "Add a line", I got the following exception:
Traceback (most recent call last): File "/home/albert/src/odoo/odoo/http.py", line 639, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/home/albert/src/odoo/odoo/http.py", line 315, in _handle_exception raise exception.with_traceback(None) from new_cause ValueError: Invalid field 'Title' on model 'res.partner'Where the co-called invalid field is the first field declaration in my XML file. When I mark outthat line, then the error message will show the next field as invalid on model 'res.partner'.
I think I had some mistakes on XML description. But I cannot find out after searching
it for 5 hours.
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ờ
7189
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 1 25
|
1765 | ||
|
2
thg 9 22
|
9489 | ||
|
2
thg 4 22
|
4523 | ||
|
1
thg 3 21
|
4912 | ||
|
5
thg 8 20
|
18984 |
I also face same issue, after spending some time and re-reading related article I found the solution. The issue is with second parameter, it should be the "field-name in that model referring this record" i.e. instead of partner_id it should be property_id.
offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers")