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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
6916
Widoki
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
sty 25
|
1446 | ||
|
2
wrz 22
|
9245 | ||
|
2
kwi 22
|
4228 | ||
|
1
mar 21
|
4676 | ||
|
5
sie 20
|
18566 |
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")