<commit_before># -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import _, api, fields, models
from openerp.exceptions import UserError


class StockPicking(models.Model):
    _inherit = 'stock.picking'

    @api.multi
    def do_new_transfer(self):
        for pick in self:
            if pick.location_dest_id.usage != 'customer':
                continue
            if not pick.sale_id:
                continue
            if pick.sale_id.not_be_billed:
                raise UserError(
                    _('This Sales Order is not invoiced'))
        return super(StockPicking, self).do_new_transfer()
<commit_msg>error para extra move<commit_after># -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import _, api, fields, models
from openerp.exceptions import UserError


class StockPicking(models.Model):
    _inherit = 'stock.picking'

    @api.multi
    def do_new_transfer(self):
        for pick in self:
            if pick.location_dest_id.usage != 'customer':
                continue
            if not pick.sale_id:
                continue
            if pick.sale_id.not_be_billed:
                raise UserError(
                    _('This Sales Order is not invoiced'))
        return super(StockPicking, self).do_new_transfer()

    @api.model
    def _prepare_values_extra_move(self, op, product, remaining_qty):
        raise UserError(
            _('Favor de contactar al admistador del sistema. \n \
                Esta tansferencia creara movimientos extras'))
        return super(StockPicking, self)._prepare_values_extra_move(op, product, remaining_qty)

{'fraction_non_alphanumeric': 0.1030751708428246, 'fraction_numerical': 0.003416856492027335, 'mean_word_length': 2.3088512241054615, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6974756', 'n_tokens_mistral': 549, 'n_tokens_neox': 521, 'n_words': 135}