Hello,
I need your help. That take 2 days that I work on the inheritance of the "_amount_all" function for add my shipping price value. But, my modification are not effective. Nothing happen, when I update the price.
Iuse openERP7 on Debian.
custom_achat.py
class purchase_order(osv.osv):
_name='purchase.order'
_inherit='purchase.order'
_columns = {
'frais':fields.float('Frais')
}
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
res = super(purchase_order, self)._amount_all(cr, uid, ids, field_name, arg, context)
res[purchase.id] += 5
return res
custom_achat_viex.xml
<record model="ir.ui.view" id="purchase_order_form_inherit">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="amount_untaxed" position="before">
<field name="frais"/>
</field>
</field>
</record>