[MERGE] lp: 800767

bzr revid: qdp-launchpad@openerp.com-20111018102043-g6aumdne9odh17wa
This commit is contained in:
Quentin (OpenERP) 2011-10-18 12:20:43 +02:00
commit c736d4a773
1 changed files with 4 additions and 3 deletions

View File

@ -2160,12 +2160,13 @@ class account_model(osv.osv):
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_date = context.get('date', time.strftime('%Y-%m-%d'))
move_date = datetime.strptime(move_date,"%Y-%m-%d")
for model in self.browse(cr, uid, ids, context=context):
try:
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
entry['name'] = model.name%{'year': move_date.strftime('%Y'), 'month': move_date.strftime('%m'), 'date': move_date.strftime('%Y-%m')}
except:
raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
@ -2186,7 +2187,7 @@ class account_model(osv.osv):
'analytic_account_id': analytic_account_id
}
date_maturity = time.strftime('%Y-%m-%d')
date_maturity = context.get('date',time.strftime('%Y-%m-%d'))
if line.date_maturity == 'partner':
if not line.partner_id:
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term!" \