Exemplo n.º 1
0
class course_wizard(models.Model):

    _name = 'course.wizard'

    start_date = fields.Date("Start Date", required=True)
    end_date = fields.Date("End Date", required=True)

    _description = 'Wizard to print courses report'

    def check_report(self, cr, uid, ids, context=None):

        if context is None:
            context = {}
        data = self.read(cr, uid, ids, context=context)[0]
        datas = {
            'ids': context.get('active_ids', []),
            'model': 'courses',
            'form': data
        }
        datas['form']['ids'] = datas['ids']
        return self.pool['report'].get_action(cr,
                                              uid, [],
                                              'schoolModul.courses_info_wiz',
                                              data=datas,
                                              context=context)
Exemplo n.º 2
0
class stagiaires(models.Model):
    _name = "hr.stagiaires"
    _description = "liste des stagiaires"
    _rec_name = "nom"
    image = fields.Binary('Image')
    nom = fields.Char("Nom du stagiaire")
    adresse_pro = fields.Char("Adresse Professionelle")
    tel_pro = fields.Char('Tél. portable professionel')
    user_id = fields.Many2one('res.users', string="Utilisateur lié")
    departement = fields.Many2one('hr.department', string="Département")
    job = fields.Many2one('hr.job', string="Titre de poste")
    responsa = fields.Many2one('hr.employee', string="Responsable")
    date_entre = fields.Date('Date debut')
    date_fin = fields.Date('Date fin de stage')
    nationalite = fields.Many2one('res.country', string="Nationalité")
    cin = fields.Integer('CIN')
    deliv = fields.Date('Date delivrance CIN')
    naiss = fields.Date('Date naissance')
    naisslieux = fields.Many2one('res.country.state',
                                 string="Lieux de naissance")
    pers_addr = fields.Char('Adresse personnelle')
    gender = fields.Selection(selection=[('Masculin', 'Masculin'),
                                         ('Feminin', 'Feminin')],
                              string="Genre")
    etciv = fields.Selection(selection=[('Divorcé', 'Divorcé'),
                                        ('Marié', 'Marié'),
                                        ('Celibataire', 'Celibataire'),
                                        ('Voeuf', 'Voeuf')],
                             string="etat Civil")
    actif = fields.Boolean('Active')
    theme = fields.Char('Théme de stage')
Exemplo n.º 3
0
class vetclinic_animalvaccination(models.Model):
    _name = 'vetclinic.animalvaccination'

    products_id = fields.Many2one('product.product', 'Vaccination:')
    duedate = fields.Date('Due Date:')
    dateperfomed = fields.Date('Date Performed:')
    animal_id = fields.Many2one('vetclinic.animal', 'Animal:')
Exemplo n.º 4
0
class od_hr_job_line(models.Model):
    _name = 'od.hr.job.line'
    employee_id = fields.Many2one('hr.employee', string='Employee')
    date_from = fields.Date(String='Date From')
    date_to = fields.Date(String='Date To')
    job_id = fields.Many2one('hr.job', string='Job Title')
    name = fields.Text(string='Responsibility')
Exemplo n.º 5
0
class ResPartner(models.Model):
    _inherit = 'res.partner'

    @api.onchange('student_id')
    @api.depends('student_id')
    def _onchange_student_id(self):
        for rc in self:
            if rc.student_id:
                if rc.student_id.recruit_id:
                    rc.is_recruit = True
                elif rc.student_id.industi_id:
                    rc.is_industrial = True
                else:
                    rc.is_recruit = False
                    rc.is_industrial = False

    line_ids = fields.One2many('school.student.line',
                               'name',
                               string='Students')
    is_recruit = fields.Boolean(string='Is a Recruitment Agent')
    is_industrial = fields.Boolean(string='Is an Industrial Partner')
    con_from = fields.Date(string='Contract Period')
    con_to = fields.Date(string='Contract Period To')
    student_id = fields.Many2one('school.student', string='Student Name')
    std_idd = fields.Char(string='Student ID',
                          size=256,
                          related='student_id.std_idd')
    course_id = fields.Many2many('school.school', string='Course')
    intake_id = fields.Many2many('school.class', string='Intake')
