Comment 2 for bug 1174650

Revision history for this message
Carlos Pueyo (cpueyo) wrote :

Hello!

I did a patch for it :)

Before create or write the hr_analytic_timesheet, check if the values of the line is changed.

        # We check the state of the sheet
        estado = self._check_sheet_state(cr, uid, ids)
        # if estado is False, the sheet is confirmed or done
        if estado is False:
            # We test if the values are changed
            if vals:
                raise osv.except_osv(_('Error!'),
                    _('You cannot modify an entry in a Confirmed/Done timesheet!'))
            else:
                # If no values are changed, we clean the ids, for not do validation
                ids = []

        return super(hr_analytic_timesheet, self).write(cr, uid, ids, vals, *args, **argv)