<commit_before># -*- coding: utf-8 -*-

from openerp import models, fields, api, exceptions, _
class Preregistration(models.Model):
    '''
    Pre-registration for a scout group to an event
    '''
    _inherit = 'event.registration'
#    group_name = fields.Char('Group Name')
#    group_association = fields.Many2one('campos.scout.org','Scout Organization')
#    group_world_association = fields.Selection(related='group_association.worldorg', string='World Organisation', readonly=True)
    group_entrypoint = fields.Char('Point of entry into Denmark')
#    group_municipality = fields.Many2one('campos.municipality','Municipallity')
#    group_country = fields.Many2one('res.country', 'Country')
#    group_country_name = fields.Char(related='group_country.name', string='Country Name', readonly=True)
#    group_country_code = fields.Char(related='group_country.code', string='Country Code', readonly=True)
    group_country_code2 = fields.Char(related='partner_id.country_id.code', string='Country Code2', readonly=True)
#    association_groupid = fields.Char('Groups id (number) at local association')
    participant_ids = fields.One2many('event.registration.participants','registration_id','Participants')
    pioneeringpole_ids = fields.One2many('event.registration.polelist','registration_id','Pioneering Poles')
    handicap = fields.Boolean('Participant(s) with handicap or other special considerations?')
    handicap_description = fields.Text('Description of handicap / special considerations')
    handicap_needs = fields.Text('Special needs due to handicap / special considerations')
    friendship_group = fields.Boolean('Request placement with friendship group?')
    friendship_group_name = fields.Char('Friendship group name, association, country')
    friendship_group_info = fields.Text('Friendship group other info')
    friendship_group_desire = fields.Boolean('Would like a friendship group?')
    friendship_group_desire_country = fields.Many2one('res.country', 'Country of friendship group (optional)')
    friendship_group_home_hospitality = fields.Boolean('Would like to offer home hospitality?')
    group_camp_agreements = fields.Text('Official agreements')
    internal_information = fields.Text('Internal information',  groups="campos_event.group_campos_staff,campos_event.group_campos_admin")

class PreregistrationAgegroup(models.Model):
    _name = 'event.registration.agegroup'
    name = fields.Char('Age Group name', required=True)
    age_from = fields.Integer('From age', required=True)
    age_to = fields.Integer('To age', required=True)
    
class PreregistrationPioneeringPole(models.Model):
    _name = 'event.registration.pioneeringpole'
    name = fields.Char('Pioneering Pole Name', required=True)
    length = fields.Integer('Length', required=True)

class PreregistrationTransportType(models.Model):
    _name = 'event.registration.transporttype'
    name = fields.Char('Transport Type Name', required=True)

class PreregistrationParticipants(models.Model):
    _name = 'event.registration.participants'
    registration_id = fields.Many2one('event.registration', 'Registration')
    participant_age_group_id = fields.Many2one('event.registration.agegroup','Age Group', required=True)
    participant_total  = fields.Integer('Number of participants', required=True)
    participant_from_date = fields.Date('Date of arrival', required=True, default='2017-07-22')
    participant_to_date = fields.Date('Date of departure', required=True, default='2017-07-30')
    participant_own_transport_to_camp_total  = fields.Integer('No. of own transport to camp', required=True)
    participant_own_transport_from_camp_total  = fields.Integer('No. of own transport from camp', required=True)
    participant_common_transport_to_camp_total  = fields.Integer(compute = '_calculate_common_transport', string='No. of common transport to camp')
    participant_common_transport_from_camp_total  = fields.Integer(compute = '_calculate_common_transport', string='No. of common transport from camp')
    participant_own_transport_type = fields.Many2one('event.registration.transporttype','Primary own transport')

    @api.depends ('participant_total','participant_own_transport_to_camp_total','participant_own_transport_from_camp_total')<commit_msg>Added translate=True to name attributes<commit_after># -*- coding: utf-8 -*-

from openerp import models, fields, api, exceptions, _
class Preregistration(models.Model):
    '''
    Pre-registration for a scout group to an event
    '''
    _inherit = 'event.registration'
