<commit_before># -*- coding: utf-8 -*-
# © 2015 <NAME> - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import api, models


class MrpRepair(models.Model):
    _inherit = 'mrp.repair'

    @api.multi
    def action_invoice_create(self, group=False):
        res = super(MrpRepair, self).action_invoice_create(group=group)
        invoice_obj = self.env['account.invoice']
        for repair in self:
            if not res[repair.id]:
                continue
            invoice = invoice_obj.browse(res[repair.id])
            invoice.payment_mode_id = repair.partner_id.customer_payment_mode
            invoice.partner_bank_id = (
                repair.partner_id.customer_payment_mode.bank_id)
            invoice.payment_term = repair.partner_id.property_payment_term
        return res<commit_msg>[IMP] mrp_repair_account_invoicing: comprobar si hay factura para la reparación<commit_after># -*- coding: utf-8 -*-
# © 2015 <NAME> - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import api, models


class MrpRepair(models.Model):
    _inherit = 'mrp.repair'

    @api.multi
    def action_invoice_create(self, group=False):
        res = super(MrpRepair, self).action_invoice_create(group=group)
        invoice_obj = self.env['account.invoice']
        for repair in self:
            if not res.get(repair.id, False):
                continue
            invoice = invoice_obj.browse(res[repair.id])
            invoice.payment_mode_id = repair.partner_id.customer_payment_mode
            invoice.partner_bank_id = (
                repair.partner_id.customer_payment_mode.bank_id)
            invoice.payment_term = repair.partner_id.property_payment_term
        return res
{'fraction_non_alphanumeric': 0.10231769361221028, 'fraction_numerical': 0.009044657998869417, 'mean_word_length': 2.6645962732919255, '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': '7653168', 'n_tokens_mistral': 593, 'n_tokens_neox': 573, 'n_words': 102}