Starting openoffice_report from koo sets other parameters than GTK and WEB

Bug #531212 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
New
Undecided
Unassigned

Bug Description

Revision history for this message
Ferdinand (office-chricar) wrote :

I found this in account/partner.py
class res_partner(osv.osv):
    _name = 'res.partner'
    _inherit = 'res.partner'
    _description = 'Partner'
    def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
        query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
        cr.execute(("""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 (%s) and
                l.reconcile_id is null and
                """ % (','.join(map(str, ids)),))+query+"""
            group by
                l.partner_id, a.type
            """)

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
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) )
                    group by
                        l.partner_id, a.type

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

Revision history for this message
Ferdinand (office-chricar) wrote :
Revision history for this message
Ferdinand (office-chricar) wrote :

Now we created a report with report-openoffice and almost everything looks OK, but sums are not calculated correctly

It would be helpful if you could guide me to the code where I can place a "print >> sys.stderr ...." to see which (different) context/paramters the OpenERP Server receives from Koo and GTK/Web.

I am a bit worried that also the output from other reports generated from Koo might be different from what is generated by GTK/Web without being detected.

thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.