reporting-engine/base_comment_template/models/res_partner.py

24 lines
789 B
Python
Raw Normal View History

2021-05-26 11:32:35 +00:00
# Copyright 2020 NextERP Romania SRL
# Copyright 2021 Tecnativa - Víctor Martínez
2021-03-23 19:14:27 +00:00
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from flectra import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
2021-05-26 11:32:35 +00:00
base_comment_template_ids = fields.Many2many(
2021-03-23 19:14:27 +00:00
comodel_name="base.comment.template",
2021-05-26 11:32:35 +00:00
relation="base_comment_template_res_partner_rel",
column1="res_partner_id",
column2="base_comment_template_id",
string="Comment Templates",
help="Specific partner comments that can be included in reports",
2021-03-23 19:14:27 +00:00
)
@api.model
def _commercial_fields(self):
2021-05-26 11:32:35 +00:00
"""Add comment templates to commercial fields"""
return super()._commercial_fields() + ["base_comment_template_ids"]