Invalid example in Chapter 12
Chapter 12 gives example:
which links to this code:
but it throws exception:
prop = self.env['estate_property'].browse(vals_list['property_id'])
~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str
This is because vals_list is:
estate_property_offer: [{'price': 17, 'partner_id': 1, 'validity': 7, 'validity_date': '2025-11-02', 'property_id': 1}]
So, vals_list[0]['property_id'] solves the problem, but it's odd...
Domain
In Chapter 12, the Exercise says to Add a domain to the field to inherited view:
which is described later in the chapter, so it should be in the second Exercise.
Additionally - please describe how to add domain to a field, because so far we've added domain to action:
of filter_domain:
<search string="Test">
<field name="description" string="Name and description"
filter_domain="['|', ('name', 'ilike', self), ('description', 'ilike', self)]"/>
</search>
both in Chapter 11
Also - please clarify that the class name of inherited model must be exactly ResUsers and not "InheritedResUsers" or "InheritedSalesPerson"
Otherwise an exception is thrown:
File "/usr/lib/python3/dist-packages/odoo/orm/fields.py", line 544, in setup
self.setup_nonrelated(model)
File "/usr/lib/python3/dist-packages/odoo/orm/fields_relational.py", line 1302, in setup_nonrelated
raise TypeError(msg % (self, field))
TypeError: Many2many fields inherited.sales.person.company_ids and res.users.company_ids use the same table and columns