Odoo Help

0

Module works fine in one database but not in another!

By
omadegbo
on 7/25/13, 11:08 AM 597 views

I have module to display date selection in the search area of the sales order line view. It works in one database and it doesn't work in another.. Am confused because it's working with one database.

Here is the error:

The xml code:

<openerp> <data>

    <record id="view_sale_orderlinedate" model="ir.ui.view">
        <field name="name">sale.order.line.dateinherit</field>
        <field name="model">sale.order.line</field>
        <field name="type">tree</field>
        <field name="inherit_id" ref="sale.view_order_line_tree"/>
        <field name="arch" type="xml">
            <field name="order_id" position="after">
                        <field name="ordered_date" />
                        </field>
            </field>

    </record>

    <record id="view_sale_orderlinedate2" model="ir.ui.view">
        <field name="name">sale.order.line.dateinherit2</field>
        <field name="model">sale.order.line</field>
        <field name="type">search</field>
        <field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
        <field name="arch" type="xml">



          <field name="salesman_id" position="after">  
                        <field name="due_date_from" filter_domain="[('ordered_date','>=',self)]"/>
                        <field name="due_date_to" filter_domain="[('ordered_date','<=',self)]"/>
          </field>
        </field> 
    </record>

</data>

</openerp>

from osv import fields, osv
class sales_invoice_date(osv.osv):
_name='sale.order.line'
_inherit='sale.order.line'
_columns={
    'ordered_date': fields.related('order_id', 'date_order', type='date', relation='sale.order', select= 1, string='Date Ordered'),
    'due_date_from':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date from"),
    'due_date_to':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date to"),

}

sales_invoice_date()

Try to update the module in the DB that does not work, and restart openERP

Thierry Godin
on 7/25/13, 11:27 AM

yup. restart before update. whichever.

odimegwu david
on 7/25/13, 6:43 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.

Register

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

0 follower(s)

Stats

Asked: 7/25/13, 11:08 AM
Seen: 597 times
Last updated: 3/16/15, 8:10 AM