<commit_before># Copyright 2011-2012 <NAME> (Camptocamp SA)
# Copyright 2016 <NAME> (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import api


GEO_VIEW = ('geoengine', 'GeoEngine')


class IrUIView(models.Model):
    _inherit = 'ir.ui.view'

    @api.model
    def _setup_fields(self, partial):
        """Hack due since the field 'type' is not defined with the new api.
        """
        cls = type(self)
        type_selection = cls._fields['type'].selection
        if GEO_VIEW not in type_selection:
            tmp = list(type_selection)
            tmp.append(GEO_VIEW)
            cls._fields['type'].selection = tuple(set(tmp))
        super(IrUIView, self)._setup_fields(partial)

    raster_layer_ids = fields.One2many(
        'geoengine.raster.layer', 'view_id', 'Raster layers', required=False)

    vector_layer_ids = fields.One2many(
        'geoengine.vector.layer', 'view_id', 'Vector layers', required=True)

    projection = fields.Char(default="EPSG:900913", required=True)
    default_extent = fields.Char(
        'Default map extent', size=128,
        default='-123164.85222423, 5574694.9538936, 1578017.6490538,'
        ' 6186191.1800898'
    )
    default_zoom = fields.Integer(
        'Default map zoom',
    )
    restricted_extent = fields.Char(
        'Restricted map extent', size=128,
    )<commit_msg>Fix signature change on _setup_fields<commit_after># Copyright 2011-2012 <NAME> (Camptocamp SA)
# Copyright 2016 <NAME> (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import api


GEO_VIEW = ('geoengine', 'GeoEngine')


class IrUIView(models.Model):
    _inherit = 'ir.ui.view'

    @api.model
    def _setup_fields(self):
        """Hack due since the field 'type' is not defined with the new api.
        """
        cls = type(self)
        type_selection = cls._fields['type'].selection
        if GEO_VIEW not in type_selection:
            tmp = list(type_selection)
            tmp.append(GEO_VIEW)
            cls._fields['type'].selection = tuple(set(tmp))
        super(IrUIView, self)._setup_fields()

    raster_layer_ids = fields.One2many(
        'geoengine.raster.layer', 'view_id', 'Raster layers', required=False)

    vector_layer_ids = fields.One2many(
        'geoengine.vector.layer', 'view_id', 'Vector layers', required=True)

    projection = fields.Char(default="EPSG:900913", required=True)
    default_extent = fields.Char(
        'Default map extent', size=128,
        default='-123164.85222423, 5574694.9538936, 1578017.6490538,'
        ' 6186191.1800898'
    )
    default_zoom = fields.Integer(
        'Default map zoom',
    )
    restricted_extent = fields.Char(
        'Restricted map extent', size=128,
    )
{'fraction_non_alphanumeric': 0.1222692036645525, 'fraction_numerical': 0.05919661733615222, 'mean_word_length': 2.9985915492957744, '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': '3932677', 'n_tokens_mistral': 1036, 'n_tokens_neox': 912, 'n_words': 209}