Odoo Help

Welcome!

This community 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.

0

Module works fine in one database but not in another!

By
omadegbo
on 7/25/13, 11:08 AM 497 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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