country_id in crm_lead doesn't exist and can't start server when updating modules

Asked by fooflare

Version 6.0.2
My revno. is 4663

When I update the modules this error appears, the column country_id is removed in crm_lead but when creating crm_lead_report view, in select the column still appears:

[2011-06-17 13:49:17,957][Isonor_601_110303] INFO:orm:column country_id (Country) in table crm_lead removed: converted to a function !

[2011-06-17 13:49:18,170][Isonor_601_110303] ERROR:db.cursor:Programming error: no existe la columna c.country_id
LÍNEA 23: c.country_id,
                              ^
, in query
            CREATE OR REPLACE VIEW crm_lead_report AS (
                SELECT
                    id,
                    to_char(c.create_date, 'YYYY') as name,
                    to_char(c.create_date, 'MM') as month,
                    to_char(c.create_date, 'YYYY-MM-DD') as day,
                    to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
                    to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
                    to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
                    c.state,
                    c.user_id,
                    c.probability,
                    c.stage_id,
                    c.type,
                    c.company_id,
                    c.priority,
                    c.section_id,
                    c.channel_id,
                    c.type_id,
                    c.categ_id,
                    c.partner_id,
                    c.country_id,
                    c.planned_revenue,
                    c.planned_revenue*(c.probability/100) as probable_revenue,
                    1 as nbr,
                    (SELECT count(id) FROM mailgate_message WHERE model='crm.lead' AND res_id=c.id AND history=True) AS email,
                    date_trunc('day',c.create_date) as create_date,
                    extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
                    abs(extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24)) as delay_expected,
                    extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
                FROM
                    crm_lead c
            )

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
fooflare (fooflare) said :
#1

My revno. is 4663

When I update the modules this error appears, the column country_id is removed in crm_lead but when creating crm_lead_report, in the select for creating table the column still appears:

[2011-06-17 13:49:17,957][Isonor_601_110303] INFO:orm:column country_id (Country) in table crm_lead removed: converted to a function !

[2011-06-17 13:49:18,170][Isonor_601_110303] ERROR:db.cursor:Programming error: no existe la columna c.country_id
LÍNEA 23: c.country_id,
                              ^
, in query
            CREATE OR REPLACE VIEW crm_lead_report AS (
                SELECT
                    id,
                    to_char(c.create_date, 'YYYY') as name,
                    to_char(c.create_date, 'MM') as month,
                    to_char(c.create_date, 'YYYY-MM-DD') as day,
                    to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
                    to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
                    to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
                    c.state,
                    c.user_id,
                    c.probability,
                    c.stage_id,
                    c.type,
                    c.company_id,
                    c.priority,
                    c.section_id,
                    c.channel_id,
                    c.type_id,
                    c.categ_id,
                    c.partner_id,
                    c.country_id,
                    c.planned_revenue,
                    c.planned_revenue*(c.probability/100) as probable_revenue,
                    1 as nbr,
                    (SELECT count(id) FROM mailgate_message WHERE model='crm.lead' AND res_id=c.id AND history=True) AS email,
                    date_trunc('day',c.create_date) as create_date,
                    extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
                    abs(extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24)) as delay_expected,
                    extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
                FROM
                    crm_lead c
            )

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#2

Hello Amós Oviedo,

I have checked this issue and I did not face any problem. I am also checked this issue technically and the related class is inherit the res.partner.address object so there is not any issue of country_id field missing issue.

You can check the related following code in crm module:
class crm_lead(crm_case, osv.osv):
    """ CRM Lead Case """
    _name = "crm.lead"
    _description = "Lead/Opportunity"
    _order = "date_action, priority, id desc"
    _inherit = ['mailgate.thread','res.partner.address']

Hope this will help you.

Thanks.

Revision history for this message
Kelbethor (csi-kelbethor) said :
#3

It seems another module is dropping country_id column on res.partner.address (maybe city or city_contact module?) and crm_lead_report fails when it attempts to create the view...

Can you help with this problem?

Provide an answer of your own, or ask fooflare for more information if necessary.

To post a message you must log in.