<commit_before># -*- coding: utf-8 -*-
# © 2016 Comunitea
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models, _
import odoo.addons.decimal_precision as dp

class AccountMoveLine(models.Model):

    _inherit = 'account.move.line'

    @api.multi
    def get_mandate_scheme(self):
        for line in self:
            if line.mandate_id:
                line.scheme = line.mandate_id.scheme

    @api.model
    def _mandate_scheme_search(self, operator, operand):

        moves = self.search([('mandate_id.scheme', operator,
                                        operand)])
        return [('id', 'in', moves.mapped('id'))]

    scheme = fields.Selection(selection=[('CORE', 'Basic (CORE)'),
                                         ('B2B', 'Enterprise (B2B)')],
                              string='Scheme',
                              compute='get_mandate_scheme',
                              search='_mandate_scheme_search')
    payment_order_line_ids = fields.One2many(
        'account.payment.line', 'move_line_id', string='Payment Line',
        readonly=True)

<commit_msg>[IMP]jim_account: Se permite cambiar comercial en facturas abiertas.<commit_after># -*- coding: utf-8 -*-
# © 2016 Comunitea
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models, _
import odoo.addons.decimal_precision as dp

class AccountMoveLine(models.Model):

    _inherit = 'account.move.line'

    @api.multi
    def get_mandate_scheme(self):
        for line in self:
            if line.mandate_id:
                line.scheme = line.mandate_id.scheme

    @api.model
    def _mandate_scheme_search(self, operator, operand):

        moves = self.search([('mandate_id.scheme', operator,
                                        operand)])
        return [('id', 'in', moves.mapped('id'))]

    scheme = fields.Selection(selection=[('CORE', 'Basic (CORE)'),
                                         ('B2B', 'Enterprise (B2B)')],
                              string='Scheme',
                              compute='get_mandate_scheme',
                              search='_mandate_scheme_search')
    payment_order_line_ids = fields.One2many(
        'account.payment.line', 'move_line_id', string='Payment Line',
        readonly=True)


class AccountInvoice(models.Model):

    _inherit = 'account.invoice'

    user_id = fields.Many2one(states={'draft': [('readonly', False)],
                                      'open': [('readonly', False)]})
{'fraction_non_alphanumeric': 0.1281446540880503, 'fraction_numerical': 0.009040880503144654, 'mean_word_length': 2.0261593341260404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5975658', 'n_tokens_mistral': 757, 'n_tokens_neox': 734, 'n_words': 148}