Ejemplo n.º 1
0
class hr_holidays(models.Model):
    _inherit = "hr.holidays"
    od_document_line = fields.One2many('od.holiday.document.line',
                                       'holiday_id',
                                       string='Documents')
    od_leave_encashment = fields.Boolean('Leave Encashment', default=False)
    od_ticket_required = fields.Boolean('Ticket Required', default=False)
Ejemplo n.º 2
0
class GrpSeleccionVariantesLineas(models.Model):
    _name = 'grp.seleccion.variantes.lineas'

    product_id = fields.Many2one(
        comodel_name='product.template',
        string=u'Producto'
    )
    para_crear = fields.Boolean(u'Para Crear', default=False)
    creado = fields.Boolean(u'Creado', default=False)
    med_cod_id = fields.Many2one('grp.sice_medida', string=u'Medida de la variante')
    pres_id = fields.Many2one('grp.sice_presentacion', string='Presentacion')
    med_cod_pres_id = fields.Many2one('grp.sice_medida', string=u'Medida de la presentación')
    det_variante_id = fields.Many2one('grp.sice_det_variante', string='Detalle de variante')
    sice_color_id = fields.Many2one('grp.sice_color', string='Color SICE')
    atributo_id = fields.Many2one('product.attribute', string='Atributo')
    valor_id = fields.Many2one('product.attribute.value', string='Valor atributo')

    atributo_name = fields.Char(string=u'Atributo')
    valor_name = fields.Char(string=u'Valor atributo')
    med_cod_desc = fields.Char(string=u'Medida variante')
    pres_desc = fields.Char(string=u'Presentación')
    med_cod_pres_desc = fields.Char(string=u'Medida presentación')
    det_variante_desc = fields.Char(string=u'Detalle variante')
    sice_color_desc = fields.Char(string=u'Color')
    marca_desc = fields.Char(string=u'Marca')
Ejemplo n.º 3
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')
Ejemplo n.º 4
0
class account_journal_cobro(models.Model):
    _inherit = "account.journal"

    @api.constrains('detalle_journal')
    def _accesos_usuarios_1(self):
        for l in self:
            lista_usuario = []
            if len(l.detalle_journal) != 0:
                for m in l.detalle_journal:
                    lista_usuario.append(m.user_id.id)

                l.usuarios_ids = lista_usuario
            else:
                l.usuarios_ids = None

            # l.write({
            #     'usuarios_ids':lista_usuario
            #     })
            # l.update({
            #     'usuarios_ids':lista_usuario
            #     })

    caja = fields.Boolean(string="Caja")
    exigir_doc_banco = fields.Boolean(string="Exigir datos bancarios en pago")
    detalle_journal = fields.One2many('account.journal.user',
                                      'journal_cabecera_id',
                                      string="Relacion Detalle")
    usuarios_ids = fields.Many2many('res.users', string="Accesos de Usuarios")
Ejemplo n.º 5
0
class res_partner(models.Model):
    _name = 'res.partner'
    _inherit = ['res.partner']

    name     = fields.Char('Name', required=True, select=True,track_visibility='onchange',)
    ref      = fields.Char('Contact Reference', select=1,track_visibility='onchange',)
    bank_ids = fields.One2many('res.partner.bank', 'partner_id', string='Banks', track_visibility='onchange',)
    website  = fields.Char('Website', track_visibility='onchange', help="Website of Partner or Company")
    comment  = fields.Text('Notes', track_visibility='onchange',)
    active   = fields.Boolean('Active', track_visibility='onchange',)
    function = fields.Char('Job Position',track_visibility='onchange',)
    type     = fields.Selection([('default', 'Default'), ('invoice', 'Invoice'),
                               ('delivery', 'Shipping'), ('contact', 'Contact'),
                               ('other', 'Other')], 'Address Type',track_visibility='onchange',
        help="Used to select automatically the right address according to the context in sales and purchases documents.")
    street  = fields.Char('Street',track_visibility='onchange',)
    street2 = fields.Char('Street2',track_visibility='onchange',)
    zip     = fields.Char('Zip', size=24,track_visibility='onchange', change_default=True)
    city    = fields.Char('City',track_visibility='onchange',)
    state_id = fields.Many2one("res.country.state", string='State', track_visibility='onchange',ondelete='restrict')

    country_id  = fields.Many2one('res.country', string='Country',track_visibility='onchange', ondelete='restrict')
    email   = fields.Char('Email',track_visibility='onchange',)
    phone   = fields.Char('Phone',track_visibility='onchange',)
    fax     = fields.Char('Fax',track_visibility='onchange',)
    mobile  = fields.Char('Mobile',track_visibility='onchange',)
