Odoo Help


Extending sale.order in v8.

Kit Sunde
on 8/22/14, 5:18 PM 1,084 views

I'm trying to extend the sale.order model to have a relation with an email chain model I've created in my custom module. So I created this:


    class sales_order_email_field(osv.Model):
        _name = 'sale.order'
        _inherit = 'sale.order'
        _columns = {
            'email_chain': fields.many2one(
                'Email Chain',


and in my XML:

    <record id="view_res_sale_line_email_chain_form" model="ir.ui.view">
          <field name="name">sale.order.form.inherit</field>
          <field name="model">sale.order</field>
          <field name="type">form</field>
          <field name="priority" eval="8"/>
          <field name="inherit_id" ref="sale.view_order_form"/>
          <field name="arch" type="xml">
                  <xpath expr="//field[@name='product_uom_qty']"
                      <field name="email_chain"/>

Buy I get an error message:

    Error details: Field `email_chain` does not exist

What am I doing wrong?

Hi, Just make sure that your .py file is imported into __init__.py file. And then just install / upgrade your custom module.

Emipro Technologies Pvt. Ltd.
on 8/23/14, 1:16 AM

The python file is loaded.

Kit Sunde
on 8/23/14, 12:55 PM

Gopakumar N G

--Gopakumar N G--
| 5 4 7
Cochin, India
--Gopakumar N G--

Project Lead at Bizweaver Technologies Pvt. Ltd.

Gopakumar N G
On 8/23/14, 1:28 AM

You have created the field email_chain in sale.order model and adding it in the sale.order.line models view. For using your new field in the sale order's product line it must be created in sale.orderl.line model.

Sry, but in this case the error message is why: Error details: Field `email_chain` does not exist? In my opinion this trouble is coming from lack the field, not?

on 8/23/14, 1:54 AM

Ah that makes a lot of sense, my xpath was targeting the Order Line that's inline of the sales order, so the active model wasn't actually the sale order. Thanks.

Kit Sunde
on 8/24/14, 5:54 AM
On 8/23/14, 1:10 AM

Please try to restart the server, and reinstall your custom modul. Your field is not exists in sale_order model.

I tried that, I'm getting the same error.

Kit Sunde
on 8/23/14, 12:54 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 8/22/14, 5:18 PM
Seen: 1084 times
Last updated: 2/29/16, 2:41 AM