Skip to content

Commit

Permalink
Merge PR #73 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 21, 2019
2 parents 8130967 + b40ee7c commit aa37109
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sale_comment_template/models/sale_order.py
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions sale_comment_template/tests/test_sale_order_report.py
Expand Up @@ -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,
}
Expand All @@ -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)
Expand Down

0 comments on commit aa37109

Please sign in to comment.