#    birthdate = fields.Char('Birthdate',track_visibility='onchange',)
    is_company = fields.Boolean('Is a Company', track_visibility='onchange',help="Check if the contact is a company, otherwise it is a person")
    use_parent_address = fields.Boolean('Use Company Address', track_visibility='onchange',help="Select this if you want to set company's address information  for this contact")
    company_id = fields.Many2one('res.company', string='Company', track_visibility='onchange',select=1)
    user_ids = fields.One2many('res.users', 'partner_id', string='Users')
Ejemplo n.º 6
0
class od_hr_employee_launguage_line(models.Model):
    _name = 'od.hr.employee.launguage.line'
    _description = "od.hr.employee.launguage.line"
    employee_id = fields.Many2one('hr.employee', string='Employee')
    launguage_id = fields.Many2one('res.lang', string='Launguage')
    speak = fields.Boolean(string='Speak', default=False)
    writes = fields.Boolean(string='Write', default=False)
    reads = fields.Boolean(string='Read', default=False)
class GolConsecutiveTypeAccountingVoucher(osv.Model):
    _name = 'gol.consecutive'
    #Decalaracion de campos
    typeVoucher=fields.Many2one('gol.type.voucher','Tipo de Comprobante',required=True)
    cosecutive=fields.Char('Consecutivo',size=50,readonly=True,help='Posicion del consecutivo mas 1')
    mont=fields.Boolean('Mes',default=True,help='Permite agrupar los consecutivos en funcion de mes')
    year=fields.Boolean('Año',default=True,help='Permite agrupar los consecutivos en funcion de año')
    idFormatCorrelative=fields.Many2one('gol.format.correlative','Formato Correlativo')
Ejemplo 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)
Ejemplo n.º 9
0
class GolConsecutive(osv.Model):
    _name = 'gol.consecutive'
    #Decalaracion de campos
    cosecutive = fields.Char('Consecutivo',
                             size=50,
                             help='Posicion del consecutivo mas 1')
    mont = fields.Boolean(
        'Mes',
        default=True,
        help='Permite agrupar los consecutivos en funcion de mes')
    year = fields.Boolean(
        'Año',
        default=True,
        help='Permite agrupar los consecutivos en funcion de año')
Ejemplo n.º 10
0
class maintenance_panne(models.Model):
    _name = 'maintenance.panne'
    _order = "occurrence_panne"

    @api.one
    @api.depends('demande_intervention_ids')
    def _get_occurrence_panne(self):
        self.occurrence_panne = len(self.demande_intervention_ids)

    @api.one
    @api.depends('demande_intervention_ids')
    def _get_panne_courante(self):
        for p in self.env['maintenance.panne'].search([]):
            p.panne_courante = False
        for p in self.env['maintenance.panne'].search(
            [], limit=5, order='occurrence_panne desc'):
            p.panne_courante = True

    name = fields.Char('Panne', required=True)
    description = fields.Text('Description')
    occurrence_panne = fields.Integer(compute='_get_occurrence_panne',
                                      string="Nombre d\'occurrence",
                                      store=True)
    demande_intervention_ids = fields.One2many(
        'maintenance.demande.intervention', 'panne_id', 'Demande intervention')
    panne_courante = fields.Boolean(compute='_get_panne_courante',
                                    string='Panne courante',
                                    store=True)
Ejemplo n.º 11
0
class sale_order_line(models.Model):
    _inherit = 'sale.order.line'

    is_apply_on_discount_amount = fields.Boolean("Tax Apply After Discount")
    discount_method = fields.Selection([('fix', 'Fixed'),
                                        ('per', 'Percentage')],
                                       'Discount Method')