Exemplo n.º 6
0
class od_document_request_attach_here_line(models.Model):
    _name = 'od.document.request.attach.here.line'
    _description = "od.document.request.attach.here.line"
    name = fields.Char(string='Description')
    scanned_copy = fields.Binary(string='Scanned Copy')
    scanned_fname = fields.Char(string='Comp', size=32)
    reference = fields.Char(string='Reference')
    issue_date = fields.Date(string='Issue Date')
    expiry_date = fields.Date(string='Expiry Date')
    document_attach_here_line_id = fields.Many2one('od.document.request',
                                                   string='Document')
Exemplo n.º 7
0
class he_employee(models.Model):
    _name = "hr.employee.formacion"

    name = fields.Many2one('hr.employee.cursos', 'name', required=True)

    employee_id = fields.Many2one('hr.employee', 'Employee', required=True)

    fecha_curso = fields.Date()

    fecha_validez_curso = fields.Date()

    observaciones = fields.Html()
Exemplo n.º 8
0
class od_holiday_document_line(models.Model):
    _name = "od.holiday.document.line"
    _description = "od.holiday.document.line"

    holiday_id = fields.Many2one('hr.holidays', string='Holiday')
    document_type_id = fields.Many2one('od.employee.document.type',
                                       string='Document Type',
                                       required=True)
    recieved = fields.Boolean(string='Return', default=False)
    recieved_date = fields.Date(string='Returned Date')
    issued_date = fields.Date(string='Issued Date')
    issued = fields.Boolean(string='Issued', default=False)
Exemplo n.º 9
0
class SchoolStudentLine(models.Model):
    _name = 'school.student.line'

    student_id = fields.Many2one('school.student', string='Student Name')
    std_idd = fields.Char(string='Student ID',
                          size=256,
                          related='student_id.std_idd')
    course_id = fields.Many2many('school.school', string='Course')
    intake_id = fields.Many2many('school.class', string='Intake')
    con_from = fields.Date(string='Contract Period')
    con_to = fields.Date(string='Contract Period To')
    name = fields.Many2one('res.partner', string='Customer')
Exemplo n.º 10
0
class he_employee(models.Model):
    _name = "hr.employee.medical"

    name = fields.Char(string="Referencia", required=True)
    employee_id = fields.Many2one('hr.employee', 'Employee', required=True)

    fichero = fields.Binary()

    fecha_revision = fields.Date()

    fecha_validez = fields.Date()

    observaciones = fields.Html()
Exemplo n.º 11
0
class GolDocument(osv.Model):
    _name = 'gol.document'
    _description = u'descripcion modulo'
    #Decalaracion de campos
    authorizationNumber = fields.Char('Número de Autorización')
    documentType = fields.Many2one('gol.document.type', 'Tipo de Documento')
    correlativeFrom = fields.Char('Correlativo Desde')
    correlativeTo = fields.Char('Correlativo Hasta')
    broadcastDate = fields.Date('Fecha Desde')
    expirationDate = fields.Date('Fecha Hasta')
    correlativeCurrentPosition = fields.Char('Posición Actual')
    active = fields.Boolean('Activo', default=True)
    #description=fields.Text('Descripción')
    correlativeLength = fields.Integer('Longitud')
    idPointOfSale = fields.Many2one('gol.point.of.sale', 'Punto de Venta')
Exemplo n.º 12
0
class GolInvoice(osv.Model):
    _name = 'account.invoice'
    _inherit = 'account.invoice'
    documentType = fields.Many2one('gol.document.type')
    amountPaid = fields.Float('Monto Abonado',
                              compute='_GetAmountPaid',
                              Store=True)
    purchaseOrder = fields.Char('Orden de Compra')
    contractName = fields.Char('Nombre del Contrato')
    authorizationNumber = fields.Char('Número de Autorización')
    description = fields.Text('Observación')
    amountDiscount = fields.Float('Descuentos')
    #Elementos Modificados
    date_invoice = fields.Date('Fecha',
                               default=datetime.now().strftime('%Y-%m-%d'))

    #Metodos Modificados

    @api.one
    @api.constrains('invoice_line')
    @api.onchange('partner_id', 'invoice_line')
    def ValidateFields(self):
        if (self.partner_id == False):
            raise ValidationError('Usted debe seleccionar un cliente')

    @api.one
    def _GetAmountPaid(self):
        self.amountPaid = self.amount_total - self.residual
