[REF] various: apply main attachment mixin on models that use the feature
Add mail.thread.main.attachment in the inheritance chain of all models that use the main attachment feature. Note that we remove the main attachment from crm_case_15 of the demo data as crm_lead doesn't use that feature. Task-2648976 Part-of: odoo/odoo#110734
This commit is contained in:
@@ -49,7 +49,7 @@ EMPTY = object()
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_name = "account.move"
|
||||
_inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin', 'sequence.mixin']
|
||||
_inherit = ['portal.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin', 'sequence.mixin']
|
||||
_description = "Journal Entry"
|
||||
_order = 'date desc, name desc, id desc'
|
||||
_mail_post_access = 'read'
|
||||
|
||||
@@ -7,7 +7,7 @@ from odoo.tools.misc import format_date, formatLang
|
||||
class AccountPayment(models.Model):
|
||||
_name = "account.payment"
|
||||
_inherits = {'account.move': 'move_id'}
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_description = "Payments"
|
||||
_order = "date desc, name desc"
|
||||
_check_company_auto = True
|
||||
|
||||
@@ -444,10 +444,6 @@ Andrew</p>]]></field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="attachment_ids" eval="[(6, 0, [ref('msg_case15_attach1')])]"/>
|
||||
</record>
|
||||
<!--Main attachment is usually registered by message_post, so here we must set it manually-->
|
||||
<record id="crm_case_15" model="crm.lead">
|
||||
<field name="message_main_attachment_id" ref="msg_case15_attach1"/>
|
||||
</record>
|
||||
<record id="msg_case15_3" model="mail.message">
|
||||
<field name="subject">Re: Plan to buy RedHat servers</field>
|
||||
<field name="model">crm.lead</field>
|
||||
|
||||
@@ -26,7 +26,7 @@ class HrEmployeePrivate(models.Model):
|
||||
_name = "hr.employee"
|
||||
_description = "Employee"
|
||||
_order = 'name'
|
||||
_inherit = ['hr.employee.base', 'mail.thread', 'mail.activity.mixin', 'resource.mixin', 'avatar.mixin']
|
||||
_inherit = ['hr.employee.base', 'mail.thread.main.attachment', 'mail.activity.mixin', 'resource.mixin', 'avatar.mixin']
|
||||
_mail_post_access = 'read'
|
||||
|
||||
# resource and user
|
||||
|
||||
@@ -15,7 +15,7 @@ from odoo.tools import email_split, float_repr, float_compare, is_html_empty
|
||||
class HrExpense(models.Model):
|
||||
|
||||
_name = "hr.expense"
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin', 'analytic.mixin']
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'analytic.mixin']
|
||||
_description = "Expense"
|
||||
_order = "date desc, id desc"
|
||||
_check_company_auto = True
|
||||
@@ -784,7 +784,7 @@ class HrExpenseSheet(models.Model):
|
||||
=================================================================================
|
||||
"""
|
||||
_name = "hr.expense.sheet"
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_description = "Expense Report"
|
||||
_order = "accounting_date desc, id desc"
|
||||
_check_company_auto = True
|
||||
|
||||
@@ -72,7 +72,7 @@ class HolidaysRequest(models.Model):
|
||||
_name = "hr.leave"
|
||||
_description = "Time Off"
|
||||
_order = "date_from desc"
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_mail_post_access = 'read'
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -22,7 +22,7 @@ class Applicant(models.Model):
|
||||
_name = "hr.applicant"
|
||||
_description = "Applicant"
|
||||
_order = "priority desc, id desc"
|
||||
_inherit = ['mail.thread.cc', 'mail.activity.mixin', 'utm.mixin']
|
||||
_inherit = ['mail.thread.cc', 'mail.thread.main.attachment', 'mail.activity.mixin', 'utm.mixin']
|
||||
_mailing_enabled = True
|
||||
_primary_email = 'email_from'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user