Ejemplo n.º 12
0
class GolCustomer(osv.Model):
    _name = 'res.partner'
    _inherit = 'res.partner' 
    
    comment=fields.Text("Descripción u Observación")
    
    tradename=fields.Char('Nombre Comercial', size=80)
    phone=fields.Char('Teléfono 1', size=15)
    phone2=fields.Char('Teléfono 2', size=15)
    phone3=fields.Char('Teléfono 3', size=15)
    riseUse=fields.Selection([('rise','Rise'),
                                    ('contributorSpecial','Contribuyente Especial')],'Seleccione',
                                    default ='rise', required=True)
    identificationType=fields.Many2one('gol.identification.type','Tipo de Identificación')    
    identificationNumber=fields.Char('Número de Identificación',help='Ingrese el numero de identificación')
    typePerson=fields.Many2one('gol.type.person','Tipo de persona')    
    bussinesName=fields.Char('Razón Social',help='Ingrese el razón social')
    forcedToTakeAccounting=fields.Boolean('Obligado a llevar contabilidad',default=False)  
    #Datos del cliente
    shortName=fields.Char('Nombre Corto', size=80)
    customerType=fields.Many2one('gol.customer.type','Tipo de Cliente')
    #accountingAccount=fields.Many2one('account.account','Cuenta Contable')
    balance=fields.Float('Saldo')             
    customerType=fields.Many2one('gol.customer.type','Tipo de Cliente')
    discount=fields.Many2one('gol.generic.discount','Descuento Cliente')
    rulesRetention=fields.One2many('gol.validator.retention','idRulesRetention','Reglas Retención')
    #Campos para el Credito
    maximunAmount=fields.Float('Monto Maximo',size=50,help='Monto maximo de crédito')
    warranty=fields.Text('Garantía',help='Que tiene de garantia por el crédito') 
Ejemplo n.º 13
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')
Ejemplo n.º 14
0
class GolCompany(osv.osv):
    _name = 'res.company'
    _inherit = 'res.company'
    #Para el eliminar el tex area en empresa
    overdue_msg = fields.Text('Descripción')

    tradename = fields.Char('Nombre Comercial', size=80)
    phone2 = fields.Char('Teléfono 2', size=15)
    phone3 = fields.Char('Teléfono 3', size=15)
    riseUse = fields.Selection(
        [('rise', 'Rise'), ('contributorSpecial', 'Contribuyente Especial')],
        'Seleccione',
        default='rise',
        required=True)
    identificationType = fields.Many2one('gol.identification.type',
                                         'Tipo de Identificación')
    identificationNumber = fields.Char(
        'Número de Identificación', help='Ingrese el numero de identificación')
    typePerson = fields.Many2one('gol.type.person', 'Tipo de persona')
    bussinesName = fields.Char('Razón Social', help='Ingrese el razón social')
    forcedToTakeAccounting = fields.Boolean('Obligado a llevar contabilidad',
                                            default=False)
    accountant = fields.Many2one('gol.accountant', 'Contador')
    taxLiability = fields.One2many('gol.tax.liability', 'idCompany',
                                   'Obligaciones Tributarias')
    legalRepresentative = fields.Many2one('gol.contact', 'Representante Legal')
    formatCorrelative = fields.Many2one('gol.format.correlative',
                                        'Formatos Correlativos')

    child_contact_ids = fields.One2many('res.partner',
                                        'parent_id',
                                        'Contacts',
                                        domain=[('active', '=', True)]),
