← Back to team overview

credativ team mailing list archive

[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">
  &lt;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); "&gt;

      &lt;p&gt;Hello${object.partner_address_id.name and ' ' or ''}${object.partner_address_id.name or ''},&lt;/p&gt;
      
      &lt;p&gt;Here is a purchase order confirmation from ${object.company_id.name}: &lt;/p&gt;
      
      &lt;p style="border-left: 1px solid #8e0000; margin-left: 30px;"&gt;
         &amp;nbsp;&amp;nbsp;&lt;strong&gt;REFERENCES&lt;/strong&gt;&lt;br /&gt;
         &amp;nbsp;&amp;nbsp;Order number: &lt;strong&gt;${object.name}&lt;/strong&gt;&lt;br /&gt;
         &amp;nbsp;&amp;nbsp;Order total: &lt;strong&gt;${object.amount_total} ${object.pricelist_id.currency_id.name}&lt;/strong&gt;&lt;br /&gt;
         &amp;nbsp;&amp;nbsp;Order date: ${object.date_order}&lt;br /&gt;
         % if object.origin:
         &amp;nbsp;&amp;nbsp;Order reference: ${object.origin}&lt;br /&gt;
         % endif
         % if object.partner_ref:
         &amp;nbsp;&amp;nbsp;Your reference: ${object.partner_ref}&lt;br /&gt;
         % endif
         &amp;nbsp;&amp;nbsp;Your contact: &lt;a href="mailto:${object.validator.user_email or ''}?subject=Order%20${object.name}"&gt;${object.validator.name}&lt;/a&gt;
      &lt;/p&gt;

      &lt;p&gt;
      You can view the order confirmation document and download it using the following link:
      &lt;/p&gt;
              &lt;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 ''}"&gt;View Order&lt;/a&gt;

      &lt;br/&gt;
      &lt;p&gt;If you have any question, do not hesitate to contact us.&lt;/p&gt;
      &lt;p&gt;Thank you!&lt;/p&gt;
      &lt;br/&gt;
      &lt;br/&gt;
      &lt;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;"&gt;
          &lt;h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;"&gt;
              &lt;strong style="text-transform:uppercase;"&gt;${object.company_id.name}&lt;/strong&gt;&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;"&gt;
          &lt;span style="color: #222; margin-bottom: 5px; display: block; "&gt;
          % if object.company_id.street:
              ${object.company_id.street}&lt;br/&gt;
          % endif
          % if object.company_id.street2:
              ${object.company_id.street2}&lt;br/&gt;
          % endif
          % if object.company_id.city or object.company_id.zip:
              ${object.company_id.zip} ${object.company_id.city}&lt;br/&gt;
          % 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 ''}&lt;br/&gt;
          % endif
          &lt;/span&gt;
          % if object.company_id.phone:
              &lt;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; "&gt;
                  Phone:&amp;nbsp; ${object.company_id.phone}
              &lt;/div&gt;
          % endif
          % if object.company_id.website:
              &lt;div&gt;
                  Web :&amp;nbsp;&lt;a href="${object.company_id.website}"&gt;${object.company_id.website}&lt;/a&gt;
              &lt;/div&gt;
          %endif
          &lt;p&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
              </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}&lt;br /&gt;
         % endif
         | Your contact: ${object.validator.name} ${object.validator.user_email and '&lt;%s&gt;'%(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 '&lt;%s&gt;'%(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