small changes for the accounting voucher

* analytic line

bzr revid: mga@tinyerp.com-20081215084424-hve42x3bwdj49rs4
This commit is contained in:
Mantavya Gajjar
2008-12-15 14:14:24 +05:30
2 changed files with 2 additions and 5 deletions
+1
View File
@@ -832,6 +832,7 @@ class account_move(osv.osv):
if 'line_id' in vals:
c = context.copy()
c['novalidate'] = True
print 'XXXXXXXXXXXXXXXXXXX : ',vals
result = super(account_move, self).create(cr, uid, vals, c)
self.validate(cr, uid, [result], context)
else:
+1 -5
View File
@@ -207,7 +207,6 @@ class account_voucher(osv.osv):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
il['analytic_lines'] = [(0,0, {
'name': il['name'],
'date': inv['date'],
@@ -215,10 +214,9 @@ class account_voucher(osv.osv):
'amount': inv['amount'] * sign,
#'partner_id': il['partner_id'] or False,
'general_account_id': il['account_id'] or False,
'journal_id': self._get_journal(cr, uid, inv.type),
'journal_id': self.pool.get('account.voucher').browse(cr, uid, id).journal_id.analytic_journal_id.id or False,
'ref': ref,
})]
return iml
def action_move_line_create(self, cr, uid, ids, *args):
@@ -249,7 +247,6 @@ class account_voucher(osv.osv):
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['amount']
else:
i['amount_currency'] = False
i['currency_id'] = False
@@ -295,7 +292,6 @@ class account_voucher(osv.osv):
for i in line:
i[2]['period_id'] = inv.period_id.id
move_id = self.pool.get('account.move').create(cr, uid, move)
# make the invoice point to that move
self.write(cr, uid, [inv.id], {'move_id': move_id})
obj=self.pool.get('account.move').browse(cr,uid,move_id)
for line in obj.line_id :