Ejemplo n.º 15
0
class grp_product_attribute_value(models.Model):
    _inherit = "product.attribute.value"

    articulo_id = fields.Many2one('grp.sice_art_serv_obra', string=u'Artículo')
    med_cod_id = fields.Many2one('grp.sice_medida', string=u'Medida de la variante')
    pres_id = fields.Many2one('grp.sice_presentacion', string='Presentacion')
    med_cod_pres_id = fields.Many2one('grp.sice_medida', string=u'Medida de la presentación')
    det_variante_id = fields.Many2one('grp.sice_det_variante', string='Detalle de variante')
    sice_color_id = fields.Many2one('grp.sice_color', string='Color SICE')
    active = fields.Boolean(string=u'Activo', default=True)

    @api.multi
    def name_get(self):
        if self._context and not self._context.get('show_attribute', True):
            return super(grp_product_attribute_value, self).name_get()
        res = []
        for value in self:
            if not value.articulo_id:
                res.append((value.id, value.name))
            else:
                name = ""
                color = False
                det_variante_desc = False
                marc_desc = False

                if value.sice_color_id:
                    color = value.sice_color_id.descripcion
                    name += " " + color
                att_desc = False
                if value.attribute_id:
                    att_desc = value.attribute_id.name
                    name += " (" + att_desc
                else:
                    name += " (-----"
                med_cod_desc = value.med_cod_id.descripcion
                name += ": " + med_cod_desc + ")"
                med_cod_pres_desc = value.med_cod_pres_id.descripcion
                pres_desc = value.pres_id.descripcion
                if value.pres_id.unme_id:
                    name += " (" + pres_desc + ": " + med_cod_pres_desc + " " + value.pres_id.unme_id.descripcion + ")"
                else:
                    name += " (" + pres_desc + ": " + med_cod_pres_desc + ")"
                if value.det_variante_id:
                    marc_obj = self.env['grp.sice_marca'].search([('cod', '=',
                                                                  value.det_variante_id.marc_cod)])
                    if len(marc_obj) > 0:
                        marc_obj = marc_obj[0]
                    det_variante_desc = value.det_variante_id.descripcion
                    marc_desc = marc_obj.descripcion
                    if marc_desc:
                        name += " (" + marc_desc + ", "
                    else:
                        name += " ( False, "
                    if det_variante_desc:
                        name += det_variante_desc + ")"
                    else:
                        name += "False)"
                    # name += " (" + marc_desc + ", " + det_variante_desc + ")"
                res.append((value.id, name))
        return res
Ejemplo n.º 16
0
class product_pricelist(models.Model):
    _inherit = 'product.pricelist'
    ef_is_comp = fields.Boolean('ЭтоАкция', select=True)
    ef_partnerid = fields.Many2one('res.partner',
                                   ondelete='set null',
                                   string='Контрагент',
                                   select=True)
Ejemplo n.º 17
0
class prestashop_res_lang(models.Model):
    _name = 'prestashop.res.lang'
    _inherit = 'prestashop.binding'
    _inherits = {'res.lang': 'openerp_id'}

#    _columns = {
#        'openerp_id': fields.Many2one(
#            'res.lang',
#            string='Lang',
#            required=True,
#            ondelete='cascade'
#        ),
#        'active': fields.Boolean('Active in prestashop'),
#    }
    
    openerp_id = fields.Many2one(
            'res.lang',
            string='Lang',
            required=True,
            ondelete='cascade'
        )
    active = fields.Boolean('Active in prestashop', default=False)
    

    _sql_constraints = [
        ('prestashop_uniq', 'unique(backend_id, prestashop_id)',
         'A Lang with the same ID on Prestashop already exists.'),
    ]
Ejemplo n.º 18
0
class account_voucher(models.Model):
    _inherit= "account.voucher"

    enviado = fields.Boolean(string="Enviado")
    veces_descarga = fields.Integer(string="# Descargado")
    egreso = fields.Char('Egreso', readonly=True, copy=False)
    res_partner_bank_id = fields.Many2one('res.partner.bank',string="Banco")
    cod_proveedor = fields.Char(related='res_partner_bank_id.bank_bic',string="Codigo de Proveedor en el Banco")
    partner_id_related = fields.Many2one(related='partner_id',string="Proveedir")


    @api.multi
    def default_banco_ids(self, partner_id_related):
        obj_datos=self.env['res.partner.bank'].search([('partner_id','=',partner_id_related)])
        if len(obj_datos)==1:
            return {
                'value': {
                    'res_partner_bank_id': obj_datos.id,
                    }
                }
    

    @api.model
    def create(self, vals):
        seq = self.env['ir.sequence'].next_by_code('account.voucher') or '/'
        vals['egreso'] = seq
        a = super(account_voucher, self).create(vals)
        return a
Ejemplo n.º 19
0
class sale_order_line_standard(models.Model):
    _inherit = 'sale.order.line'

    sequence_no = fields.Integer('Sequence', default=0)
    my_bool = fields.Boolean('Boolean', default=True)
    sale_order_child = fields.Many2one('sale.order.line')

    @api.multi
    def unlink(self):
        if not self.sale_order_child:
            record = self.env['sale.order.line'].search([('sale_order_child',
                                                          '=', self.id)])
            for each in record:
                each.unlink()
            self.reorder()
        return super(sale_order_line_standard, self).unlink()

    @api.model
    def reorder(self):
        seq = 1
        order = self.order_id.id
        record = self.env['sale.order.line'].search([('order_id', '=', order)])
        for each in record:
            if each.id == self.id:
                continue
            else:
                if each.my_bool == False:
                    each.update({'sequence_no': seq})
                    seq = seq + 1
                else:
                    each.update({'sequence_no': seq})
