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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
7149
查看
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
1月 25
|
1709 | ||
|
2
9月 22
|
9432 | ||
|
2
4月 22
|
4458 | ||
|
1
3月 21
|
4856 | ||
|
5
8月 20
|
18899 |
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")