Exemplo n.º 13
0
class MixedModel(models.Model):
    _name = 'test_new_api.mixed'

    number = fields.Float(digits=(10, 2), default=3.14)
    date = fields.Date()
    now = fields.Datetime(compute='_compute_now')
    lang = fields.Selection(string='Language', selection='_get_lang')
    reference = fields.Reference(string='Related Document',
                                 selection='_reference_models')

    @api.one
    def _compute_now(self):
        # this is a non-stored computed field without dependencies
        self.now = fields.Datetime.now()

    @api.model
    def _get_lang(self):
        langs = self.env['res.lang'].search([])
        return [(lang.code, lang.name) for lang in langs]

    @api.model
    def _reference_models(self):
        models = self.env['ir.model'].search([('state', '!=', 'manual')])
        return [(model.model, model.name) for model in models
                if not model.model.startswith('ir.')]
Exemplo n.º 14
0
class GolCreditNote(osv.Model):
    _name = 'gol.credit.note'
    _description = u'descripcion modulo'
    #Decalaracion de campos
    documentType = fields.Many2one('gol.document.type', 'Tipo de Documento')
    correlative = fields.Char('Correlativo', required=False)
    date = fields.Date('Fecha', default=datetime.now().strftime('%Y-%m-%d'))
    #date=fields.Datetime('Fecha',default=datetime.now())
    state = fields.Selection([('active', 'Activo'), ('annulled', 'Anulado')],
                             'Estado del Comprobante',
                             default='active',
                             required=True)
    invoice = fields.Many2one('account.invoice', 'Factura')
    authorizationNumber = fields.Char('Número de Autorización')
    typeCreditNote = fields.Many2one('gol.type.debit.note', 'Tipo')
    accountingVoucher = fields.One2many('account.move', 'idAccountMove',
                                        'Comprobantes Contables')
    creditNoteAmount = fields.Float('Monto')
    taxAmount = fields.Float('Monto Impuesto')
    gloss = fields.Text('Glosa')
    #Campos Temporales Factura
    authorizationNumberInvoice = fields.Char(
        'Número de Autorización de la Factura', Store=False)
    numberInvoice = fields.Char('Número de Factura', Store=False)
    estateInvoice = fields.Char('Estado', Store=False)
    amountInvoice = fields.Char('Monto Factura', Store=False)

    @api.onchange('invoice')
    def GetDatasInvoiceAndCustomer(self):
        self.authorizationNumberInvoice = self.invoice.authorizationNumber
        #self.numberInvoice=self.invoice.number
        self.estateInvoice = self.invoice.state
Exemplo n.º 15
0
class MixedModel(models.Model):
    _name = 'test_new_api.mixed'

    number = fields.Float(digits=(10, 2), default=3.14)
    date = fields.Date()
    now = fields.Datetime(compute='_compute_now')
    lang = fields.Selection(string='Language', selection='_get_lang')
    reference = fields.Reference(string='Related Document',
        selection='_reference_models')
    comment1 = fields.Html(sanitize=False)
    comment2 = fields.Html(sanitize=True, strip_classes=False)
    comment3 = fields.Html(sanitize=True, strip_classes=True)
    comment4 = fields.Html(sanitize=True, strip_style=True)

    currency_id = fields.Many2one('res.currency', default=lambda self: self.env.ref('base.EUR'))
    amount = fields.Monetary()

    @api.one
    def _compute_now(self):
        # this is a non-stored computed field without dependencies
        self.now = fields.Datetime.now()

    @api.model
    def _get_lang(self):
        return self.env['res.lang'].get_installed()

    @api.model
    def _reference_models(self):
        models = self.env['ir.model'].search([('state', '!=', 'manual')])
        return [(model.model, model.name)
                for model in models
                if not model.model.startswith('ir.')]
