Conversation
Currently translated at 100.0% (9 of 9 strings) Translation: hr-15.0/hr-15.0-hr_announcement Translate-URL: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_announcement/it/
Currently translated at 100.0% (9 of 9 strings) Translation: hr-15.0/hr-15.0-hr_announcement Translate-URL: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_announcement/es/
alexey-pelykh
left a comment
There was a problem hiding this comment.
Thanks for the migration! Found a bug in create():
vals_list.get("employee_ids") will crash — with @api.model_create_multi, vals_list is a list of dicts, not a single dict. list doesn't have .get(). The write() method is fine since write() receives a dict.
Should be something like any(v.get("employee_ids") for v in vals_list).
Also, the README badges still point to 17.0 for Weblate and Runboat — should be updated to 18.0.
|
|
||
| @api.model_create_multi | ||
| def create(self, vals_list): | ||
| announcement = super().create(vals_list) |
There was a problem hiding this comment.
vals_list is a list (from @api.model_create_multi), not a dict — list.get() doesn't exist. This will raise AttributeError. Same pattern in write() works because write() receives a dict. Consider iterating: any(v.get("employee_ids") for v in vals_list).
No description provided.