You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But, as the model containing the reference field is an abstract model, the table does not exist, illustration for my custom code:
SELECT"activity_rule_execution".id FROM"activity_rule_execution"WHERE ("activity_rule_execution"."trigger_id"="res.partner,41") ORDER BY"activity_rule_execution"."id"
ERROR: relation "activity_rule_execution" does not exist
Hi @Creamaster I cannot confirm your issue as your steps to reproduce are a bit vague, you can try reproducing it on the runbot or clarifying the steps to reproduce (http://runbot.odoo.com/runbot)
You're free to create a PR nevertheless, the fix seems okay to me, I'd probably change if Model._table to if Model._abstract.
Also, unless I'm missing something, there's no need to do the check inside the loop
Regarding the attribute to use, I'm not sure, but, is it possible to tweek the method auto_init to obtain a regular model without a table, or an abstract model with a table ?
It's hard to reproduce the error from the UI. But from inside Odoo, there are tree steps
Create an abstract model
Add a reference field on this model
And, of course, merge some res.partner
I will try to find an abstract model on the runbot, adding some x_field (type Reference) via the UI
Thank you for your report but we are closing it due to inactivity.
We apology if we could not look at your request in time.
If your report still makes sense, don't hesitate to reopen a new one. We will try to check it as soon as possible.
Impacted versions: v10
Steps to reproduce:
have an abstract model with a reference field
Current behavior:
SQL exception (search on non existing table due to the abstract nature of the model)
Expected behavior:
No error ?!
Video/Screenshot:
I could create a merge request but I want some kind of validation on this issue
Analyze
the method _update_reference_fields (click to follow)
search all the reference fields
and try to search on the model containing the field:
But, as the model containing the reference field is an abstract model, the table does not exist, illustration for my custom code:
ERROR: relation "activity_rule_execution" does not exist
fix/proposition
test if the model has a table
Thank you for having taken the time to read
The text was updated successfully, but these errors were encountered: