diff --git a/addons/sale/sale.py b/addons/sale/sale.py index e4a75ac3e02..82613459534 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -905,7 +905,13 @@ class AccountInvoice(models.Model): def _get_default_team(self): return self.env['crm.team']._get_default_team_id() + def _default_comment(self): + invoice_type = self.env.context.get('type', 'out_invoice') + if invoice_type == 'out_invoice': + return self.env.user.company_id.sale_note + team_id = fields.Many2one('crm.team', string='Sales Team', default=_get_default_team, oldname='section_id') + comment = fields.Text(default=_default_comment) @api.multi def confirm_paid(self): diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 425925e462f..54d8df384c7 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -93,6 +93,7 @@ class SaleAdvancePaymentInv(models.TransientModel): 'payment_term_id': order.payment_term_id.id, 'fiscal_position_id': order.fiscal_position_id.id or order.partner_id.property_account_position_id.id, 'team_id': order.team_id.id, + 'comment': order.note, }) invoice.compute_taxes() invoice.message_post_with_view('mail.message_origin_link',