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)
}
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...
Did you have post a bug on launchpad?
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...
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.
Hi denis, please paste your code and xml over here.
ok I'll edit my question.