#    group_name = fields.Char('Group Name')
#    group_association = fields.Many2one('campos.scout.org','Scout Organization')
#    group_world_association = fields.Selection(related='group_association.worldorg', string='World Organisation', readonly=True)
    group_entrypoint = fields.Char('Point of entry into Denmark')
#    group_municipality = fields.Many2one('campos.municipality','Municipallity')
#    group_country = fields.Many2one('res.country', 'Country')
#    group_country_name = fields.Char(related='group_country.name', string='Country Name', readonly=True)
#    group_country_code = fields.Char(related='group_country.code', string='Country Code', readonly=True)
    group_country_code2 = fields.Char(related='partner_id.country_id.code', string='Country Code2', readonly=True)
#    association_groupid = fields.Char('Groups id (number) at local association')
    participant_ids = fields.One2many('event.registration.participants','registration_id','Participants')
    pioneeringpole_ids = fields.One2many('event.registration.polelist','registration_id','Pioneering Poles')
    handicap = fields.Boolean('Participant(s) with handicap or other special considerations?')
    handicap_description = fields.Text('Description of handicap / special considerations')
    handicap_needs = fields.Text('Special needs due to handicap / special considerations')
    friendship_group = fields.Boolean('Request placement with friendship group?')
    friendship_group_name = fields.Char('Friendship group name, association, country')
    friendship_group_info = fields.Text('Friendship group other info')
    friendship_group_desire = fields.Boolean('Would like a friendship group?')
    friendship_group_desire_country = fields.Many2one('res.country', 'Country of friendship group (optional)')
    friendship_group_home_hospitality = fields.Boolean('Would like to offer home hospitality?')
    group_camp_agreements = fields.Text('Official agreements')
    internal_information = fields.Text('Internal information',  groups="campos_event.group_campos_staff,campos_event.group_campos_admin")

class PreregistrationAgegroup(models.Model):
    _name = 'event.registration.agegroup'
    name = fields.Char('Age Group name', required=True, translate=True)
    age_from = fields.Integer('From age', required=True)
    age_to = fields.Integer('To age', required=True)
    
class PreregistrationPioneeringPole(models.Model):
    _name = 'event.registration.pioneeringpole'
    name = fields.Char('Pioneering Pole Name', required=True, translate=True)
    length = fields.Integer('Length', required=True)

class PreregistrationTransportType(models.Model):
    _name = 'event.registration.transporttype'
    name = fields.Char('Transport Type Name', required=True, translate=True)

class PreregistrationParticipants(models.Model):
    _name = 'event.registration.participants'
    registration_id = fields.Many2one('event.registration', 'Registration')
    participant_age_group_id = fields.Many2one('event.registration.agegroup','Age Group', required=True)
    participant_total  = fields.Integer('Number of participants', required=True)
    participant_from_date = fields.Date('Date of arrival', required=True, default='2017-07-22')
    participant_to_date = fields.Date('Date of departure', required=True, default='2017-07-30')
    participant_own_transport_to_camp_total  = fields.Integer('No. of own transport to camp', required=True)
    participant_own_transport_from_camp_total  = fields.Integer('No. of own transport from camp', required=True)
    participant_common_transport_to_camp_total  = fields.Integer(compute = '_calculate_common_transport', string='No. of common transport to camp')
    participant_common_transport_from_camp_total  = fields.Integer(compute = '_calculate_common_transport', string='No. of common transport from camp')
    participant_own_transport_type = fields.Many2one('event.registration.transporttype','Primary own transport')

    def _calculate_default_start_date (self):
        return fields.Date.from_string(self.registration_id.event_begin_date)

    @api.depends ('participant_total','participant_own_transport_to_camp_total','participant_own_transport_from_camp_total')
{'fraction_non_alphanumeric': 0.10952652595550486, 'fraction_numerical': 0.006389047347404449, 'mean_word_length': 6.197044334975369, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2266943', 'n_tokens_mistral': 2503, 'n_tokens_neox': 2418, 'n_words': 497}