Hello Every one... In Odoo 8 ,
Expense I have a field Budget whose value is coming from onchange, now
what I want is when amount i.e total expense exceeds budget amount it
should throw popup and that entry should not be saved.
There is no create or write function in hr_expense_expense(osv.osv) in odoo 8. But only function I think that can do needfull is as below , but how to call that before save button click.
def _amount(self, cr, uid, ids, field_name, arg, context=None):
res= {}
for expense in self.browse(cr, uid, ids, context=context):
total = 0.0
for line in expense.line_ids:
total += line.unit_amount * line.unit_quantity
res[expense.id] = total
return res
Create and write will be available for all models. Just inherit the model and super write method