Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Problem with custom module.

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
installationmodulev7
2 Respuestas
11323 Vistas
Avatar
Bonnet Denis

This is a problem I met for the second time.

I've made a custom module with all company parameter. this morning I wanted to work on Accounting functionality on a testing database. I duplicate the product database and my param module.

So now I have 2 databases and 2 Modules. One for production and one for testing.

I uninstall the param module from testing database and it's ok. I try to install the testing module and the system broke. I can't go to the login page and I have a message like : "the column 'test' don't exist in res_partner database". But I have a script that add this column.

Testing module is exactly the same than param module.

I don't understand why the same module don't work if I uninstall and reinstall a copy of it.

someone can explain me what I'm doing wrong?

Thanks for reading.

edit: My module code My xml file (I have comment the reference to the new field) <openerp> <data>

        <record model="ir.ui.view" id="partner_view_form_juliana">
            <field name="name">partner.view.form.juliana</field>
            <field name="model">res.partner</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="priority">52</field>
            <field name="arch" type="xml">
                <!--<xpath expr="//field[@name='nace_id']" position="before">
                    <field name="nom_commercial" attrs="{'invisible': [('is_company','!=',True)]}"/>
                </xpath>-->
                <xpath expr="//field[@name='siren']" position="after">
                    <field name="societe_com" widget="url" attrs="{'invisible': [('is_company','!=',True)]}"/>
                </xpath>
                <xpath expr="//field[@name='child_ids']/form/div/group/field[@name='mobile']" position="after">
                    <field name="user_id" />
                </xpath>
            </field>
        </record>
        <!--
        <record id="view_res_partner_filter_juliana" model="ir.ui.view">
            <field name="name">res.partner.select.juliana</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_res_partner_filter"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='user_id']" position="after">
                    <field name="nom_commercial"/>
                </xpath>
            </field>
        </record> -->

    </data>
</openerp>

res_partner.py:

# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
import logging

_logger = logging.getLogger("PARAM-JULIANA")
#
#Ajout du lien vers société.com
#

class res_partner(osv.osv):
    _name = 'res.partner'
    _inherit = 'res.partner'

    def _get_societe_com_link(self, cr, uid, ids, name, args, context=None):
        result = dict.fromkeys(ids, False)
        res = {}
        text=""
        for obj in self.browse(cr, uid, ids, context=context):
            res[obj.id]=text
            if obj.siren  :
                text = "http://www.societe.com/cgi-bin/recherche?rncs=" + obj.siren
                res[obj.id]=text
        return res

    _columns = {
        'societe_com': fields.function(_get_societe_com_link, type='char', size=64, string='societe.com'),
        'nom_commercial': fields.char('Nom Commercial', size=128, select=True)
    }
0
Avatar
Descartar
mike

I ran into a similar problem when adding fields to mail.notification model. I couldn't figure it out so I used SQL to add the new fields to the table and that got it working. I'm guessing there is something in configuration data for base modules that prevents them being updated like with a custom module when you restart OpenERP. I can't find the culprit...

Bonnet Denis
Autor

Did you have post a bug on launchpad?

mike

I honestly don't know if it is a bug or a feature I don't understand. I would look into the docs but usually cannot find anything helpful there...

patrick
  1. How do you duplicate the database? Using the webinterface of OE, or using command line?... 2. Why duplicate the module? Unless you change something, there is no need to do that. 3. If you want to change code, you better use a seperate system to do the testing, until it is working correctly.
Bonnet Denis
Autor

I duplicate In the OS with GUI because I need to do some changes this month and I want to do my work on testing database on testing module, to not perturb the production platform. If you know another way to do the job you're welcome.

Ghanshyam Prajapati

Hi denis, please paste your code and xml over here.

Bonnet Denis
Autor

ok I'll edit my question.

Avatar
Simplify it!
Mejor respuesta

Hello. Sometimes I face this problem when I'm trying to add a new field.

Here's what I do:

  1. First I remove the field from the view.

  2. I install the module

  3. I add the field again on the view

  4. I upgrade the module.

I don't know why this happens but to me this works.

1
Avatar
Descartar
Bonnet Denis
Autor

thanks for your answer. But how can I install or uninstall the module if I can't go through the interface?

Simplify it!

You can't go through the interface because it's trying to read the view. Remove the conflictive field from the view. If that doesn't work restart your openerp server and that should work. Please tell me if it worked for you.

Bonnet Denis
Autor

I'n having this error: ProgrammingError: ERREUR: la colonne res_partner.nom_commercial n'existe pas LIGNE 1 : SELECT res_partner."ean13",res_partner."nom_commercial",res_... I think I have to restart the module but I didn't have the rigth to do that with a command line.

Simplify it!

Hmmm. Another way is deleting the xml line from your __openerp__.py you can delete your view and restart your server or your pc if you don't have the permissions to restart your server... Then you are not going to see that error anymore. You can install the module as always. And then you can add again that file to the __openerp__.py

Avatar
mike
Mejor respuesta

Try this:

class x_res_partner(osv.osv):
    _name = 'res.partner'
    _inherit = 'res.partner'

    """your code here"""

x_res_partner()

I think the problem is with your inheritance. Give your class a different name from the class you inherit and then instantiate it.

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Aeroo as an installable module out of the box?
installation module v7 aeroo
Avatar
Avatar
1
mar 15
5121
How to automate providing access to new modules to users
installation module user v7
Avatar
0
mar 15
3826
how can I resolve dependency for Module called unidecode? Resuelto
installation module
Avatar
Avatar
Avatar
Avatar
Avatar
6
sept 24
53718
How to run a python function right after installing a module?
installation module
Avatar
2
jun 20
21143
How to disable Google Analytics?
installation v7
Avatar
Avatar
Avatar
Avatar
3
abr 16
10386
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now