<commit_before># -*- coding: utf-8 -*-
# (c) 2015 <NAME> - Agile Business Group
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import models, api


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.multi
    def action_confirm(self):
        """
            Pass the incoterm to the picking from the sales order
        """
        procs_to_check = []
        for move in self:
            if (
                move.procurement_id and move.procurement_id.sale_line_id
                and move.procurement_id.sale_line_id.order_id.incoterm
            ):
                procs_to_check += [move.procurement_id]
        res = super(StockMove, self).action_confirm()
        for proc in procs_to_check:
            pickings = proc.mapped('move_ids.picking_id')
            pickings.write(
                {'incoterm': proc.sale_line_id.order_id.incoterm.id})
        return res<commit_msg>[FIX] stock_picking_invoicing_incoterm_sale: flake8<commit_after># -*- coding: utf-8 -*-
# (c) 2015 <NAME> - Agile Business Group
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import models, api


class StockMove(models.Model):
    _inherit = 'stock.move'

    @api.multi
    def action_confirm(self):
        """
            Pass the incoterm to the picking from the sales order
        """
        procs_to_check = []
        for move in self:
            if move.procurement_id.sale_line_id.order_id.incoterm:
                procs_to_check += [move.procurement_id]
        res = super(StockMove, self).action_confirm()
        for proc in procs_to_check:
            pickings = proc.mapped('move_ids.picking_id')
            pickings.write(
                {'incoterm': proc.sale_line_id.order_id.incoterm.id})
        return res
{'fraction_non_alphanumeric': 0.1064891846921797, 'fraction_numerical': 0.009428729894620078, 'mean_word_length': 2.176056338028169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '934633', 'n_tokens_mistral': 604, 'n_tokens_neox': 574, 'n_words': 121}