I'm using Odoo 8 and for some reason a field which actually exists isn't found. In my XML file the following code
<field name="amount_tax" position="after">
<field name="delivery_cost"
options="{'currency_field': 'currency_id'}"
readonly="1" widget="monetary"/>
</field>
Gives the error that "delivery_cost" isn't found, though in sale.py it exists
_columns = {
'xx_delivery_date': fields.date(string='Delivery date'),
'xx_payment_method': fields.many2one('xx.payment.method',
string='Payment method'),
'xx_warranty_period': fields.many2one('xx.warranty.period',
string='Warranty period'),
'xx_delivery_method': fields.many2one('xx.delivery.method',
string='Delivery method'),
'delivery_cost': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Delivery cost',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line', 'xx_delivery_method'], 10),
},
multi='sums', help="The delivery cost.", track_visibility='always'),
'amount_untaxed': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Untaxed Amount',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The amount without tax.", track_visibility='always'),
'amount_tax': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Taxes',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The tax amount."),
'amount_total': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Total',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line', 'xx_delivery_method'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The total amount.")
I don't see why the field can't be found and have been looking for quite some time :/