Exemplo n.º 16
0
class born_spread(osv.osv):
    _name = 'born.spread'

    name = fields.Char(u'名称', size=255, help=u"名称")
    lottery_id = fields.Many2one("born.lottery", u'抽奖方式')
    description = fields.Text(u'说明', )
    image = fields.Binary(u"展示图片")
    start_date = fields.Date(u'开始日期')
    end_date = fields.Date(u'结束日期')
    start_order_amount = fields.Float(
        u'最小订单金额',
        digits_compute=dp.get_precision('Account'),
        help=u"参加抽奖需要订单金额达到金额")
    product_ids = fields.One2many('born.spread.product', 'spread_id', u'奖品列表')
    product_limit_ids = fields.One2many('born.spread.limit.product',
                                        'spread_id', u'必须购买以下产品后才能参与抽奖')
Exemplo n.º 17
0
class attendance_information(models.Model):
    _name = 'attendance.information'

    total_no_of_working_day = fields.Integer('Total No Of Working Days:')
    actual_working_days = fields.Integer('Actual Working Days:')
    absent_days = fields.Integer('Absent Days:')
    date = fields.Date('Date :')
    status = fields.Selection([('check-in', 'Check-In'),
                               ('check-out', 'Check-Out')], 'Status :')
Exemplo n.º 18
0
class od_hr_employee_facilitates_line(models.Model):
    _name = 'od.hr.employee.facilitates.line'
    _description = "od.hr.employee.facilitates.line"
    employee_id = fields.Many2one('hr.employee', string='Employee')
    entitlement_id = fields.Many2one('od.employee.entitelment',
                                     string='Entitlement')
    asset_id = fields.Many2one('account.asset.asset', string='Asset')
    ref = fields.Char(string='Reference')
    od_from_date = fields.Date(string='From Date')
Exemplo n.º 19
0
class od_hr_employee_document_line(models.Model):
    _name = 'od.hr.employee.document.line'
    _description = "od.hr.employee.document.line"
    employee_id = fields.Many2one('hr.employee', string='Employee')
    document_type_id = fields.Many2one('od.employee.document.type',
                                       string='Document Type',
                                       required=True)
    document_referance = fields.Char(string='Document Reference')
    attach_file = fields.Binary(string='Scanned Copy')
    issue_date = fields.Date(string='Issue Date')
    expiry_date = fields.Date(string='Expiry Date')
    attach_fname = fields.Char(string='Comp', size=32)

    def default_get(self, cr, uid, ids, context=None):
        res = super(od_hr_employee_document_line,
                    self).default_get(cr, uid, ids, context=context)
        res.update({'employee_id': context['active_id']})
        return res
Exemplo n.º 20
0
class od_employee_joining_document_line(models.Model):
    _name = 'od.employee.joining.document.line'
    _description = "od.employee.joining.document.line"
    joining_id = fields.Many2one('od.employee.joining', string='Joining')
    document_type_id = fields.Many2one('od.employee.document.type',
                                       string='Document Type',
                                       required=True)
    recieved = fields.Boolean(string='Recieved', default=False)
    recieved_date = fields.Date(string='Recieved Date')
Exemplo n.º 21
0
class PagosAutomaticosFacturas(models.Model):
    _name="pagos.automaticos.facturas"

    cabecera_id =fields.Many2one('pagos.automaticos.detalle',string="Relacion")
    estado = fields.Selection(related='cabecera_id.estado',string="Estado")
    estudiante_id = fields.Many2one('res.partner',string="Estudiante")
    factura_id = fields.Many2one('account.invoice',string="Factura",domain="[('state','=','open'),('alumno_id','=',estudiante_id),('residual','!=',0.0)]")
    fecha_factura = fields.Date(related='factura_id.date_invoice',string="Fecha")
    saldos = fields.Float(related='factura_id.residual',string="Saldo")
    total = fields.Float(related='factura_id.amount_total',string="Total")
