Summary of Common Odoo Functions and Attributes
I. Odoo Functions
1 Query Method
search(): Called in the search view
search_count(): Called when counting records in the view
name_search(): called when searching many2one fields
search_read(): Called when clicking "Search More" on a many2one field
read_group(): Called when grouping search views
二 Odoo-Context-key:value
Functions corresponding to 1 context
Get the value corresponding to the key in the context
self._context.get(filedname)
Set the value corresponding to the key in the context
self.with_context({'filed_1':'new_value_1','field_2':'new_value_2'})
2 context corresponding key
country_id: The context parameter can be added to a many-to-one field, for example: append the corresponding country field after the state address.
<field name="state_id" context="{'country_id':country_id}">
1
currency_id: Display currency
search_default_fieldname: Default search field, introduced in the action XML.
group_by: Grouping.
default_fieldname: Set default values for fields in the record.
tree_view_ref/form_view_ref: Specifies the view opened when clicking a many2one field
