From 310536424921bb276c0bb24cfe31ba831467496d Mon Sep 17 00:00:00 2001 From: husen daudi Date: Mon, 9 Feb 2009 13:17:57 +0530 Subject: [PATCH 01/11] Bugfix by pso lp bug: https://launchpad.net/bugs/326150 fixed bzr revid: hda@hda-20090209074757-hmkjgmvww08iq0e9 --- addons/wiki/wiki_view.xml | 6 ++++++ addons/wiki/wizard/__init__.py | 1 + addons/wiki/wizard/open_page.py | 2 -- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 7a8d17e47e4..9c6df8b9c17 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -11,6 +11,12 @@ menu="True" name="wiki.create.menu"/> + + wiki.groups.tree wiki.groups diff --git a/addons/wiki/wizard/__init__.py b/addons/wiki/wizard/__init__.py index 9781f14bf59..9e1135a08be 100644 --- a/addons/wiki/wizard/__init__.py +++ b/addons/wiki/wizard/__init__.py @@ -1,3 +1,4 @@ +import open_page import create_menu import show_diff import make_index diff --git a/addons/wiki/wizard/open_page.py b/addons/wiki/wizard/open_page.py index a41b1c22462..01987a0a072 100644 --- a/addons/wiki/wizard/open_page.py +++ b/addons/wiki/wizard/open_page.py @@ -31,8 +31,6 @@ from tools.translate import _ class wiz_timesheet_open(wizard.interface): def _open_wiki_page(self, cr, uid, data, context): - print "uid: %r" % (uid,) - print "data: %r" % (data,) pool = pooler.get_pool(cr.dbname) menu_id = data['id'] group_ids = pool.get('wiki.groups.link').search(cr, uid, [('action_id','=',menu_id)]) From d78d88cd72bb9260fe00976ae81de3baf20f8337 Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 9 Feb 2009 12:45:21 +0100 Subject: [PATCH 02/11] [FIX] unhandled multi selection of entries in wizard hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py lp bug: https://launchpad.net/bugs/327120 fixed bzr revid: qdp@tinyerp.com-20090209114521-723c5n6yykyde79k --- .../wizard/hr_timesheet_invoice_create.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 85d2c0771cd..fd5201b62bc 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -128,7 +128,10 @@ class invoice_create(wizard.interface): # # Compute for lines # - cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN (%s) AND product_id=%s and to_invoice=%s", (account.id, ','.join(map(str,data['ids'])), product_id, factor_id)) + str_ids="" + for x in data['ids']: + str_ids += ','.join(str(x)) + cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN (%s) AND product_id=%s and to_invoice=%s", (account.id, str_ids, product_id, factor_id)) line_ids = cr.dictfetchall() note = [] for line in line_ids: @@ -195,7 +198,7 @@ class invoice_create(wizard.interface): states = { 'init' : { 'actions' : [_get_accounts], - 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create invoices')]}, + 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create Invoices')]}, }, 'create' : { 'actions' : [], From b1b9cb591c54c18f75097649c6aa9873cfdbd33c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 9 Feb 2009 15:16:46 +0100 Subject: [PATCH 03/11] [FIX] query lp bug: https://launchpad.net/bugs/327120 fixed bzr revid: christophe@tinyerp.com-20090209141646-0x02see4flirq8zj --- .../wizard/hr_timesheet_invoice_create.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 fd5201b62bc..0d2c7120503 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -128,10 +128,13 @@ class invoice_create(wizard.interface): # # Compute for lines # - str_ids="" - for x in data['ids']: - str_ids += ','.join(str(x)) - cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN (%s) AND product_id=%s and to_invoice=%s", (account.id, str_ids, product_id, factor_id)) + cr.execute("SELECT * " # TODO optimize this + " FROM account_analytic_line" + " WHERE account_id=%%s" + " AND id IN (%s)" + " AND product_id=%%s" + " AND to_invoice=%%s" % ','.join(['%s']*len(data['ids'])), + (account.id, data['ids'], product_id, factor_id)) line_ids = cr.dictfetchall() note = [] for line in line_ids: From 3183ed4f48c5976d92b935fe416928fe0838f675 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 10 Feb 2009 10:33:17 +0530 Subject: [PATCH 04/11] formated overdue payment with new style bzr revid: apa@tinyerp.com-20090210050317-ag2lzxkgdpfgb59w --- addons/account/report/overdue.rml | 351 +++++++++++++++--------------- 1 file changed, 175 insertions(+), 176 deletions(-) diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index 70f5fd09b25..fa949419cb0 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -17,240 +17,239 @@ - - - - - - - + + + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects,'o') ]] - [[ setLang(o.lang) ]] + [[ repeatIn(objects,'o') ]] + [[ setLang(o.lang) ]] - [[ repeatIn(adr_get(o, 'invoice'),'addr') ]] + [[ repeatIn(adr_get(o, 'invoice'),'addr') ]] - [[ o.name ]] - [[ addr['name'] ]] - [[ addr['street'] ]] - [[ addr['zip'] ]] [[ addr['city'] ]] - [[ addr['country_id'] ]] - + [[ o.name ]] + [[ addr['name'] ]] + [[ addr['street'] ]] + [[ addr['zip'] ]] [[ addr['city'] ]] + [[ addr['country_id'] ]] + - VAT: [[ o.vat or removeParentNode('para') ]] + VAT: [[ o.vat or removeParentNode('para') ]] - + - + - Document: Customer account statement - - Date: - [[ time.strftime('%d/%m/%Y') ]] - - Customer Ref: [[ o.id ]] - + Document: Customer account statement + Date: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] + Customer Ref: [[ o.ref ]] + - Dear Sir/Madam, - + Dear Sir/Madam, + - Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. - + Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. + - Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00. - + Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00. + - Best regards. - + Best regards. + - + - Date + Date - Description + Description - Ref + Ref - Maturity date + Maturity date - Due + Due - Paid + Paid - Maturity + Maturity - Li. - - - - - Sub-Total: - - - - - - [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - - - [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - - - [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]] - - - - - - - - - - Balance: - - - - - - [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(getLines(o), 'line') ]] - [[ line['date'] ]] - - - - [[ line['name'] ]] - - - [[ line['ref'] ]] - - - [[ line['date_maturity'] ]] - - - [[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ line['blocked'] and 'X' or '' ]] + Li. - - - - - Total amount due: - [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]] - . - - +
+ [[repeatIn(getLines(o), 'line') ]] + + + + [[ formatLang(line['date'],date=True) ]] + + + [[ line['name'] ]] + + + [[ line['ref'] ]] + + + [[ line['date_maturity'] ]] + + + [[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + + + [[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + + + [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]] + + + [[ line['blocked'] and 'X' or '' ]] + + + +
+ + + + + + + + + Sub-Total : + + + [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] + + + [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] + + + [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]] + + + + + + + + + + + + + + + Balance : + + + [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] + + + + + + + + + + + + + + + + + + + Total amount due: [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]]. +
From 4ab597d6e798d4e975f3db70fed81e20e131a5ee Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 10 Feb 2009 11:07:41 +0530 Subject: [PATCH 05/11] formated account followup report with new style(vir) bzr revid: apa@tinyerp.com-20090210053741-wh7hcpbh6lrfavgx --- addons/account_followup/report/rappel.rml | 300 +++++++++++++--------- 1 file changed, 184 insertions(+), 116 deletions(-) diff --git a/addons/account_followup/report/rappel.rml b/addons/account_followup/report/rappel.rml index 3f28abfd206..257365ce807 100644 --- a/addons/account_followup/report/rappel.rml +++ b/addons/account_followup/report/rappel.rml @@ -17,45 +17,46 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - @@ -63,160 +64,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] [[ setLang(o.lang) ]] + [[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] + [[ setLang(o.lang) ]] - - - + [[ repeatIn(adr_get(o,'invoice'),'a' )]] - [[ o.name ]] - [[ repeatIn(adr_get(o,'invoice'),'a' )]] - [[ a['name'] ]] - [[ a['street'] ]] - [[ a['zip'] ]] - [[ a['city'] ]] - [[( a['country_id'] and a['country_id'][1]) or '']] - + [[ o.name ]] + [[ a['name'] ]] + [[ a['street'] ]] + [[ a['zip'] ]] + [[ a['city'] ]] + [[( a['country_id'] and a['country_id'][1]) or '']] + - VAT: [[ o.vat or removeParentNode('para') ]] + VAT: [[ o.vat or removeParentNode('para') ]] - + - Document: Customer account statement - - Date: - [[ time.strftime('%d/%m/%Y') ]] - - Customer Ref: [[ o.id ]] - + Document : Customer account statement + Date : [[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]] + Customer Ref : [[ o.id ]] + - [[ format(get_text(o,data['form']['followup_id'])) ]] - + [[ format(get_text(o,data['form']['followup_id'])) ]] + - + - Date + Invoice Date - Description + Description - Ref + Ref - Maturity date + Maturity Date - Due + Amount In Currency - Paid + Due - Maturity + Paid - Amount + Maturity - Li. - - - - - - [[repeatIn(getLines(o), 'line') ]] - [[ line['date'] ]] - - - - [[ line['name'] ]] - - - [[ line['ref'] ]] - - - [[ line['date_maturity'] ]] - - - [[ line['debit'] and '%.2f' % line['debit'] or '' ]] [[ company.currency_id.name]] - - - [[ line['credit'] and '%.2f' % line['credit'] or '0.00' ]] [[ company.currency_id.name]] - - - [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and (line['debit'] - line['credit']) or '' ]] [[ company.currency_id.name]] - - - [[ '%.2f' % line['amount_currency'] ]] [[ line['currency_id'] and line['currency_id'][1] or '' ]] - - - [[ line['blocked'] and 'X' or '' ]] + Li. - +
+ [[repeatIn(getLines(o), 'line') ]] + + + + [[ formatLang(line['date'],date = True) ]] + + + [[ line['name'] ]] + + + [[ line['ref'] ]] + + + [[ line['date_maturity'] ]] + + + [[ formatLang(line['amount_currency'] )]] [[ line['currency_id'] and line['currency_id'][1] or '' ]] + + + [[ formatLang(line['debit']) ]] [[ company.currency_id.name]] + + + [[ formatLang(line['credit']) ]] [[ company.currency_id.name]] + + + [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and (line['debit'] -line['credit']) or '0.00' ]] [[ company.currency_id.name]] + + + [[ line['blocked'] and 'X' or '' ]] + + + +
+ - Sub-Total: + + + - [[ '%.2f' % (reduce(lambda x,y: x+y['debit'], getLines(o), 0)) ]] [[ company.currency_id.name]] + + + - [[ '%.2f' % (reduce(lambda x,y: x+y['credit'], getLines(o), 0)) ]] [[ company.currency_id.name]] + + + - [[ reduce(lambda x,y: x+(y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0) ]] [[ company.currency_id.name]] + + + - + + + + + + Sub-Total: + + + [[formatLang(reduce(lambda x,y: x+y['debit'], getLines(o), 0.00)) ]] [[ company.currency_id.name]] + + + [[formatLang(reduce(lambda x,y: x+y['credit'], getLines(o), 0.00)) ]] [[ company.currency_id.name]] + + + [[ reduce(lambda x,y: x+(y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0) ]] [[ company.currency_id.name]] + + + - Balance: - - - [[ '%.2f' % (reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0)) ]] [[ company.currency_id.name]] - - - + - + - + + + + + + + + + + + + + + + + Balance: + + + [[ '%.2f' % (reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0.00)) ]] [[ company.currency_id.name]] + + + + + + + + + + + + + - - - - +
- From b13793ea9d2407b608275e865f82946345e72537 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 10 Feb 2009 12:29:00 +0530 Subject: [PATCH 06/11] replace date_time with date in req. for qua. bzr revid: apa@tinyerp.com-20090210065900-scrrsy9oxuig758f --- addons/purchase/report/request_quotation.rml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml index b7be6949c1b..c5f083bbf05 100644 --- a/addons/purchase/report/request_quotation.rml +++ b/addons/purchase/report/request_quotation.rml @@ -109,7 +109,7 @@ - + Description @@ -124,13 +124,13 @@
[[repeatIn(order.order_line,'order_line')]] - + [[ order_line.name ]] - [[ formatLang(order_line.date_planned, date = True) ]] + [[ formatLang(order_line.date_planned, date_time = True) ]] [[ formatLang(order_line.product_qty )]] From 4d3713a0453babd2dd83e802dc39f5e0b1de1525 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 10 Feb 2009 10:48:43 +0100 Subject: [PATCH 07/11] [FIX] gettextAlias: handle the case when context is None lp bug: https://launchpad.net/bugs/327510 fixed bzr revid: christophe@tinyerp.com-20090210094843-khwkfjd83fha8rvl --- bin/tools/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 7e1a7ca08a8..e8ff793fa4a 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -59,7 +59,7 @@ class GettextAlias(object): def __call__(self, source): frame = inspect.stack()[1][0] cr = frame.f_locals.get('cr') - lang = frame.f_locals.get('context', {}).get('lang', False) + lang = (frame.f_locals.get('context') or {}).get('lang', False) if not (lang and cr): return source From 494187e0b58d077e5ff54cd191dd8a002b3bf715 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 10 Feb 2009 16:02:34 +0530 Subject: [PATCH 08/11] [FIX]If any account template has no code,no problem bzr revid: jvo@tinyerp.com-20090210103234-z2v07jbj053xnln1 --- addons/account/account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 328cdbe0bb4..0e5a1e425b6 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2186,10 +2186,13 @@ class wizard_multi_charts_accounts(osv.osv_memory): #create the account_account for this bank journal tmp = self.pool.get('res.partner.bank').name_get(cr, uid, [line.acc_no.id])[0][1] dig = obj_multi.code_digits + new_code = str(current_num) + if ref_acc_bank.code: + new_code = str(ref_acc_bank.code.ljust(dig,'0') + str(current_num)) vals = { 'name': line.acc_no.bank and line.acc_no.bank.name+' '+tmp or tmp, 'currency_id': line.currency_id and line.currency_id.id or False, - 'code': str(ref_acc_bank.code.ljust(dig,'0') + str(current_num)), + 'code': new_code, 'type': 'other', 'user_type': account_template.user_type and account_template.user_type.id or False, 'reconcile': True, From 1d3ec352dd90cfb53a3e1ce50551fee59bfe073c Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Tue, 10 Feb 2009 17:53:53 +0530 Subject: [PATCH 09/11] replace date with date_time in purchase order report bzr revid: apa@tinyerp.com-20090210122353-eslrxoa09i7ockdc --- addons/purchase/report/order.rml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index aa8e14367ab..d945dc1802f 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -133,7 +133,7 @@ - [[ repeatIn(objects,'o') ]] + [[repeatIn(objects,'o')]] [[ setLang(o.partner_id.lang) ]] @@ -237,7 +237,7 @@ - + Description @@ -260,8 +260,8 @@
- [[ repeatIn(o.order_line,'line') ]] - + [[repeatIn(o.order_line,'line')]] + [[ line.name ]] @@ -270,7 +270,7 @@ [[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]] - [[ formatLang( line.date_planned, date=True) ]] + [[ formatLang( line.date_planned, date_time=True) ]] [[ formatLang(line.product_qty ) ]] From c5943171d67e1e648f1e50be60a6c431321e5824 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 11 Feb 2009 15:05:48 +0530 Subject: [PATCH 10/11] [FIX] Case sections were not able to take parent sections bzr revid: jvo@tinyerp.com-20090211093548-499hgwso566xtuo3 --- addons/crm/crm.py | 2 +- addons/crm/crm_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 4364965cce6..f634475d942 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -80,7 +80,7 @@ class crm_case_section(osv.osv): level -= 1 return True _constraints = [ - (_check_recursion, 'Error ! You can not create recursive sections.', ['parent_id']) + (_check_recursion, 'Error ! You cannot create recursive sections.', ['parent_id']) ] # Mainly used by the wizard diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index feb9fd79d23..103682624b9 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -34,7 +34,7 @@ - +