<commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api, _
from openerp.exceptions import Warning
import logging
_logger = logging.getLogger(__name__)


class afip_point_of_sale(models.Model):
    _inherit = 'afip.point_of_sale'

    type = fields.Selection(
        selection_add=[('electronic', 'Electronic')],
        )
    afip_ws = fields.Selection([
        ('wsfe', 'Mercado interno -sin detalle- RG2485 (WSFEv1)'),
        ('wsmtxca', 'Mercado interno -con detalle- RG2904 (WSMTXCA)'),
        ('wsfex', 'Exportación -con detalle- RG2758 (WSFEXv1)'),
        ('wsbfe', 'Bono Fiscal -con detalle- RG2557 (WSMTXCA)'),
        ],
        'AFIP WS',
        )

    @api.multi
    def check_document_local_remote_number(self):
        msg = ''<commit_msg>IMP add point of sale invoice type constraint<commit_after># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api, _
from openerp.exceptions import Warning
import logging
_logger = logging.getLogger(__name__)


class afip_point_of_sale(models.Model):
    _inherit = 'afip.point_of_sale'

    type = fields.Selection(
        selection_add=[('electronic', 'Electronic')],
        )
    afip_ws = fields.Selection([
        ('wsfe', 'Mercado interno -sin detalle- RG2485 (WSFEv1)'),
        ('wsmtxca', 'Mercado interno -con detalle- RG2904 (WSMTXCA)'),
        ('wsfex', 'Exportación -con detalle- RG2758 (WSFEXv1)'),
        ('wsbfe', '<NAME> -con detalle- RG2557 (WSMTXCA)'),
        ],
        'AFIP WS',
        )

    @api.constrains('type', 'afip_ws')
    def check_afip_ws_and_type(self):
        if self.type != 'electronic' and self.afip_ws:
            raise Warning(_(
                'You can only use an AFIP WS if type is "Electronic"'))

    @api.onchange('type')
    def onchange_type(self):
        if self.type != 'electronic':
            self.afip_ws = False

    @api.multi
    def check_document_local_remote_number(self):
        msg = ''
{'fraction_non_alphanumeric': 0.23914823914823916, 'fraction_numerical': 0.015561015561015561, 'mean_word_length': 3.4908088235294117, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3622932', 'n_tokens_mistral': 788, 'n_tokens_neox': 713, 'n_words': 180}