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
此問題已被標幟
            
                7850
                
                    瀏覽次數
                
            
        
    | 相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
|---|---|---|---|---|
|  | 1 1月 25  | 2526 | ||
|  | 2 9月 22  | 10261 | ||
|  | 2 4月 22  | 5166 | ||
|  | 1 3月 21  | 5529 | ||
|  | 5 8月 20  | 19848 | 
 
                        
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")