<commit_before># -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################

from openerp import models, fields, api


class SaleOrder(models.Model):
    _inherit = 'sale.order'

    comment = fields.Text(string='Internal comments')
    propagated_comment = fields.Text(string='Propagated internal comments')

    @api.model
    def _prepare_invoice(self, order, lines):
        res = super(SaleOrder, self)._prepare_invoice(order, lines)
        comment = res.get('sale_comment', '')
        res['sale_comment'] = '%s %s' % (comment,
                                         order.propagated_comment or '')
        return res

    @api.multi
    def onchange_partner_id(self, partner_id):
        val = super(SaleOrder, self).onchange_partner_id(partner_id)<commit_msg>[FIX] <sale_documents_comments> space adding at start avoided<commit_after># -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################

from openerp import models, fields, api


class SaleOrder(models.Model):
    _inherit = 'sale.order'

    comment = fields.Text(string='Internal comments')
    propagated_comment = fields.Text(string='Propagated internal comments')

    @api.model
    def _prepare_invoice(self, order, lines):
        res = super(SaleOrder, self)._prepare_invoice(order, lines)
        comment = res.get('sale_comment', '')
        if comment != '':
            comment = '%s ' % comment
        res['sale_comment'] = '%s%s' % (comment,
                                        order.propagated_comment or '')
        return res

    @api.multi
    def onchange_partner_id(self, partner_id):
        val = super(SaleOrder, self).onchange_partner_id(partner_id)
{'fraction_non_alphanumeric': 0.24829600778967867, 'fraction_numerical': 0.0009737098344693282, 'mean_word_length': 3.6810933940774486, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6330148', 'n_tokens_mistral': 551, 'n_tokens_neox': 514, 'n_words': 123}