Comment 2 for bug 1076363

Revision history for this message
D Verhelst (dimitriverhelst) wrote :

Hi Amit,

tried your update, and also updated other two fields:

        if 'line_id' in vals:
            c = context.copy()
            c['novalidate'] = True
            c['period_id'] = vals.get('period_id')
            c['journal_id'] = vals.get('journal_id')
            c['date'] = vals.get('date')
            result = super(account_move, self).create(cr, uid, vals, c)
            self.validate(cr, uid, [result], context)
        else:
            result = super(account_move, self).create(cr, uid, vals, context)
        return result

now I get a much cleaner warning:

Error!
No period found or more than one period found for the given date.

however, I do have exactly one period open for the given date...