跳至内容
菜单
此问题已终结
2936 查看

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

yup. restart before update. whichever.