Exemplo n.º 22
0
class sale_order_line(models.Model):
    _inherit = 'sale.order.line'

    
    line_ship_dt = fields.Date(string='Ship Date',default=fields.date.today())
    line_planned_date = fields.Datetime(string='Planned date')
    line_sc_date = fields.Date(string='Schedule Date')
    
    @api.onchange('line_sc_date')
    @api.multi
    def onchange_line_sc_date(self):
        if self.line_sc_date :
            time=datetime.now().time()
            current_time=(time.strftime("%H:%M:%S"))
            self.line_planned_date=self.line_sc_date +' '+ current_time
        elif not self.line_sc_date:
            self.line_planned_date = False

    @api.onchange('line_ship_dt')
    @api.multi
    def onchange_line_ship_dt(self):
        if self.line_ship_dt:
            new_date = self.order_id.date_order
            updated_date = datetime.strptime(new_date, DEFAULT_SERVER_DATETIME_FORMAT).date()
            update_date = datetime.strptime(self.line_ship_dt, DEFAULT_SERVER_DATE_FORMAT).date()
            delay = abs(updated_date-update_date).days
            self.delay=delay
    
    @api.onchange('delay')
    @api.multi
    def onchange_line_delay(self):
        date_order = self.order_id.date_order
        updated_date = datetime.strptime(date_order, DEFAULT_SERVER_DATETIME_FORMAT).date()
        line_ship_date = updated_date + timedelta(days=self.delay)
        self.line_ship_dt = line_ship_date
               
    def default_get(self, cr, uid, fields, context=None):
        if context is None: context = {}
        res = super(sale_order_line, self).default_get(cr, uid, fields, context=context)
        if context.get('line_ship_dt'):
            res.update({'line_ship_dt': context.get('line_ship_dt')})
        return res
Exemplo n.º 23
0
class result_wizard(models.TransientModel):
    _name = 'result.wizard'
    _description = 'New Description'

    name = fields.Char('Name')
    standard = fields.Selection([('first', '1st'), ('second', '2nd'), ('third', '3rd'), ('fourth', '4th'), ('fifth', '5th'), ('sixth', '6th'), ('seventh', '7th'), ('eight', '8th'), ('ninth', '9th'), ('tenth', '10th')], 'Standard.')
    division = fields.Selection([('a', 'A'), ('b', 'B'), ('c', 'C')], 'Division.')
    roll_no = fields.Integer('Roll No')
    birth_date = fields.Date('Date Of Birth')
    fees_amt = fields.Float('Fees')
    subject_ids = fields.Many2many('subject.records', 'student_subject_rel', 'subject_id', 'student_id', 'Subjects')
Exemplo n.º 24
0
class od_hr_employee_education_line(models.Model):
    _name = 'od.hr.employee.education.line'
    _description = "od.hr.employee.education.line"
    employee_id = fields.Many2one('hr.employee', string='Employee')
    academic_qualification_id = fields.Many2one(
        'od.employee.academic.qualification',
        string='Academic Qualification',
    )
    instituite = fields.Char(string='Institute')
    year = fields.Date(string='Year')
    country_id = fields.Many2one('res.country', string='Country')
Exemplo n.º 25
0
class ReporteCaja(models.Model):
    _name="reporte.orden_pago_detalle"

    id_relacion = fields.Many2one('reporte.orden_pago',string="Cabecera")
    id_proveedor = fields.Many2one('res.partner',string='Proveedor')
    journal_id = fields.Many2one('account.journal',string="Metodo de Pago")
    date =fields.Date(string='Fecha')
    res_partner_bank_id = fields.Many2one('res.partner.bank',string="Banco")
    amount = fields.Float(string="Total")
    id_pago = fields.Many2one('account.voucher',string="Pago")
    pagar = fields.Boolean(string="Pagar",default=True)
