From 7856ace733e35c36d06d700a8cb086d35ff2d67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najla=C3=A2=20EL=20KHAYAT?= Date: Wed, 1 Apr 2009 16:29:11 +0200 Subject: [PATCH] [FIX] Name of user in employees timesheet bzr revid: nel@tinyerp.com-20090401142911-n0f6pil2r71dr973 --- addons/account/account.py | 13 ++++++++++--- addons/hr_timesheet/report/users_timesheet.xsl | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index a515423c957..e8574f61590 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1298,7 +1298,7 @@ class account_tax(osv.osv): res.append(tax) return res - def _unit_compute(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None): + def _unit_compute(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None, quantity=0): taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner) res = [] @@ -1327,7 +1327,12 @@ class account_tax(osv.osv): data['amount'] = amount elif tax.type=='fixed': + print "her", quantity + print "data", data data['amount'] = tax.amount + data['tax_amount']=quantity + print "DATA 2", data + # data['amount'] = quantity elif tax.type=='code': address = address_id and self.pool.get('res.partner.address').browse(cr, uid, address_id) or None localdict = {'price_unit':cur_price_unit, 'address':address, 'product':product, 'partner':partner} @@ -1343,7 +1348,7 @@ class account_tax(osv.osv): if tax.child_depend: latest = res.pop() amount = amount2 - child_tax = self._unit_compute(cr, uid, tax.child_ids, amount, address_id, product, partner) + child_tax = self._unit_compute(cr, uid, tax.child_ids, amount, address_id, product, partner, quantity) res.extend(child_tax) if tax.child_depend: for r in res: @@ -1361,6 +1366,7 @@ class account_tax(osv.osv): latest[name+'_code_id'] = False if tax.include_base_amount: cur_price_unit+=amount2 + print "rress final", res return res def compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): @@ -1373,7 +1379,8 @@ class account_tax(osv.osv): tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} one tax for each tax id in IDS and their childs """ - res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner) + res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity) + print "res",res total = 0.0 for r in res: if r.get('balance',False): diff --git a/addons/hr_timesheet/report/users_timesheet.xsl b/addons/hr_timesheet/report/users_timesheet.xsl index 7f4110b7c90..f229641c837 100644 --- a/addons/hr_timesheet/report/users_timesheet.xsl +++ b/addons/hr_timesheet/report/users_timesheet.xsl @@ -86,7 +86,7 @@ - +