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...
Hi Amit,
tried your update, and also updated other two fields:
if 'line_id' in vals:
c[ 'novalidate' ] = True
c[ 'period_ id'] = vals.get( 'period_ id')
c[ 'journal_ id'] = vals.get( 'journal_ id')
c[ 'date'] = vals.get('date')
self. validate( cr, uid, [result], context)
c = context.copy()
result = super(account_move, self).create(cr, uid, vals, c)
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...