Ejemplo n.º 20
0
class born_res_partner(models.Model):
    _inherit = "res.partner"

    activity_id = fields.Many2one('born.activity',
                                  string=u'活动',
                                  ondelete='cascade',
                                  help=u'活动')
    is_lottery = fields.Boolean(u'活动玩家', default=False, help=u"标记该用户为参加活动的玩家")
Ejemplo n.º 21
0
class descuentos_escuela(models.Model):
    _name = 'descuentos'

    name = fields.Char('Descripción')
    porcentaje = fields.Float('Porcentaje')
    sequence = fields.Integer('Sequence')
    cuenta_id = fields.Many2one('account.account', string="Cuenta")
    is_pronto_pago = fields.Boolean(string="Es pronto pago", default=False)
    dias = fields.Integer(string="Dias de Descuento")
Ejemplo n.º 22
0
class stocklocation(models.Model):
    _inherit = "stock.location"

    quality_ck_loc = fields.Boolean(
        "Is Quality Location",
        help=
        'If you check this then the location is used for Quality Check Location',
        default=False
    )  # used in MRP or PO for send finished product in location for Quality check
Ejemplo n.º 23
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')
Ejemplo n.º 24
0
class born_activity_tpl(osv.osv):
    _name = 'born.activity.tpl'
    _description = u"模板"

    name = fields.Char(u'名称', size=255, help=u"活动名称", required=True)
    image = fields.Binary(string=u"活动海报", attachment=True, help=u"活动海报")
    image_url = fields.Char(u'海报地址', size=255, help=u"海报地址")
    file_name = fields.Char(u'海报名称', size=255, help=u"海报名称")
    note = fields.Text(u'活动简介', required=True, help=u'活动简介')
    description = fields.Text(u'活动描叙', required=True, help=u'活动详细描叙,活动参与流程')
    provision = fields.Text(u'活动条款', help=u'参与活动的条款')
    active = fields.Boolean(u'归档', default=True)
    price = fields.Float(u'报名费', help=u'参与活动的报名费用')
    company_id = fields.Many2one('res.company',
                                 u'公司',
                                 ondelete='cascade',
                                 required=True,
                                 help=u'活动所属公司')
    game_id = fields.Many2one('born.game', u'游戏', help=u'参与活动的游戏')
    app_id = fields.Many2one('tl.weixin.app', u'公众号', ondelete="cascade")
    activity_ids = fields.One2many('born.activity',
                                   'active_tpl_id',
                                   string=u'活动',
                                   help=u'商户报名活动列表')
    company_ids = fields.Many2many('res.company',
                                   'born_activity_company_rel',
                                   'activity_id',
                                   'company_id',
                                   u'允许发行的公司',
                                   help=u'限制该活动允许发行的公司,不设置表示所有的平台都可以看到该活动')
    default_gift_ids = fields.Many2many('born.game.gift',
                                        'born_activity_default_gift_rel',
                                        'activity_id',
                                        'gift_id',
                                        u'默认奖品',
                                        help=u'该奖品为发行活动的公司提供,所有参与的公司都能够使用该奖品')

    @api.model
    def create(self, vals):

        if vals.get('image', False):
            s3 = s3client(self)
            image_url = s3.upload(self._cr, self._uid, vals.get('image'),
                                  vals.get('file_name', 'image.png'))
            vals['image_url'] = image_url
        return super(born_activity_tpl, self).create(vals)

    @api.multi
    def write(self, vals):

        if vals.get('image', False):
            s3 = s3client(self)
            image_url = s3.upload(self._cr, self._uid, vals.get('image'),
                                  vals.get('file_name', 'image.png'))
            vals['image_url'] = image_url
        return super(born_activity_tpl, self).write(vals)
