Purpose of this commit is to highlight an issue that may happens easily with
`crm` that is made generic here within `test_mail`.
`crm` alters the context when creating a new record adding in this case
`default_type` to it][1]. The returned record contains that altered context.
his results in other records created from it trying to assign that same default
value for `type`. This is a very common name for fields, and happens to exist
in `ir.attachment` too.
If you create an alias for incoming leads in your DB with default values
`{"type": "lead"}` (something very common) and then an email comes to that
alias that contains an inlined base64 image, the attachment creation process
would simply fail.
Obtained error is ``ValueError: Wrong value for ir.attachment.type: 'lead'`` .
[1]: https://github.com/odoo/odoo/blob/272602193f5647f7f2270ed6ec68777625a139dd/addons/crm/models/crm_lead.py#L310-L311
X-original-commit: 99434b2e8528c10fcc9cb6860765e0ddcaa364c8
Part-of: odoo/odoo#77005
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2.8 KiB
2.8 KiB
| 1 | id | name | model_id:id | group_id:id | perm_read | perm_write | perm_create | perm_unlink |
|---|---|---|---|---|---|---|---|---|
| 2 | access_mail_performance_thread | access_mail_performance_thread | model_mail_performance_thread | 1 | 1 | 1 | 1 | |
| 3 | access_mail_performance_tracking_user | mail.performance.tracking | model_mail_performance_tracking | base.group_user | 1 | 1 | 1 | 1 |
| 4 | access_mail_test_simple_portal | mail.test.simple.portal | model_mail_test_simple | base.group_portal | 1 | 0 | 0 | 0 |
| 5 | access_mail_test_simple_user | mail.test.simple.user | model_mail_test_simple | base.group_user | 1 | 1 | 1 | 1 |
| 6 | access_mail_test_gateway_portal | mail.test.gateway.portal | model_mail_test_gateway | base.group_portal | 1 | 0 | 0 | 0 |
| 7 | access_mail_test_gateway_user | mail.test.gateway.user | model_mail_test_gateway | base.group_user | 1 | 1 | 1 | 1 |
| 8 | access_mail_test_track_portal | mail.test.track.portal | model_mail_test_track | base.group_portal | 0 | 0 | 0 | 0 |
| 9 | access_mail_test_track_user | mail.test.track.user.employee | model_mail_test_track | base.group_user | 1 | 1 | 1 | 1 |
| 10 | access_mail_test_activity_portal | mail.test.activity.portal | model_mail_test_activity | base.group_portal | 1 | 0 | 0 | 0 |
| 11 | access_mail_test_activity_user | mail.test.activity.user | model_mail_test_activity | base.group_user | 1 | 1 | 1 | 1 |
| 12 | access_mail_test_field_type_portal | mail.test.field.type.portal | model_mail_test_field_type | base.group_portal | 0 | 0 | 0 | 0 |
| 13 | access_mail_test_field_type_user | mail.test.field.type.user | model_mail_test_field_type | base.group_user | 1 | 1 | 1 | 1 |
| 14 | access_mail_test_ticket_portal | mail.test.ticket.portal | model_mail_test_ticket | base.group_portal | 0 | 0 | 0 | 0 |
| 15 | access_mail_test_ticket_user | mail.test.ticket.user | model_mail_test_ticket | base.group_user | 1 | 1 | 1 | 1 |
| 16 | access_mail_test_composer_mixin_all | mail.test.composer.mixin.all | model_mail_test_composer_mixin | 0 | 0 | 0 | 0 | |
| 17 | access_mail_test_composer_mixin_user | mail.test.composer.mixin.user | model_mail_test_composer_mixin | base.group_user | 1 | 1 | 1 | 1 |
| 18 | access_mail_test_container_portal | mail.test.container_portal | model_mail_test_container | base.group_portal | 1 | 1 | 0 | 0 |
| 19 | access_mail_test_container_user | mail.test.container.user | model_mail_test_container | base.group_user | 1 | 1 | 1 | 1 |
| 20 | access_mail_test_cc_portal | mail.test.cc.portal | model_mail_test_cc | base.group_portal | 1 | 0 | 0 | 0 |
| 21 | access_mail_test_cc_user | mail.test.cc.user | model_mail_test_cc | base.group_user | 1 | 1 | 1 | 1 |
| 22 | access_mail_test_lang_portal | mail.test.lang.portal | model_mail_test_lang | base.group_portal | 1 | 0 | 0 | 0 |
| 23 | access_mail_test_lang_user | mail.test.lang.user | model_mail_test_lang | base.group_user | 1 | 1 | 1 | 1 |
| 24 | access_mail_test_multi_company_user | mail.test.multi.company.user | model_mail_test_multi_company | base.group_user | 1 | 1 | 1 | 1 |
| 25 | access_mail_test_multi_company_portal | mail.test.multi.company.portal | model_mail_test_multi_company | base.group_portal | 1 | 0 | 0 | 0 |
| 26 | access_mail_test_track_compute | mail.test.track.compute | model_mail_test_track_compute | base.group_user | 1 | 1 | 1 | 1 |
| 27 | access_mail_test_track_monetary | mail.test.track.monetary | model_mail_test_track_monetary | base.group_user | 1 | 1 | 1 | 1 |