<commit_before>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def clean_internal_number(self):
        # We also clean reference for compatibility with argentinian loc
        for rec in self:
            # if document type has a sequence then a new sequence must be
            # requested. Otherwise, we want to keep number introduced by user
            if rec._fields in ['document_sequence_id']:
                rec.update({'move_name': False,
                            'document_number': False})
            else:
                rec.update({'move_name': False})<commit_msg>[IMP] use write or direct assignation instead of update where susitable<commit_after>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def clean_internal_number(self):
        # We also clean reference for compatibility with argentinian loc
        for rec in self:
            # if document type has a sequence then a new sequence must be
            # requested. Otherwise, we want to keep number introduced by user
            if 'document_sequence_id' in rec._fields and \
                    rec.document_sequence_id:
                rec.write({
                    'move_name': False,
                    'document_number': False})
            else:
                rec.write({'move_name': False})
{'fraction_non_alphanumeric': 0.21956295525494277, 'fraction_numerical': 0.0, 'mean_word_length': 2.869215291750503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315030', 'n_tokens_mistral': 436, 'n_tokens_neox': 407, 'n_words': 154}