bugfixes:

* 'account.move': trying to create one without 'name'
  * 'account.move.line': trying to create one without 'currency_id'

bzr revid: olt@tinyerp.com-20081215104124-ah9j16sqrvozi7cc
This commit is contained in:
Olivier Laurent 2008-12-15 11:41:24 +01:00
parent 66e156ea5c
commit cbce9e585d
3 changed files with 9 additions and 1 deletions

View File

@ -850,6 +850,7 @@ class account_move_line(osv.osv):
if journal.analytic_journal_id:
vals['analytic_lines'] = [(0,0, {
'name': vals['name'],
'currency_id': account.company_id.currency_id.id,
'date': vals.get('date', time.strftime('%Y-%m-%d')),
'account_id': vals['analytic_account_id'],
'unit_amount':'quantity' in vals and vals['quantity'] or 1.0,
@ -860,6 +861,10 @@ class account_move_line(osv.osv):
})]
else:
raise osv.except_osv(_('No analytic journal !'), _('Please set an analytic journal on this financial journal !'))
#if not 'currency_id' in vals:
# vals['currency_id'] = account.company_id.currency_id.id
result = super(osv.osv, self).create(cr, uid, vals, context)
# CREATE Taxes
if 'account_tax_id' in vals and vals['account_tax_id']:

View File

@ -616,6 +616,10 @@ class account_invoice(osv.osv):
move['period_id'] = period_id
for i in line:
i[2]['period_id'] = period_id
if not 'name' in move:
move['name'] = inv.name
move_id = self.pool.get('account.move').create(cr, uid, move)
new_move_name = self.pool.get('account.move').browse(cr, uid, move_id).name
# make the invoice point to that move

View File

@ -60,7 +60,6 @@ def _pay_and_reconcile(self, cr, uid, data, context):
ctx = {'date':data['form']['date']}
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
# Take the choosen date
if form.has_key('comment'):
context={'date_p':form['date'],'comment':form['comment']}