Exemplo n.º 26
0
class sale_billing_plan(models.Model):
    _name = "sale.billing.plan"
    _description = "Billing Plan"
    _order = "order_id,sequence,id"

    order_id = fields.Many2one('sale.order',
                               string='Order Reference',
                               readonly=True,
                               index=True,
                               ondelete='cascade')
    order_line_id = fields.Many2one('sale.order.line',
                                    string='Order Line Reference',
                                    readonly=True,
                                    index=True,
                                    ondelete='cascade')
    sequence = fields.Integer(
        string='Sequence',
        default=10,
        help="Gives the sequence of this line when displaying the billing plan."
    )
    installment = fields.Integer(
        string='Installment',
        help="Group of installment. Each group will be an invoice")
    date_invoice = fields.Date(string='Invoice Date', index=True)
    product_id = fields.Many2one(
        'product.product',
        string='Product',
        related='order_line_id.product_id',
        store=True,
        readonly=True,
    )
    name = fields.Text(
        string='Description',
        related='order_line_id.name',
        store=True,
        readonly=True,
    )
    bill_percent = fields.Float(string='Percent', digits=(12, 6))
    bill_amount = fields.Float(string='Amount',
                               digits=dp.get_precision('Account'))

    @api.one
    @api.onchange('bill_percent')
    def _onchange_bill_percent(self):
        subtotal = self.order_line_id.price_subtotal
        self.bill_amount = subtotal and self.bill_percent / 100 * subtotal or 0.0

    @api.one
    @api.onchange('bill_amount')
    def _onchange_bill_amount(self):
        subtotal = self.order_line_id.price_subtotal
        self.bill_percent = subtotal and (self.bill_amount /
                                          subtotal) * 100 or 0.0
Exemplo n.º 27
0
class student(models.Model):
    _name = 'teacher'

    name = fields.Char('Name', required=1)
    address = fields.Text('Address')
    pincode = fields.Char('Pincode')
    telephone = fields.Char('Telephone')
    birthdate = fields.Date('Birthdate')
    joindate = fields.Datetime('Join Date')
    active = fields.Boolean('Active', default=1)

    def active_action(self):
        print self
Exemplo n.º 28
0
class dym_bank_transfer_voucher(models.Model): 
    _name = 'dym.bank.transfer.voucher'
    _description = 'Bank Transfer Line Voucher'

    bank_transfer_id = fields.Many2one('dym.bank.transfer',string="Bank Transfer")
    voucher_id = fields.Many2one('account.voucher', string="Voucher")
    reimburse_id = fields.Many2one('account.voucher', string="Voucher")
    date = fields.Date(related="voucher_id.date")
    date_due = fields.Date(related="voucher_id.date_due")
    amount = fields.Float(related="voucher_id.amount")
    net_amount = fields.Float(related="voucher_id.net_amount")
    notes = fields.Text('Notes')
    account_id = fields.Many2one('account.account', string="Account")
    line_amount = fields.Float(string="Amount")

    @api.onchange('voucher_id')
    def onchange_voucher_id(self):
        context = self._context
        notes = []
        for vline in self.voucher_id.line_dr_ids:
            notes.append(vline.name)
        self.notes = ', '.join(notes)
Exemplo n.º 29
0
class StudentEnrolDuedateLine(models.Model):
    _name = 'student.enrol.duedate.line'

    @api.model
    def get_start_date(self):
        enrl_obj = self.env['student.enroll.line']
        if self._context.has_key('enrol_id') and not self.parent_id.line_ids:
            return enrl_obj.browse(
                self._context['enrol_id']).enroll_id.date_start

    sequence = fields.Integer(string='Sequence')
    name = fields.Char(string='Name', size=256)
    parent_id = fields.Many2one('student.enroll.duedate', string='Parent')
    duedate = fields.Date(string='Due Date', default=get_start_date)
Exemplo n.º 30
0
class student(models.Model):
    _name = 'student'

    name = fields.Char('Name', required=1)
    address = fields.Text('Address')
    pincode = fields.Char('Pincode')
    telephone = fields.Char('Telephone')
    birthdate = fields.Date('Birthdate')
    joindate = fields.Datetime('Join Date')
    roll_no = fields.Integer('Roll Number')
    fees_amt = fields.Float('Fees')
    active = fields.Boolean('Active', default=1)
    stand = fields.Selection([('one', 'One'), ('two', 'Two'),
                              ('three', 'Three'), ('four', 'Four')], 'Stand.')