<commit_before># Copyright 2016-2018 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


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

    @api.multi
    def action_move_create(self):
        """Override, button Validate on invoices."""
        res = super(AccountInvoice, self).action_move_create()
        for rec in self:
            rec.invoice_line_ids.compute_spread_board()
        return res

    @api.multi
    def invoice_line_move_line_get(self):
        res = super(AccountInvoice, self).invoice_line_move_line_get()
        for line in res:
            invl_id = line.get('invl_id')
            invl = self.env['account.invoice.line'].browse(invl_id)
            if invl.spread_account_id:
                line['account_id'] = invl.spread_account_id.id
        return res
<commit_msg>Fix method description in account_cost_spread<commit_after># Copyright 2016-2018 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


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

    @api.multi
    def action_move_create(self):
        """Invoked when validating the invoices."""
        res = super(AccountInvoice, self).action_move_create()
        for rec in self:
            rec.invoice_line_ids.compute_spread_board()
        return res

    @api.multi
    def invoice_line_move_line_get(self):
        res = super(AccountInvoice, self).invoice_line_move_line_get()
        for line in res:
            invl_id = line.get('invl_id')
            invl = self.env['account.invoice.line'].browse(invl_id)
            if invl.spread_account_id:
                line['account_id'] = invl.spread_account_id.id
        return res

{'fraction_non_alphanumeric': 0.10844686648501363, 'fraction_numerical': 0.010899182561307902, 'mean_word_length': 2.7855670103092782, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '6879084', 'n_tokens_mistral': 617, 'n_tokens_neox': 580, 'n_words': 118}