Reputation: 1055
I added two fields in purchase order line. It works properly and save but when I confirm the order it raises the error like
AttributeError: "Field 'product_tunch' does not exist in object 'browse_record(purchase.order, 23)'"
Here the field was added successfully but why am I getting an error when I confirm the purchase order and below is my field
_columns={
'product_tunch':fields.float('Tunch', digits_compute= dp.get_precision('price_subtotal')),
'product_kt':fields.selection([('14kt','14 KT'), ('18kt','18 KT'), ('20kt','20 KT')
, ('22kt','22 KT'), ('24kt','24 KT')], 'Type',
size=32,),
and my function is
def _amount_line(self, cr, uid, ids, prop, arg, context=None):
res = {}
cur_obj=self.pool.get('res.currency')
tax_obj = self.pool.get('account.tax')
for line in self.browse(cr, uid, ids, context=context):
taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id, line.product_pc, line.order_id.partner_id)
cur = line.order_id.pricelist_id.currency_id
res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
res[line.id]=(line.price_unit *line.product_qty*(line.product_tunch/100))
return res
and my view file is
<record id="view_purchase_inherit_form" model="ir.ui.view">
<field name="name">purchase.inherit.form</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purcahse.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='taxes']" position="before">
<field name="product_tunch"/>
<field name="product_kt"/>
</xpath>
</data>
</field>
</record>
Upvotes: 0
Views: 2487
Reputation: 3
You can try to start your server once using this syntax:
openerp-server -c path/to/your/conf.file -d your_database -u module_to_update
Upvotes: 0
Reputation: 148
I haven't more ideas
Upvotes: 0