credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #01476
[Bug 901647] Re: Indirectly inheriting models do not get updated when a new module is installed (this leads e.g. to "column email_template.fetchmail_server_id does not exist")
*** This bug is a duplicate of bug 799378 ***
https://bugs.launchpad.net/bugs/799378
As Naresh correctly reminded me, this problem stems from the issue
described in bug 799378, so let's make this new one a duplicate. For
what it's worth, bug 799378 mentions another common case where this
occurs (with leads rather than email templates) and a workaround when
writing custom modules that have this issue.
** This bug has been marked a duplicate of bug 799378
models inheriting by prototype (_inherit with different _name) do not get updated when parent model is modified
--
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/901647
Title:
Indirectly inheriting models do not get updated when a new module is
installed (this leads e.g. to "column
email_template.fetchmail_server_id does not exist")
Status in OpenERP Server:
Confirmed
Bug description:
Hi,
I am testing the trunk version and I installed the following modules in this sequence:
1. sale
2. hr_recruitment
3. purchase
while installing the purchase module, I get the following error:
[2011-12-08 12:00:19,081][test] INFO:init.load:module purchase: loading edi/purchase_order_action_data.xml
[2011-12-08 12:00:19,158][test] ERROR:db.cursor:Programming error: column email_template.fetchmail_server_id does not exist
LINE 1: ...email_template."user_id",email_template."subtype",email_temp...
^
, in query SELECT email_template."body_text",email_template."email_bcc",email_template."auto_delete",email_template."mail_server_id",email_template."references",email_template."partner_id",email_template."subject",email_template."user_id",email_template."subtype",email_template."fetchmail_server_id",email_template."ref_ir_act_window",email_template."original",email_template."report_template",email_template."ref_ir_value",email_template."state",email_template."track_campaign_item",email_template."user_signature",email_template."null_value",email_template."email_cc",email_template."res_id",email_template."message_id",email_template."model_id",email_template."sub_model_object_field",email_template."body_html",email_template."email_to",email_template."sub_object",email_template."date",email_template."copyvalue",email_template."lang",email_template."name",email_template."model_object_field",email_template."report_name",email_template."headers",email_template."reply_to",email_template."model",email_template."email_from",email_template.id FROM "email_template" WHERE email_template.id IN %s ORDER BY date desc
[2011-12-08 12:00:19,158][test] ERROR:db.cursor:bad query: update "email_template" set "model"=NULL where id = 3
Traceback (most recent call last):
File "/home/openerp/openobject-server/openerp/sql_db.py", line 215, in execute
res = self._obj.execute(query, params)
InternalError: current transaction is aborted, commands ignored until end of transaction block
[2011-12-08 12:00:19,160][test] ERROR:tools.convert.xml_import:Parse error in /home/openerp/bazaar/trunk/openobject-addons/purchase/edi/purchase_order_action_data.xml:37:
<record id="email_template_edi_purchase" model="email.template">
<field name="name">Automated Purchase Order Notification Mail</field>
<field name="email_from">${object.validator.user_email or ''}</field>
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
<field name="email_to">${object.partner_address_id.email}</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="auto_delete" eval="True"/>
<field name="body_html">
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
<p>Hello${object.partner_address_id.name and ' ' or ''}${object.partner_address_id.name or ''},</p>
<p>Here is a purchase order confirmation from ${object.company_id.name}: </p>
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
&nbsp;&nbsp;<strong>REFERENCES</strong><br />
&nbsp;&nbsp;Order number: <strong>${object.name}</strong><br />
&nbsp;&nbsp;Order total: <strong>${object.amount_total} ${object.pricelist_id.currency_id.name}</strong><br />
&nbsp;&nbsp;Order date: ${object.date_order}<br />
% if object.origin:
&nbsp;&nbsp;Order reference: ${object.origin}<br />
% endif
% if object.partner_ref:
&nbsp;&nbsp;Your reference: ${object.partner_ref}<br />
% endif
&nbsp;&nbsp;Your contact: <a href="mailto:${object.validator.user_email or ''}?subject=Order%20${object.name}">${object.validator.name}</a>
</p>
<p>
You can view the order confirmation document and download it using the following link:
</p>
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
<br/>
<p>If you have any question, do not hesitate to contact us.</p>
<p>Thank you!</p>
<br/>
<br/>
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
</div>
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
<span style="color: #222; margin-bottom: 5px; display: block; ">
% if object.company_id.street:
${object.company_id.street}<br/>
% endif
% if object.company_id.street2:
${object.company_id.street2}<br/>
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip} ${object.company_id.city}<br/>
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
% endif
</span>
% if object.company_id.phone:
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
Phone:&nbsp; ${object.company_id.phone}
</div>
% endif
% if object.company_id.website:
<div>
Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
</div>
%endif
<p></p>
</div>
</div>
</field>
<field name="body_text">
Hello${object.partner_address_id.name and ' ' or ''}${object.partner_address_id.name or ''},
Here is a purchase order confirmation from ${object.company_id.name}:
| Order number: *${object.name}*
| Order total: *${object.amount_total} ${object.pricelist_id.currency_id.name}*
| Order date: ${object.date_order}
% if object.origin:
| Order reference: ${object.origin}
% endif
% if object.partner_ref:
| Your reference: ${object.partner_ref}<br />
% endif
| Your contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
You can view the order confirmation and download it using the following link:
${ctx.get('edi_web_url_view') or 'n/a'}
If you have any question, do not hesitate to contact us.
Thank you!
--
${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
${object.company_id.name}
% if object.company_id.street:
${object.company_id.street or ''}
% endif
% if object.company_id.street2:
${object.company_id.street2}
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip or ''} ${object.company_id.city or ''}
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
% endif
% if object.company_id.phone:
Phone: ${object.company_id.phone}
% endif
% if object.company_id.website:
${object.company_id.website or ''}
% endif
</field>
</record>
Traceback (most recent call last):
File "/home/openerp/openobject-server/openerp/tools/convert.py", line 889, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/home/openerp/openobject-server/openerp/tools/convert.py", line 856, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/home/openerp/openobject-server/openerp/addons/base/ir/ir_model.py", line 719, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/home/openerp/bazaar/trunk/openobject-addons/fetchmail/fetchmail.py", line 247, in create
res = super(mail_message,self).create(cr, uid, values, context=context)
File "/home/openerp/openobject-server/openerp/osv/orm.py", line 4161, in create
self.pool.get(object)._store_set_values(cr, user, ids, fields2, context)
File "/home/openerp/openobject-server/openerp/osv/orm.py", line 4323, in _store_set_values
'"'+f+'"='+self._columns[f]._symbol_set[0] + ' where id = %s', (self._columns[f]._symbol_set[1](value), id))
File "/home/openerp/openobject-server/openerp/sql_db.py", line 153, in wrapper
return f(self, *args, **kwargs)
File "/home/openerp/openobject-server/openerp/sql_db.py", line 215, in execute
res = self._obj.execute(query, params)
InternalError: current transaction is aborted, commands ignored until end of transaction block
[2011-12-08 12:00:19,268][test] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
File "/home/openerp/openobject-server/openerp/osv/osv.py", line 120, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/openerp/openobject-server/openerp/osv/osv.py", line 172, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/openerp/openobject-server/openerp/osv/osv.py", line 163, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/openerp/openobject-server/openerp/addons/base/module/wizard/base_module_upgrade.py", line 98, in upgrade_module
_db, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/home/openerp/openobject-server/openerp/pooler.py", line 39, in restart_pool
registry = RegistryManager.new(db_name, force_demo, status, update_module, True)
File "/home/openerp/openobject-server/openerp/modules/registry.py", line 160, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/home/openerp/openobject-server/openerp/modules/loading.py", line 339, in load_modules
processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules)
File "/home/openerp/openobject-server/openerp/modules/loading.py", line 254, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules)
File "/home/openerp/openobject-server/openerp/modules/loading.py", line 194, in load_module_graph
load_data(module_name, idref, mode)
File "/home/openerp/openobject-server/openerp/modules/loading.py", line 94, in <lambda>
load_data = lambda *args: _load_data(cr, *args, kind='data')
File "/home/openerp/openobject-server/openerp/modules/loading.py", line 140, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File "/home/openerp/openobject-server/openerp/tools/convert.py", line 999, in convert_xml_import
obj.parse(doc.getroot())
File "/home/openerp/openobject-server/openerp/tools/convert.py", line 889, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/home/openerp/openobject-server/openerp/tools/convert.py", line 856, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/home/openerp/openobject-server/openerp/addons/base/ir/ir_model.py", line 719, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/home/openerp/bazaar/trunk/openobject-addons/fetchmail/fetchmail.py", line 247, in create
res = super(mail_message,self).create(cr, uid, values, context=context)
File "/home/openerp/openobject-server/openerp/osv/orm.py", line 4161, in create
self.pool.get(object)._store_set_values(cr, user, ids, fields2, context)
File "/home/openerp/openobject-server/openerp/osv/orm.py", line 4323, in _store_set_values
'"'+f+'"='+self._columns[f]._symbol_set[0] + ' where id = %s', (self._columns[f]._symbol_set[1](value), id))
File "/home/openerp/openobject-server/openerp/sql_db.py", line 153, in wrapper
return f(self, *args, **kwargs)
File "/home/openerp/openobject-server/openerp/sql_db.py", line 215, in execute
res = self._obj.execute(query, params)
InternalError: current transaction is aborted, commands ignored until end of transaction block
Thanks
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/901647/+subscriptions
References