Starting openoffice_report from koo sets other parameters than GTK and WEB
Bug #531212 reported by
Ferdinand
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KDE OpenObject Client |
New
|
Undecided
|
Unassigned |
Bug Description
pls see
http://
a context issue ?
To post a comment you must log in.
I found this in account/partner.py osv.osv) : debit_get( self, cr, uid, ids, field_names, arg, context): get('account. move.line' )._query_ get(cr, uid, context=context)
cr.execute( ("""select
l.partner_ id, a.type, sum(l.debit- l.credit)
account_ move_line l
account_ account a on (l.account_id=a.id)
a.type in ('receivable' ,'payable' ) and
l.partner_ id in (%s) and
l.reconcile_ id is null and
l.partner_ id, a.type
class res_partner(
_name = 'res.partner'
_inherit = 'res.partner'
_description = 'Partner'
def _credit_
query = self.pool.
from
left join
where
""" % (','.join(map(str, ids)),))+query+"""
group by
""")
Koo produces this query
select
l.partner_ id, a.type, sum(l.debit- l.credit)
from
account_ move_line l
left join
account_ account a on (l.account_id=a.id)
where
a.type in ('receivable' ,'payable' ) and
l.partner_ id in (1296) and
l.reconcile_ id is null and
l.state< >'draft' AND l.period_id in (SELECT id from account_period WHERE fiscalyear_id in (1,2,3,4,6) AND l.move_id in (select id from account_move where account_move.state = 'draft') )
group by
l.partner_ id, a.type
GTK
l.partner_ id, a.type, sum(l.debit- l.credit)
from
account_ move_line l
left join
account_ account a on (l.account_id=a.id)
where
a.type in ('receivable' ,'payable' ) and
l.partner_ id in (1296) and
l.reconcile_ id is null and
l.state< >'draft' AND l.period_id in (SELECT id from account_period WHERE fiscalyear_id in (1,2,3,4,6) )
group by
l.partner_ id, a.type
select
the problem in Koo's query is this
**************
AND l.move_id in (select id from account_move where account_move.state = 'draft')
**************
IMHO this comes from the invoice which itself is in state draft but must not be applied to calculation of debit / credit.
after validating the invoice the balance is correct