i suppose I've not fully undrestood the prototype inheritance in Odoo. I try to inherit crm.lead
The Model :
class learn_odoo(models.Model):
class learn_odoo(models.Model): _name = 'learn_odoo.learn_odoo' _inherit = ['crm.lead'] _description = 'learn_odoo.learn_odoo' tag_ids = fields.Many2many('mail.channel','mail_channel_profile_crm', 'partner_id', 'tag_id') job = fields.Char()
The view :
Learn Odoofield>
learn_odoo.learn_odoofield>
xpath>
field>
record>
Learn Odoofield>
ir.actions.act_windowfield>
learn_odoo.learn_odoofield>
tree,formfield>
p>
p>
field>
record>
The Error :
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/15/odoo15/odoo/api\.py",\ line\ 886,\ in\ get
\ \ \ \ return\ field_cache\[record\._ids\[0\]\]
KeyError:\
During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:
Traceback\ \(most\ recent\ call\ last\):
\ \ File\ "/opt/odoo/15/odoo15/odoo/fields\.py",\ line\ 1061,\ in\ __get__
\ \ \ \ value\ =\ env\.cache\.get\(record,\ self\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/api\.py",\ line\ 889,\ in\ get
\ \ \ \ raise\ CacheMiss\(record,\ field\)
odoo\.exceptions\.CacheMiss:\ 'learn_odoo\.learn_odoo\(,\)\.duplicate_lead_count'
The\ above\ exception\ was\ the\ direct\ cause\ of\ the\ following\ exception:
Traceback\ \(most\ recent\ call\ last\):
\ \ File\ "/opt/odoo/15/odoo15/odoo/addons/base/models/ir_http\.py",\ line\ 237,\ in\ _dispatch
\ \ \ \ result\ =\ request\.dispatch\(\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 687,\ in\ dispatch
\ \ \ \ result\ =\ self\._call_function\(\*\*self\.params\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 359,\ in\ _call_function
\ \ \ \ return\ checked_call\(self\.db,\ \*args,\ \*\*kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/service/model\.py",\ line\ 94,\ in\ wrapper
\ \ \ \ return\ f\(dbname,\ \*args,\ \*\*kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 348,\ in\ checked_call
\ \ \ \ result\ =\ self\.endpoint\(\*a,\ \*\*kw\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 916,\ in\ __call__
\ \ \ \ return\ self\.method\(\*args,\ \*\*kw\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 535,\ in\ response_wrap
\ \ \ \ response\ =\ f\(\*args,\ \*\*kw\)
\ \ File\ "/opt/odoo/15/odoo15/addons/web/controllers/main\.py",\ line\ 1342,\ in\ call_kw
\ \ \ \ return\ self\._call_kw\(model,\ method,\ args,\ kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/addons/web/controllers/main\.py",\ line\ 1334,\ in\ _call_kw
\ \ \ \ return\ call_kw\(request\.env\[model\],\ method,\ args,\ kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/api\.py",\ line\ 464,\ in\ call_kw
\ \ \ \ result\ =\ _call_kw_multi\(method,\ model,\ args,\ kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/api\.py",\ line\ 451,\ in\ _call_kw_multi
\ \ \ \ result\ =\ method\(recs,\ \*args,\ \*\*kwargs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 6494,\ in\ onchange
\ \ \ \ snapshot1\ =\ Snapshot\(record,\ nametree\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 6276,\ in\ __init__
\ \ \ \ self\.fetch\(name\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 6286,\ in\ fetch
\ \ \ \ self\[name\]\ =\ record\[name\]
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 5893,\ in\ __getitem__
\ \ \ \ return\ self\._fields\[key\]\.__get__\(self,\ type\(self\)\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/fields\.py",\ line\ 1110,\ in\ __get__
\ \ \ \ self\.compute_value\(recs\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/fields\.py",\ line\ 1269,\ in\ compute_value
\ \ \ \ records\._compute_field_value\(self\)
\ \ File\ "/opt/odoo/15/odoo15/addons/mail/models/mail_thread\.py",\ line\ 411,\ in\ _compute_field_value
\ \ \ \ return\ super\(\)\._compute_field_value\(field\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 4255,\ in\ _compute_field_value
\ \ \ \ getattr\(self,\ field\.compute\)\(\)
\ \ File\ "/opt/odoo/15/odoo15/addons/crm/models/crm_lead\.py",\ line\ 581,\ in\ _compute_potential_lead_duplicates
\ \ \ \ lead\.duplicate_lead_ids\ =\ duplicate_lead_ids\ \+\ lead
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 5770,\ in\ __add__
\ \ \ \ return\ self\.concat\(other\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/models\.py",\ line\ 5781,\ in\ concat
\ \ \ \ raise\ TypeError\(f"cannot\ concat\ different\ models:\ '\{self\._name\}\(\)'\ and\ '\{arg\._name\}\(\)'"\)
Exception
The\ above\ exception\ was\ the\ direct\ cause\ of\ the\ following\ exception:
Traceback\ \(most\ recent\ call\ last\):
\ \ File\ "/opt/odoo/15/odoo15/odoo/http\.py",\ line\ 643,\ in\ _handle_exception
\ \ \ \ return\ super\(JsonRequest,\ self\)\._handle_exception\(exception\)
\ \ File\ "/opt/odoo/15/odoo15/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
TypeError: cannot concat different models: 'crm.lead()' and 'learn_odoo.learn_odoo()'