diff --git a/sale_comment_template/models/sale_order.py b/sale_comment_template/models/sale_order.py index 99da6b27..c753f3ef 100644 --- a/sale_comment_template/models/sale_order.py +++ b/sale_comment_template/models/sale_order.py @@ -42,7 +42,7 @@ def _prepare_invoice(self): @api.onchange('partner_id') def onchange_partner_id_sale_comment(self): if self.partner_id: - comment_template = self.partner_id.comment_template_id + comment_template = self.partner_id.property_comment_template_id if comment_template.position == 'before_lines': self.comment_template1_id = comment_template elif comment_template.position == 'after_lines': diff --git a/sale_comment_template/tests/test_sale_order_report.py b/sale_comment_template/tests/test_sale_order_report.py index 42ab192e..af956f9a 100644 --- a/sale_comment_template/tests/test_sale_order_report.py +++ b/sale_comment_template/tests/test_sale_order_report.py @@ -57,7 +57,7 @@ def test_comments_in_generated_invoice(self): ) def test_onchange_partner_id(self): - self.partner_id.comment_template_id = self.after_comment.id + self.partner_id.property_comment_template_id = self.after_comment.id vals = { 'partner_id': self.partner_id.id, } @@ -66,7 +66,7 @@ def test_onchange_partner_id(self): sale_dict = new_sale._convert_to_write(new_sale._cache) new_sale = self.env['sale.order'].create(sale_dict) self.assertEqual(new_sale.comment_template2_id, self.after_comment) - self.partner_id.comment_template_id = self.before_comment.id + self.partner_id.property_comment_template_id = self.before_comment.id new_sale = self.env['sale.order'].new(vals) new_sale.onchange_partner_id_sale_comment() sale_dict = new_sale._convert_to_write(new_sale._cache)