I'm trying to add a new field 'Shipping' to Sale Order Line. Here's my code {v7]:
sales_quote.py:
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import time
from openerp import pooler
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP, float_compare
import openerp.addons.decimal_precision as dp
from openerp import netsvc
import openerp.addons.sale
class sale_order(osv.Model):
_name='sale.order'
_inherit='sale.order'
_columns={
'shipng':fields.float('Shipping'),
}
sale.order()
sales_quote_view.xml:
<openerp>
<data>
<record model="ir.ui.view" id="moleac_quotation_form_view">
<field name="name">Sale New Quotation</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='price_unit']" position="after">
<field name="shipng"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
UPDATE: The above code installed. But, when I click on 'form view' in 'Sales->Quotations', error:
ERROR ERP_demo openerp.osv.orm: Can't find field 'shipng' in the following view parts composing the view of object model 'sale.order':
* Quotation Inherited View
Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model
2013-08-05 07:27:57,663 11349 ERROR ERP_demo openerp.netsvc: View error
Can't find field 'shipng' in the following view parts composing the view of object model 'sale.order':
* Quotation Inherited View
Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model
Traceback (most recent call last):
File "/home/naveen/eclipseworkspace/openerp-7.0-20130623-231037/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home/naveen/eclipseworkspace/openerp-7.0-20130623-231037/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/home/naveen/eclipseworkspace/openerp-7.0-20130623-231037/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/naveen/eclipseworkspace/openerp-7.0-20130623-231037/openerp/osv/osv.py", line 144, in wrapper
raise except_osv(inst.name, inst.value)
except_osv: ('View error', u"Can't find field 'shipng' in the following view parts composing the view of object model 'sale.order':\n * Quotation Inherited View\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model")
2013-08-05 07:27:57,665 11349 INFO ERP_demo werkzeug: 127.0.0.1 - - [05/Aug/2013 07:27:57] "POST /web/dataset/call_kw HTTP/1.1" 200 -