Ejemplo n.º 25
0
class born_sale_order(models.Model):
    _inherit = 'sale.order'

    sale_category = fields.Selection([
        ('weixin', u'微信商城'),
        ('online', u'在线销售'),
        ('normal', u'普通销售'),
    ],
                                     default='normal',
                                     string=u'状态',
                                     help=u'销售类型')
    is_weixin_unlick = fields.Boolean(u'微信删除订单', help=u"微信删除订单", default=False)
    openid = fields.Char('OPENID', size=255, help="OPENID")
    weixin_user_id = fields.Many2one('born.weixin.users', u'关注者', help=u"关注者")
    out_trade_no = fields.Char(u'微信对应订单号', size=255, help=u"微信对应订单号")
    transaction_id = fields.Char(u'微信支付流水号', size=255, help=u"微信支付流水号")
    is_lottery = fields.Boolean(u'是否已经抽奖', help=u'是否已经抽奖', default=False)
    spread_id = fields.Many2one('born.spread', u'活动编号')
    payment_date = fields.Datetime(u'付款日期')
Ejemplo n.º 26
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)
Ejemplo n.º 27
0
class account_invoice(models.Model):
    _inherit= "account.journal"

    codigo_transaccion_banco = fields.Char(string="Codigo Transaccional Banco")
    exigir_codigo = fields.Boolean(string="Exigir Codigo")

    @api.constrains('exigir_codigo')
    def valida_check(self):
        if self.exigir_codigo==True:
            if len(self.codigo_transaccion_banco)==0:
                raise osv.except_osv(('Alerta'),("Ingresar el Codigo Transaccional Banco."))
Ejemplo n.º 28
0
class GolItemInvoice(osv.Model):
    _name = 'account.invoice.line'
    _inherit = 'account.invoice.line'    
    isProduct=fields.Boolean('Producto',default=True, invisible=True)    
    itemDiscount=fields.Many2one('gol.generic.discount','Descuento')
    amountItemDiscount=fields.Float('Descuento asociado segun el articulo o servicio',compute='_ItemDiscountCalculation')
    #amountAutomaticDiscount=fields.Float('Descuento asociado a un periodo de Tiempo')
    amountCustomerDiscount=fields.Float('Descuento asociado al Cliente')
    amountAutomaticDiscount=fields.Float('DescuentoAutomatico')
    
    amountTotalDiscount=fields.Float('Monto Descuentos',Store=True)
    amountTotalTax=fields.Float('Monto Impuestos',Store=True)
    amountTotal=fields.Float('Total',Storage=True)
    price_unit=fields.Float('Precio Unitatio',Storage=True,compute='_SetPriceUnit')
    
    price_subtotal = fields.Float(string='Amount',
        store=True, readonly=False, compute='_ComputePrice')    
    
    @api.one
    def _ItemDiscountCalculation(self):
        self.amountItemDiscount=(self.price_unit*self.quantity)*(self.itemDiscount.value*0.01)
    
    @api.onchange('price_unit','quantity','itemDiscount','customerDiscount','automaticDiscount','amountTotalDiscount')
    def TotalDiscountCalculation(self):
        self.amountTotalDiscount=(self.price_unit*self.quantity)*(self.itemDiscount.value*0.01)          
    
    @api.onchange('price_subtotal','invoice_line_tax_id','amountTotalTax')
    def TotalTaxCalculation(self):
        totalTax=0;
        for tax in self.invoice_line_tax_id:
            totalTax=self.price_subtotal*tax.amount+totalTax
        self.amountTotalTax=totalTax
            
    @api.onchange('price_subtotal','amountTotalTax','amountTotal')
    def TotalAmountCalculation(self):
        self.amountTotal=self.price_subtotal+self.amountTotalTax
    
    @api.one
    def _SetPriceUnit(self):
        if self.isProduct == False:
            self.price_unit = self.price_subtotal/ self.quantity
        if self.isProduct == True:
            self.price_unit=self.product_id.list_price     

    @api.onchange('quantity','price_unit','amountTotalDiscount','price_subtotal')
    def SubtotalCalculation(self):
        self.price_subtotal=(self.price_unit*self.quantity)-self.amountTotalDiscount
    @api.one
    def _ComputePrice(self):
        self.price_subtotal=(self.price_unit*self.quantity)-self.amountTotalDiscount
    
    ''' Con este metodo hago editables o solo lectura los campos de los articulos que 
Ejemplo n.º 29
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
Ejemplo 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.')