From 49d05c86b239993504738e0a90847120f8993bde Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Tue, 25 Aug 2009 13:53:17 +0200 Subject: [PATCH 01/25] Fixes project field not being auto-filled when creating a delegated task. Refers to bug 418541 bzr revid: niels@bubbles-it.be-20090825115317-pjwbavye3lxj4fn7 --- addons/project/project_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index f130ec8b5c0..29c67ee640a 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -307,7 +307,7 @@ - + From 460f3102bc7d2edd13b8efc302bb585d5a7e079a Mon Sep 17 00:00:00 2001 From: "ACH(OpenERP)" <> Date: Wed, 2 Sep 2009 20:23:54 +0530 Subject: [PATCH 02/25] [FIX] Send Mail : Unicode error handled lp bug: https://launchpad.net/bugs/421162 fixed bzr revid: jvo@tinyerp.com-20090902145354-5b43k67lpbe513cj --- bin/tools/misc.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 7760a9a851d..d8bd58bfcbd 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -331,7 +331,10 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non email_bcc = [] if not attach: - msg = MIMEText(body.encode('utf-8') or '',_subtype=subtype,_charset='utf-8') + try: + msg = MIMEText(body.encode('utf8') or '',_subtype=subtype,_charset='utf-8') + except: + msg = MIMEText(body or '',_subtype=subtype,_charset='utf-8') else: msg = MIMEMultipart() @@ -362,8 +365,10 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non msg['Message-Id'] = "<%s-tinycrm-%s@%s>" % (time.time(), tinycrm, socket.gethostname()) if attach: - msg.attach( MIMEText(body.encode('utf-8') or '', _charset='utf-8', _subtype=subtype) ) - + try: + msg.attach(MIMEText(body.encode('utf8') or '',_subtype=subtype,_charset='utf-8')) + except: + msg.attach(MIMEText(body or '', _charset='utf-8', _subtype=subtype) ) for (fname,fcontent) in attach: part = MIMEBase('application', "octet-stream") part.set_payload( fcontent ) From 02fd0eb506ff822a8c09580be7f352d63f953ef0 Mon Sep 17 00:00:00 2001 From: "ACH,Jay" <> Date: Thu, 3 Sep 2009 18:19:28 +0530 Subject: [PATCH 03/25] [FIX] Translation issue with cache: it needed to restart server,SOLVED lp bug: https://launchpad.net/bugs/399208 fixed bzr revid: jvo@tinyerp.com-20090903124928-mbzr7ekxoo4sba49 --- bin/addons/base/ir/ir_translation.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bin/addons/base/ir/ir_translation.py b/bin/addons/base/ir/ir_translation.py index 68e9138479e..9bf6e0ae776 100644 --- a/bin/addons/base/ir/ir_translation.py +++ b/bin/addons/base/ir/ir_translation.py @@ -143,6 +143,33 @@ class ir_translation(osv.osv): res = cr.fetchone() trad = res and res[0] or '' return trad + + def create(self, cursor, user, vals, context=None): + if not context: + context = {} + ids = super(ir_translation, self).create(cursor, user, vals, context=context) + for trans_obj in self.read(cursor, user, [ids], ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + return ids + + def write(self, cursor, user, ids, vals, context=None): + if not context: + context = {} + result = super(ir_translation, self).write(cursor, user, ids, vals, context=context) + for trans_obj in self.read(cursor, user, ids, ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + return result + + def unlink(self, cursor, user, ids, context=None): + if not context: + context = {} + for trans_obj in self.read(cursor, user, ids, ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + result = super(ir_translation, self).unlink(cursor, user, ids, context=context) + return result ir_translation() From 9824b079bbf84fb01942d451de6e9a21f693283f Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Thu, 3 Sep 2009 16:00:45 +0200 Subject: [PATCH 04/25] [FIX] Problem when using hr_holidays Summary Report when entering date 1 jan 2009 for example. bzr revid: niels@bubbles-it.be-20090903140045-9cv5ty32g1rgsuih --- addons/hr_holidays/report/holidays_summary_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 589f97f2631..2f7c32933d2 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -130,7 +130,7 @@ class report_custom(report_rml): while day_diff1>0: if month+i<=12: - if day_diff1>30: + if day_diff1 > lengthmonth(year,i+month)+1: # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) date_xml += ['' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 From 2f216b53582b6b68e8753541bf1d989b4248809e Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Thu, 3 Sep 2009 17:16:18 +0200 Subject: [PATCH 05/25] [FIX] +1 on the lengthmonth returns was too much, removed it bzr revid: niels@bubbles-it.be-20090903151618-54w6ciiyr36e7z28 --- addons/hr_holidays/report/holidays_summary_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 2f7c32933d2..a7be0e2b51c 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -130,7 +130,7 @@ class report_custom(report_rml): while day_diff1>0: if month+i<=12: - if day_diff1 > lengthmonth(year,i+month)+1: # Not on 30 else you have problems when entering 01-01-2009 for example + if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) date_xml += ['' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 From a5488afe63cb97ab590286d4e39851567356056d Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Fri, 4 Sep 2009 11:03:10 +0530 Subject: [PATCH 06/25] [IMP]quality_integration_server: put max_limit in server connection bzr revid: hmo@tinyerp.com-20090904053310-djdif3t0fvehsh9e --- .../base_quality_interrogation.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 2df0af247c7..620edd7dade 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -34,6 +34,8 @@ import socket admin_passwd = 'admin' waittime = 10 +wait_count = 0 +wait_limit = 12 def start_server(root_path, port, addons_path): if root_path: @@ -47,19 +49,27 @@ def clean(): ps.close() if pid: os.kill(pid,9) - + def execute(connector, method, *args): + global wait_count res = False try: res = getattr(connector,method)(*args) except socket.error,e: - if e.args[0] == 111: + if e.args[0] == 111: + if wait_count > wait_limit: + print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit) + clean() + sys.exit(1) print 'Please wait %d sec to start server....'%(waittime) + wait_count += 1 time.sleep(waittime) res = execute(connector, method, *args) else: raise e - return res + wait_count = 0 + return res + def login(uri, dbname, user, pwd): conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/common') @@ -110,12 +120,13 @@ def check_quality(uri, user, pwd, dbname, modules): html += "" for x,y,detail in quality_result['check_detail_ids']: if detail.get('detail') != '': - test = detail.get('name') + msg = detail.get('message') + test = detail.get('name') score = round(float(detail.get('score',0)),2) html += "
  • %s (%.2f)
  • "%(test,test,score) detail_html +="

    %s (Score : %s)

    %s
    "%(test,test,score,detail.get('detail')) detail_html +='''Go to Top''' - test_detail[test] = (score,detail.get('detail','')) + test_detail[test] = (score,msg,detail.get('detail','')) html += "
    %s"%(detail_html) final[quality_result['name']] = (quality_result['final_score'],html,test_detail) From a45c87c780a7cf37b9e78ebe58768be8bfa5c167 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 4 Sep 2009 17:01:58 +0530 Subject: [PATCH 07/25] [IMP] hr_timesheet_invoice : Misleading string on invoice analytic entries' wizard bzr revid: jvo@tinyerp.com-20090904113158-8ddrqud1x55qiqoo --- .../hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 45205b03d2d..2b769cd1eae 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -184,7 +184,7 @@ class invoice_create(wizard.interface): _create_form = """ -
    + From 140aeda37334aef1e0c55448c3365d28b78eac67 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Fri, 4 Sep 2009 20:22:07 +0530 Subject: [PATCH 08/25] [FIX] Account :Residual amount unclear when used with partial payments. lp bug: https://launchpad.net/bugs/424214 fixed bzr revid: jvo@tinyerp.com-20090904145207-0vfhvnougdl2599q --- addons/account/invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index b3c5316b68f..df71775b59b 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -108,7 +108,7 @@ class account_invoice(osv.osv): to_pay = inv.amount_total for lines in inv.move_lines: paid_amt = paid_amt - lines.credit + lines.debit - res[inv.id] = to_pay - abs(paid_amt) + res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy'])) return res def _get_lines(self, cr, uid, ids, name, arg, context=None): @@ -892,7 +892,7 @@ class account_invoice(osv.osv): if l.account_id.id==src_account_id: line_ids.append(l.id) total += (l.debit or 0.0) - (l.credit or 0.0) - if (not total) or writeoff_acc_id: + if (not round(total,int(config['price_accuracy']))) or writeoff_acc_id: self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context) else: self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) From dac794192aecb0ffc3bfb8ae851ae8a370eb517e Mon Sep 17 00:00:00 2001 From: "GPA(Open ERP)" <> Date: Fri, 4 Sep 2009 20:37:37 +0530 Subject: [PATCH 09/25] [FIX] Project_gtd : Hierarchical timeboxes allowed to open lp bug: https://launchpad.net/bugs/422408 fixed bzr revid: jvo@tinyerp.com-20090904150737-1xth2slzfwek9ag1 --- addons/project_gtd/project_gtd_view.xml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index f093c49efcb..810868fba1d 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -129,6 +129,7 @@ project.gtd.timebox.treelist project.gtd.timebox tree + child_ids 50 @@ -137,11 +138,10 @@ - My Timeboxes project.gtd.timebox - [('user_id','=',uid)] + [('user_id','=',uid),('parent_id','=',False)] tree {'record_id':False} @@ -170,7 +170,7 @@ + + TimeBox + ir.actions.act_window + project.task + form + tree,form + [('timebox_id','child_of',[active_id])] + {'timebox_id':active_id} + + + + + Tasks by Timebox + + + From 17b31648406bf1eeee8bfc35fdb247f8092f8eb6 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Mon, 7 Sep 2009 12:13:46 +0530 Subject: [PATCH 10/25] [FIX] Project_gtd : Demo data defined for tasks(inboxes) bzr revid: jvo@tinyerp.com-20090907064346-5kpa8gxewjf6fwbg --- addons/project_gtd/project_gtd_demo.xml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/addons/project_gtd/project_gtd_demo.xml b/addons/project_gtd/project_gtd_demo.xml index 08a9d3cc2f2..ca59a1211fd 100644 --- a/addons/project_gtd/project_gtd_demo.xml +++ b/addons/project_gtd/project_gtd_demo.xml @@ -71,6 +71,39 @@ + + + 38.0 + 38.0 + + + + + + Specific adaptation to MRP + + + + 40 + 32.0 + 32.0 + + + + + In house training + + + 50 + 24.0 + 24.0 + + + + + Validation + latest modifications. + + From fb6b27b56c0bf109b7a0d4b9df2e96dfc56657d2 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 7 Sep 2009 12:24:08 +0530 Subject: [PATCH 11/25] [FIX] Project_gtd : improved menuitems names to avoid user confusion,domain improved lp bug: https://launchpad.net/bugs/425257 fixed bzr revid: jvo@tinyerp.com-20090907065408-m33zrlfwgybknytl --- addons/project_gtd/project_gtd_view.xml | 6 +++--- addons/project_gtd/wizard/project_gtd_daily.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index 810868fba1d..13a3f1080bc 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -115,9 +115,9 @@ - Inbox Tasks + My Inbox project.task - [('user_id','=',uid),('timebox_id','=',False),('state','in',('open','draft'))] + [('user_id','=',uid),('state','in',('open','draft'))] {'gtd_sort':True} @@ -148,7 +148,7 @@ diff --git a/addons/project_gtd/wizard/project_gtd_daily.py b/addons/project_gtd/wizard/project_gtd_daily.py index 81f6731262a..3ead091e06b 100644 --- a/addons/project_gtd/wizard/project_gtd_daily.py +++ b/addons/project_gtd/wizard/project_gtd_daily.py @@ -42,7 +42,7 @@ class wiz_timebox_open(wizard.interface): domain = "[('user_id', '=', uid)]" value = { 'domain': domain, - 'name': 'Timebox', + 'name': 'My Daily Timebox', 'view_type': 'form', 'view_mode': view_type, 'res_model': 'project.gtd.timebox', From f6566b12b50a1fe4ca5bbe68b8eacd879b359dd3 Mon Sep 17 00:00:00 2001 From: "VRA,JVO" <> Date: Mon, 7 Sep 2009 12:39:31 +0530 Subject: [PATCH 12/25] [FIX] Account : Reports from Chart of Accounts were not considering contextual value of MOVE(draft,posted) lp bug: https://launchpad.net/bugs/403972 fixed bzr revid: jvo@tinyerp.com-20090907070931-1b8fwikmdi6xc3pt --- addons/account/report/account_balance.py | 1 + addons/account/report/general_ledger.py | 2 +- addons/account/report/general_ledger_landscape.py | 1 + addons/account/wizard/wizard_account_balance_report.py | 5 +++-- addons/account/wizard/wizard_general_ledger_report.py | 3 ++- addons/account_balance/report/account_balance.py | 5 +++-- addons/account_balance/report/account_balance_landscape.py | 5 +++-- .../account_balance/wizard/wizard_account_balance_report.py | 3 ++- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 6f34e9d092f..ebf12dd9b08 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -93,6 +93,7 @@ class account_balance(report_sxw.rml_parse): res={} result_acc=[] ctx = self.context.copy() + ctx['state'] = form['context'].get('state','all') ctx['fiscalyear'] = form['fiscalyear'] if form['state']=='byperiod' : ctx['periods'] = form['periods'][0][2] diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index ce42653cc58..534b4d52e67 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -188,6 +188,7 @@ class general_ledger(rml_parse.rml_parse): ## We will make the test for period or date ## We will now make the test # + ctx['state'] = form['context'].get('state','all') if form.has_key('fiscalyear'): ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] @@ -195,7 +196,6 @@ class general_ledger(rml_parse.rml_parse): ctx['date_from'] = form['date_from'] ctx['date_to'] = form['date_to'] ## - # self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) if account and account.child_consol_ids: # add ids of consolidated childs also of selected account diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index ef355526de3..c63c4281173 100644 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -188,6 +188,7 @@ class general_ledger_landscape(rml_parse.rml_parse): ## We will make the test for period or date ## We will now make the test # + ctx['state'] = form['context'].get('state','all') if form.has_key('fiscalyear'): ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index d8282ad440f..b7ff7c00922 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -79,7 +79,7 @@ account_fields = { } class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) if user.company_id: company_id = user.company_id.id @@ -91,7 +91,8 @@ class wizard_report(wizard.interface): data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) # data['form']['periods'] = periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) # data['form']['fiscalyear'] = False - data['form']['display_account']='bal_all' + data['form']['display_account'] = 'bal_all' + data['form']['context'] = context return data['form'] def _check_state(self, cr, uid, data, context): diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 82940bd3a16..b6b998e3bbd 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -130,7 +130,7 @@ def _check_state(self, cr, uid, data, context): class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) if user.company_id: company_id = user.company_id.id @@ -147,6 +147,7 @@ class wizard_report(wizard.interface): data['form']['landscape']=True data['form']['fiscalyear'] = False data['form']['amount_currency'] = True + data['form']['context'] = context return data['form'] states = { diff --git a/addons/account_balance/report/account_balance.py b/addons/account_balance/report/account_balance.py index 0f0e92d9ad1..4fe498ac147 100644 --- a/addons/account_balance/report/account_balance.py +++ b/addons/account_balance/report/account_balance.py @@ -401,7 +401,8 @@ class account_balance(report_sxw.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] - ctx['period_manner']=form['period_manner'] + ctx['period_manner'] = form['period_manner'] + ctx['state'] = form['context'].get('state','all') tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy()) if len(tmp): @@ -458,7 +459,7 @@ class account_balance(report_sxw.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] ctx['period_manner']=form['period_manner'] - + ctx['state'] = form['context'].get('state','all') tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy()) if len(tmp1): diff --git a/addons/account_balance/report/account_balance_landscape.py b/addons/account_balance/report/account_balance_landscape.py index 2638a628990..372fdf2c441 100644 --- a/addons/account_balance/report/account_balance_landscape.py +++ b/addons/account_balance/report/account_balance_landscape.py @@ -402,7 +402,8 @@ class account_balance_landscape(rml_parse.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] - ctx['period_manner']=form['period_manner'] + ctx['period_manner'] = form['period_manner'] + ctx['state'] = form['context'].get('state','all') tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy()) if len(tmp): @@ -461,7 +462,7 @@ class account_balance_landscape(rml_parse.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] ctx['period_manner']=form['period_manner'] - + ctx['state'] = form['context'].get('state','all') tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy()) if len(tmp1): diff --git a/addons/account_balance/wizard/wizard_account_balance_report.py b/addons/account_balance/wizard/wizard_account_balance_report.py index 0f3280cb553..327b6190383 100644 --- a/addons/account_balance/wizard/wizard_account_balance_report.py +++ b/addons/account_balance/wizard/wizard_account_balance_report.py @@ -133,7 +133,8 @@ def _check(self, cr, uid, data, context): class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): + data['form']['context'] = context fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') data['form']['fiscalyear']=[fiscalyear_obj.find(cr, uid)] # p_ids=pooler.get_pool(cr.dbname).get('account.period').search(cr,uid,[('fiscalyear_id','=',fiscalyear_obj.find(cr, uid))]) From b3d0c54ef7ccbde4b0501b3a5ef3e8ddec08567a Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Mon, 7 Sep 2009 14:06:32 +0530 Subject: [PATCH 13/25] [IMP]quality_integration_server : quality html log bzr revid: hmo@tinyerp.com-20090907083632-z6pte2jqhrayjj23 --- .../base_quality_interrogation.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 620edd7dade..48c2ef29278 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -117,17 +117,16 @@ def check_quality(uri, user, pwd, dbname, modules): html = '''''' html +="

    Module : %s

    "%(quality_result['name']) html += "

    Final score : %s

    "%(quality_result['final_score']) - html += "" - for x,y,detail in quality_result['check_detail_ids']: - if detail.get('detail') != '': - msg = detail.get('message') - test = detail.get('name') - score = round(float(detail.get('score',0)),2) - html += "
  • %s (%.2f)
  • "%(test,test,score) - detail_html +="

    %s (Score : %s)

    %s
    "%(test,test,score,detail.get('detail')) - detail_html +='''Go to Top''' - test_detail[test] = (score,msg,detail.get('detail','')) - html += "
    %s"%(detail_html) + html += "
    " + html += "
      " + for x,y,detail in quality_result['check_detail_ids']: + test = detail.get('name') + score = round(float(detail.get('score',0)),2) + html += "
    • %s
    • "%(test.replace(' ','-'),test) + detail_html +="

      %s (Score : %s)

      %s
      "%(test.replace(' ','-'),test,score,detail.get('detail')) + test_detail[test] = (score,detail.get('detail','')) + html += "
    %s"%(detail_html) + html += "
    " final[quality_result['name']] = (quality_result['final_score'],html,test_detail) fp = open('quality_log.pck','wb') @@ -138,7 +137,7 @@ def check_quality(uri, user, pwd, dbname, modules): else: print 'Login Failed...' clean() - sys.exit(1) + sys.exit(1) From dc8dd85fe1d7b89c56c04f3e9b97d88496343d1d Mon Sep 17 00:00:00 2001 From: "Christophe Chauvet(Syleam)" <> Date: Mon, 7 Sep 2009 15:59:47 +0530 Subject: [PATCH 14/25] [FIX] Export : Error solved while Exporting O2M records with None value of any field lp bug: https://launchpad.net/bugs/425430 fixed bzr revid: jvo@tinyerp.com-20090907102947-ne1p4q3mi1qz6gq7 --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 9838c6ba400..08086f5d49b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -497,7 +497,7 @@ class orm_template(object): for rr in r : if isinstance(rr.name, browse_record): rr = rr.name - dt+=rr.name+',' + dt += rr.name or '' + ',' data[fpos] = dt[:-1] break lines += lines2[1:] From c0adc624b51a8bfadea3092fbca96bc3e319ac0f Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Mon, 7 Sep 2009 18:40:12 +0200 Subject: [PATCH 15/25] [FIX] multi currency reconciliations on bank statements weren't properly displayed [FIX] multi currency payments weren't correctly computed on invoice's residual amount bzr revid: qdp@cyan-20090907164012-eufzzqls4gqlkbv6 --- addons/account/account_bank_statement.py | 17 ++++++++++++++++- addons/account/account_invoice_view.xml | 4 ++++ addons/account/invoice.py | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 0f6aca2f917..56c4ddba96e 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -213,6 +213,11 @@ class account_bank_statement(osv.osv): amount = res_currency_obj.compute(cr, uid, st.currency.id, company_currency_id, move.amount, context=context, account=acc_cur) + if st.currency.id <> company_currency_id: + amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, + st.currency.id, amount, context=context, + account=acc_cur) + val['amount_currency'] = -amount_cur if move.account_id and move.account_id.currency_id and move.account_id.currency_id.id <> company_currency_id: val['currency_id'] = move.account_id.currency_id.id @@ -430,7 +435,17 @@ class account_bank_statement_reconcile(osv.osv): def name_get(self, cursor, user, ids, context=None): res= [] for o in self.browse(cursor, user, ids, context=context): - res.append((o.id, '[%.2f]' % (o.total_entry - o.total_new,))) + result = 0.0 + res_currency = '' + for line in o.line_ids: + if line.amount_currency and line.currency_id: + result += line.amount_currency + res_currency = line.currency_id.code + else: + result += line.debit - line.credit + if res_currency: + res_currency = ' ' + res_currency + res.append((o.id, '[%.2f'% (result - o.total_new,) + res_currency + ']' )) return res _columns = { diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 5b06a40acb1..6d14f25427c 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -221,6 +221,8 @@ + +
    @@ -306,6 +308,8 @@ + + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index df71775b59b..ad38ff87e68 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -107,7 +107,10 @@ class account_invoice(osv.osv): paid_amt = 0.0 to_pay = inv.amount_total for lines in inv.move_lines: - paid_amt = paid_amt - lines.credit + lines.debit + if lines.amount_currency and lines.currency_id: + paid_amt += lines.amount_currency + else: + paid_amt += lines.credit + lines.debit res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy'])) return res From 1d420cae792728d6f0ce74bfe4c7ee76cfb4f587 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 8 Sep 2009 19:03:40 +0530 Subject: [PATCH 16/25] [FIX] Account : Context was missing in report lp bug: https://launchpad.net/bugs/426243 fixed bzr revid: jvo@tinyerp.com-20090908133340-z0xy8i6uouoff122 --- addons/account/report/overdue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/overdue.py b/addons/account/report/overdue.py index dca2f6aeff6..76ebbe7efa4 100644 --- a/addons/account/report/overdue.py +++ b/addons/account/report/overdue.py @@ -29,14 +29,14 @@ import pooler class Overdue(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(Overdue, self).__init__(cr, uid, name, context) + super(Overdue, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time' : time, 'adr_get' : self._adr_get, 'getLines' : self._lines_get, 'tel_get' : self._tel_get, }) - + self.context = context def _adr_get(self, partner, type): res = [] res_partner = pooler.get_pool(self.cr.dbname).get('res.partner') @@ -51,7 +51,7 @@ class Overdue(report_sxw.rml_parse): 'country_id' : False, } if adr_id: - result = res_partner_address.read(self.cr, self.uid, [adr_id]) + result = res_partner_address.read(self.cr, self.uid, [adr_id],context=self.context.copy()) result[0]['country_id'] = result[0]['country_id'] and result[0]['country_id'][1] or False return result From 776779e908176d65fe14695beb3bbc22bca17c21 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 11:17:02 +0530 Subject: [PATCH 17/25] [FIX] Report: context was missing while printing any report with header in a non-English Language bzr revid: jvo@tinyerp.com-20090909054702-2ea1ugshop9cdmr1 --- bin/report/report_sxw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index 539b8990485..1adca0b8176 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -156,7 +156,7 @@ class rml_parse(object): self.cr = cr self.uid = uid self.pool = pooler.get_pool(cr.dbname) - user = self.pool.get('res.users').browse(cr, uid, uid) + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) self.localcontext = { 'user': user, 'company': user.company_id, From d05666e33b0fe8c0de6dd05b78b4a4225f35ce35 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 11:55:05 +0530 Subject: [PATCH 18/25] Account : Taxname on Invoice Tax improved,.sxw file made compatible to .rml for invoice lp bug: https://launchpad.net/bugs/407290 fixed bzr revid: jvo@tinyerp.com-20090909062505-m7wzkbvv94ywt0q6 --- addons/account/account.py | 2 +- addons/account/report/invoice.rml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b4a14684a27..b6dd4bfb11b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1308,7 +1308,7 @@ class account_tax(osv.osv): # we compute the amount for the current tax object and append it to the result data = {'id':tax.id, - 'name':tax.name, + 'name':tax.description and tax.description + " - " + tax.name or tax.name, 'account_collected_id':tax.account_collected_id.id, 'account_paid_id':tax.account_paid_id.id, 'base_code_id': tax.base_code_id.id, diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index b2a65b73f33..902a9db3e06 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -366,7 +366,7 @@ [[ t.name ]] [[ formatLang(t.base) ]] - [[ t.tax_code_id.notprintable and removeParentNode('blockTable') or '' ]][[ formatLang(t.amount) ]] + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]][[ formatLang(t.amount) ]] From 5178b351ad630135e35fae97505a35998c183f6e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 17:50:25 +0530 Subject: [PATCH 19/25] [IMP] Account : Analytic Account report following parental relationship approach(account with all its children bzr revid: jvo@tinyerp.com-20090909122025-9v7y1mlpc8gbtsi7 --- .../project/report/analytic_balance.py | 250 ++++++++++++------ .../project/report/analytic_balance.rml | 26 +- .../wizard_account_analytic_balance_report.py | 8 +- 3 files changed, 187 insertions(+), 97 deletions(-) diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py index 341424984df..0c7b0cda761 100644 --- a/addons/account/project/report/analytic_balance.py +++ b/addons/account/project/report/analytic_balance.py @@ -30,17 +30,50 @@ class account_analytic_balance(report_sxw.rml_parse): super(account_analytic_balance, self).__init__(cr, uid, name, context) self.localcontext.update( { 'time': time, + 'get_objects': self._get_objects, 'lines_g': self._lines_g, - 'move_sum_debit': self._move_sum_debit, - 'move_sum_credit': self._move_sum_credit, - 'sum_debit': self._sum_debit, - 'sum_credit': self._sum_credit, + 'move_sum': self._move_sum, +# 'move_sum_debit': self._move_sum_debit, +# 'move_sum_credit': self._move_sum_credit, + 'sum_all': self._sum_all, +# 'sum_debit': self._sum_debit, +# 'sum_credit': self._sum_credit, 'sum_balance': self._sum_balance, - 'sum_quantity': self._sum_quantity, +# 'sum_quantity': self._sum_quantity, 'move_sum_balance': self._move_sum_balance, - 'move_sum_quantity': self._move_sum_quantity, +# 'move_sum_quantity': self._move_sum_quantity, }) + self.acc_ids = [] + self.read_data = [] + self.empty_acc = False + self.acc_data_dict = {}# maintains a relation with an account with its successors. + self.acc_sum_list = []# maintains a list of all ids + def get_children(self, ids): + ids2 = [] + read_data = self.pool.get('account.analytic.account').read(self.cr, self.uid, ids,['child_ids','code','complete_name','balance']) + for data in read_data: + if (data['id'] not in self.acc_ids): + inculde_empty = True + if (not self.empty_acc) and data['balance'] == 0.00: + inculde_empty = False + if inculde_empty: + self.acc_ids.append(data['id']) + self.read_data.append(data) + if data['child_ids']: + res = self.get_children(data['child_ids']) + return True + + + def _get_objects(self, empty_acc): + if self.read_data: + return self.read_data + self.empty_acc = empty_acc + self.read_data = [] + self.get_children(self.ids) + + return self.read_data + def _lines_g(self, account_id, date1, date2): account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid, @@ -68,93 +101,148 @@ class account_analytic_balance(report_sxw.rml_parse): r['credit'] = 0.0 return res - - def _move_sum_debit(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT sum(amount) \ - FROM account_analytic_line \ - WHERE account_id in ("+ ','.join(map(str, ids)) +") \ - AND date>=%s AND date<=%s AND amount>0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - - def _move_sum_credit(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT -sum(amount) \ - FROM account_analytic_line \ - WHERE account_id in ("+ ','.join(map(str, ids)) +") \ - AND date>=%s AND date<=%s AND amount<0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - - def _move_sum_balance(self, account_id, date1, date2): - debit = self._move_sum_debit(account_id, date1, date2) - credit = self._move_sum_credit(account_id, date1, date2) - return (debit-credit) - - def _move_sum_quantity(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT sum(unit_amount) \ - FROM account_analytic_line \ + def _move_sum(self, account_id, date1, date2, option): + if account_id not in self.acc_data_dict: + account_analytic_obj = self.pool.get('account.analytic.account') + ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) + self.acc_data_dict[account_id] = ids + else: + ids = self.acc_data_dict[account_id] + + if option == "credit" : + self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \ + WHERE account_id in ("+ ','.join(map(str, ids)) +") \ + AND date>=%s AND date<=%s AND amount<0", + (date1, date2)) + elif option == "debit" : + self.cr.execute("SELECT sum(amount) FROM account_analytic_line \ + WHERE account_id in ("+ ','.join(map(str, ids)) +") \ + AND date>=%s AND date<=%s AND amount>0", + (date1, date2)) + elif option == "quantity" : + self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \ WHERE account_id in ("+ ','.join(map(str, ids)) +") \ AND date>=%s AND date<=%s", (date1, date2)) return self.cr.fetchone()[0] or 0.0 - - - def _sum_debit(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) - if not len(ids): - return 0.0 - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT sum(amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s AND amount>0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - def _sum_credit(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) + +# def _move_sum_debit(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s AND amount>0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# +# def _move_sum_credit(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT -sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s AND amount<0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# + def _move_sum_balance(self, account_id, date1, date2): + debit = self._move_sum(account_id, date1, date2, 'debit') + credit = self._move_sum(account_id, date1, date2, 'credit') + return (debit-credit) + +# def _move_sum_quantity(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT sum(unit_amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 + + def _sum_all(self, accounts, date1, date2, option): + ids = map(lambda x: x['id'], accounts) + if not len(ids): return 0.0 - ids = map(lambda x: x.id, accounts) - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT -sum(amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s AND amount<0", - (date1, date2)) + + if not self.acc_sum_list: + account_analytic_obj = self.pool.get('account.analytic.account') + ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)]) + self.acc_sum_list = ids2 + else: + ids2 = self.acc_sum_list + + if option == "debit" : + self.cr.execute("SELECT sum(amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s AND amount>0", + (date1, date2)) + elif option == "credit" : + self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s AND amount<0", + (date1, date2)) + elif option == "quantity" : + self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s", + (date1, date2)) return self.cr.fetchone()[0] or 0.0 + +# def _sum_debit(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s AND amount>0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# +# def _sum_credit(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# ids = map(lambda x: x['id'], accounts) +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT -sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s AND amount<0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 + def _sum_balance(self, accounts, date1, date2): - debit = self._sum_debit(accounts, date1, date2) or 0.0 - credit = self._sum_credit(accounts, date1, date2) or 0.0 + debit = self._sum_all(accounts, date1, date2, 'debit') or 0.0 + credit = self._sum_all(accounts, date1, date2, 'credit') or 0.0 return (debit-credit) - def _sum_quantity(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) - if not len(ids): - return 0.0 - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT sum(unit_amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 +# def _sum_quantity(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT sum(unit_amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 report_sxw.report_sxw('report.account.analytic.account.balance', 'account.analytic.account', 'addons/account/project/report/analytic_balance.rml', diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 1e420418a4e..a9b39e49cc5 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -45,7 +45,7 @@ - + @@ -130,45 +130,45 @@ - [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] - [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] - [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]]
    - [[ repeatIn(objects,'o') ]] + [[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]] - [[ o.code ]] + [[ o['code'] ]] - [[ o.complete_name ]] + [[ o['complete_name'] ]] - [[ formatLang(move_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'debit')) ]] - [[ formatLang(move_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'credit')) ]] - [[ formatLang(move_sum_balance(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang(move_sum_quantity(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'quantity')) ]] - [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] + [[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]] [[ move_g['code'] ]] diff --git a/addons/account/project/wizard/wizard_account_analytic_balance_report.py b/addons/account/project/wizard/wizard_account_analytic_balance_report.py index bb487517354..57c9353ceeb 100644 --- a/addons/account/project/wizard/wizard_account_analytic_balance_report.py +++ b/addons/account/project/wizard/wizard_account_analytic_balance_report.py @@ -24,14 +24,16 @@ import time import wizard dates_form = ''' - + + ''' dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'date1': {'string':'Start of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, + 'date2': {'string':'End of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'empty_acc': {'string':'Empty Accounts ? ', 'type':'boolean', 'help':'Check if you want to display Accounts with 0 balance too.'}, } From 01c96820dbaf5a75db5a199f228705fda76152bd Mon Sep 17 00:00:00 2001 From: Jeroen van der Waal <> Date: Thu, 10 Sep 2009 14:42:54 +0530 Subject: [PATCH 20/25] [FIX]Fixed Partial deliveries problem lp bug: https://launchpad.net/bugs/399817 fixed bzr revid: hda@tinyerp.com-20090910091254-2xzcrzdvmgcigfmt --- addons/sale/sale.py | 19 ++++++++++++++++--- addons/stock/stock.py | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8afb332bc7d..1492143a7d0 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -492,7 +492,7 @@ class sale_order(osv.osv): if line.procurement_id: res.append(line.procurement_id.id) return res - + # if mode == 'finished': # returns True if all lines are done, False otherwise # if mode == 'canceled': @@ -504,9 +504,22 @@ class sale_order(osv.osv): notcanceled = False write_done_ids = [] write_cancel_ids = [] + stock_move_obj = self.pool.get('stock.move') + for order in self.browse(cr, uid, ids, context={}): - for line in order.order_line: - if (not line.procurement_id) or (line.procurement_id.state=='done'): + + #check for pending deliveries + pending_deliveries = False + + for line in order.order_line: + move_ids = stock_move_obj.search(cr, uid, [('sale_line_id','=', line.id)]) + for move in stock_move_obj.browse( cr, uid, move_ids ): + #if one of the related order lines is in state draft, auto or confirmed + #this order line is not yet delivered + if move.state in ('draft', 'auto', 'confirmed'): + pending_deliveries = True + + if ((not line.procurement_id) or (line.procurement_id.state=='done')) and not pending_deliveries: finished = True if line.state != 'done': write_done_ids.append(line.id) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2a372d4eeed..039dfdd99fd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1135,6 +1135,11 @@ class stock_move(osv.osv): if move.state in ('confirmed', 'waiting'): res = self.pool.get('stock.location')._product_reserve(cr, uid, [move.location_id.id], move.product_id.id, move.product_qty, {'uom': move.product_uom.id}) if res: + #_product_available_test depends on the next status for correct functioning + #the test does not work correctly if the same product occurs multiple times + #in the same order. This is e.g. the case when using the button 'split in two' of + #the stock outgoing form + self.write(cr, uid, move.id, {'state':'assigned'}) done.append(move.id) pickings[move.picking_id.id] = 1 r = res.pop(0) From d4e9825ce637aca71b106bcfc455a471de9e44e8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 10 Sep 2009 18:18:05 +0530 Subject: [PATCH 21/25] [FIX] l10n_ch : default_value() of res.partner.bank corrected lp bug: https://launchpad.net/bugs/426831 fixed bzr revid: jvo@tinyerp.com-20090910124805-u2dgm48hxk0b79by --- addons/l10n_ch/partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ch/partner.py b/addons/l10n_ch/partner.py index 5f3584563be..4dc9656826c 100755 --- a/addons/l10n_ch/partner.py +++ b/addons/l10n_ch/partner.py @@ -69,7 +69,7 @@ class res_partner_bank(osv.osv): if address['type'] == 'default': return address.get(field,False) elif not address['type']: - value = address[field] + value = address.get(field,False) else : value = False return value From 322a34009dc317eec8ff81e2e49ccbb57ac018f3 Mon Sep 17 00:00:00 2001 From: "Niels(Rrd15)" <> Date: Fri, 11 Sep 2009 14:47:12 +0530 Subject: [PATCH 22/25] [FIX] Project : task work behavior towards task hours corrected lp bug: https://launchpad.net/bugs/427388 fixed bzr revid: jvo@tinyerp.com-20090911091712-w5oi9z2wnjvuvb2j --- addons/project/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 72a7958e921..cc885eb5d95 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -433,8 +433,9 @@ class project_work(osv.osv): def write(self, cr, uid, ids,vals,context={}): if 'hours' in vals and (not vals['hours']): vals['hours'] = 0.00 - for work in self.browse(cr, uid, ids, context): - cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) + if 'hours' in vals: + for work in self.browse(cr, uid, ids, context): + cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) return super(project_work,self).write(cr, uid, ids, vals, context) def unlink(self, cr, uid, ids, *args, **kwargs): From d536112575d7f71320089485f19dd0a8c6f3323e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 19:42:19 +0530 Subject: [PATCH 23/25] [FIX] Project : Taks hours computed accurately. bzr revid: jvo@tinyerp.com-20090911141219-2i0wlal54ciqx975 --- addons/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index cc885eb5d95..aaf16082792 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -280,7 +280,7 @@ class task(osv.osv): 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'), 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."), - 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), + 'remaining_hours': fields.float('Remaining Hours', digits=(16,4), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."), 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True, help="Computed as: Time Spent / Total Time."), 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as: Total Time - Estimated Time. It gives the difference of the time estimated by the project manager and the real time to close the task."), From c6e801a2d1414460f99e910a42767d9fd0db99bb Mon Sep 17 00:00:00 2001 From: "ACH(OpenERP)" <> Date: Fri, 11 Sep 2009 19:52:57 +0530 Subject: [PATCH 24/25] [FIX] hr_timesheet_sheet : Rounding value problem in float_time widget lp bug: https://launchpad.net/bugs/424177 fixed bzr revid: jvo@tinyerp.com-20090911142257-s8prbnz3lgymqsvu --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 9d8bdb1ba64..3fbf615ad18 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -576,7 +576,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv): sheet_id, total_timesheet, total_attendance, - (total_attendance - total_timesheet) AS total_difference + round(cast((total_attendance - total_timesheet) as Numeric),2) AS total_difference FROM (( SELECT From a4fbd2e0ffe239d3413c2aee9203565e06bbf7c8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 21:01:07 +0530 Subject: [PATCH 25/25] [FIX] Account : Making account.invoice.tax field language-depenant from account.tax lp bug: https://launchpad.net/bugs/407293 fixed bzr revid: jvo@tinyerp.com-20090911153107-r8dw1nf94xuyllmy --- addons/account/invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index ad38ff87e68..be9b4f63246 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -429,8 +429,9 @@ class account_invoice(osv.osv): ait_obj = self.pool.get('account.invoice.tax') for id in ids: cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) - partner = self.browse(cr, uid, id).partner_id - context.update({'lang': partner.lang}) + partner = self.browse(cr, uid, id,context=context).partner_id + if partner.lang: + context.update({'lang': partner.lang}) for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) # Update the stored value (fields.function), so we write to trigger recompute