From 4661fb71d202390f0bf55c1f92073d3fce24878f Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 18 May 2012 12:03:48 +0530 Subject: [PATCH 01/10] [FIX] account: set ondelete='cascade' on payment_id for allow to delete payment term. bzr revid: tpa@tinyerp.com-20120518063348-1lm9oyy0kw5pkwdy --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 26af7a5f9bd..8d0fb8eb818 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -106,7 +106,7 @@ class account_payment_term_line(osv.osv): 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), - 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True), + 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'), } _defaults = { 'value': 'balance', From da13d90912fb12bd8f82a12300325f6f57dfee17 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 11 Jun 2012 14:38:49 +0530 Subject: [PATCH 02/10] [FIX] stock:'product level forecast' report does not support accented char. bzr revid: tpa@tinyerp.com-20120611090849-cmir9qms3blrjjw4 --- addons/stock/report/stock_graph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/report/stock_graph.py b/addons/stock/report/stock_graph.py index 5ee58bb9d2c..b5d08f93d3f 100644 --- a/addons/stock/report/stock_graph.py +++ b/addons/stock/report/stock_graph.py @@ -22,6 +22,7 @@ from pychart import * import pychart.legend import time from report.misc import choice_colors +import base64 # # Draw a graph for stocks @@ -41,7 +42,7 @@ class stock_graph(object): product_name=product_name.replace('/', '//') if product_id not in self._datas: self._datas[product_id] = {} - self._names[product_id] = product_name + self._names[product_id] = product_name.decode('utf-8') for (dt,stock) in datas: if not dt in self._datas[product_id]: self._datas[product_id][dt]=0 From 41c90e8755b5b12f8e6f4e3870eb3a7f8e2b7b5b Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 5 Jul 2012 18:34:55 +0530 Subject: [PATCH 03/10] [FIX] account: add else condition in onchange_chart_id lp bug: https://launchpad.net/bugs/1021152 fixed bzr revid: cha@tinyerp.com-20120705130455-iy00wseff3lroj25 --- addons/account/wizard/account_report_common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index fa3c195cfb7..f84c4e909a2 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -32,6 +32,8 @@ class account_common_report(osv.osv_memory): def onchange_chart_id(self, cr, uid, ids, chart_account_id=False, context=None): if chart_account_id: company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id + else: + return {'value': {'company_id': False}} return {'value': {'company_id': company_id}} _columns = { From 4e435d335db70863ec732860f4b5009ed13d5279 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 17 Aug 2012 16:17:02 +0530 Subject: [PATCH 04/10] [FIX]hr_timesheet_sheet :fix the issue open timesheet by account from timesheet form view and pass a appropriate ids in name_get lp bug: https://launchpad.net/bugs/1038023 fixed bzr revid: mma@tinyerp.com-20120817104702-qpzqc8w1s9pccr83 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index ca28b5bdb28..b2ef41f3a46 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,8 +442,10 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if not len(ids): + if not ids: return [] + if isinstance(ids, (int)): + ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'], context=context, load='_classic_write')] From 20981ac1a30cf05f82f2467b65664931b5ebf579 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Mon, 20 Aug 2012 16:29:42 +0530 Subject: [PATCH 05/10] [IMP] account: make little change in onchange method. bzr revid: cha@tinyerp.com-20120820105942-zkyrqrebn3s3j9nc --- addons/account/wizard/account_report_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index f84c4e909a2..604806f6e31 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -30,11 +30,11 @@ class account_common_report(osv.osv_memory): _description = "Account Common Report" def onchange_chart_id(self, cr, uid, ids, chart_account_id=False, context=None): + res = {} if chart_account_id: company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id - else: - return {'value': {'company_id': False}} - return {'value': {'company_id': company_id}} + res['value'] = {'company_id': company_id} + return res _columns = { 'chart_account_id': fields.many2one('account.account', 'Chart of Account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]), From 1937247840f50a4333c5618c538a27253573b06f Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 21 Aug 2012 11:21:50 +0530 Subject: [PATCH 06/10] [IMP]hr_timesheet_sheet :improve name_get method bzr revid: mma@tinyerp.com-20120821055150-60n2k2fva99mqi9m --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b2ef41f3a46..f2a5df1ba0c 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,9 +442,7 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if not ids: - return [] - if isinstance(ids, (int)): + if ids and isinstance(ids, int): ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'], From 6c337bcd64b53f234872d9f7026f342755de9c60 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 21 Aug 2012 14:37:50 +0530 Subject: [PATCH 07/10] [IMP]hr_timesheet_sheet :improved as per ids bzr revid: mma@tinyerp.com-20120821090750-zkr0loqnmslqslcr --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index f2a5df1ba0c..7a7e05a80e0 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,7 +442,9 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if ids and isinstance(ids, int): + if not ids: + return [] + if isinstance(ids, int): ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'], From 8bf884d2b698dae61f00814768259d6e6fe6a3c7 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Wed, 22 Aug 2012 11:20:23 +0530 Subject: [PATCH 08/10] [FIX] set the menu for base.menu_definitions bzr revid: nco@tinyerp.com-20120822055023-4y39imx6dhwyjqsi --- addons/crm_claim/crm_claim_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm_claim/crm_claim_menu.xml b/addons/crm_claim/crm_claim_menu.xml index 46f8760387a..bb881d62a58 100644 --- a/addons/crm_claim/crm_claim_menu.xml +++ b/addons/crm_claim/crm_claim_menu.xml @@ -50,9 +50,9 @@ parent="base.menu_aftersale" action="crm_case_categ_claim0" sequence="1"/> + - From 4d0937e9a642b31183dfbc0cd963b95411d536cb Mon Sep 17 00:00:00 2001 From: "Jignesh Rathod (Open ERP)" Date: Wed, 22 Aug 2012 12:39:28 +0530 Subject: [PATCH 09/10] [FIX] Fixes the problem of Iteration is not allowed on browse_record lp bug: https://launchpad.net/bugs/1039899 fixed bzr revid: jir@tinyerp.com-20120822070928-hfqz8s9du89ib03d --- addons/event/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/event/event.py b/addons/event/event.py index 7f0c77661e4..004b370f48e 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -52,10 +52,13 @@ class event_event(osv.osv): _inherit = ['ir.needaction_mixin','mail.thread'] def name_get(self, cr, uid, ids, context=None): + event_obj = self.browse(cr, uid, ids, context=context) if not ids: return [] + if not isinstance(event_obj,list): + event_obj = [event_obj] res = [] - for record in self.browse(cr, uid, ids, context=context): + for record in event_obj: date = record.date_begin.split(" ")[0] date_end = record.date_end.split(" ")[0] if date != date_end: From e7a5fcd896c84d5b93f9ac463335690d75780e2f Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 23 Aug 2012 15:11:11 +0530 Subject: [PATCH 10/10] [FIX] Improved code to encode accented char. bzr revid: tpa@tinyerp.com-20120823094111-vph3jpaxb29hoqqm --- addons/stock/report/stock_graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/stock_graph.py b/addons/stock/report/stock_graph.py index b5d08f93d3f..d92de2805b5 100644 --- a/addons/stock/report/stock_graph.py +++ b/addons/stock/report/stock_graph.py @@ -22,7 +22,7 @@ from pychart import * import pychart.legend import time from report.misc import choice_colors -import base64 +import tools # # Draw a graph for stocks @@ -42,7 +42,7 @@ class stock_graph(object): product_name=product_name.replace('/', '//') if product_id not in self._datas: self._datas[product_id] = {} - self._names[product_id] = product_name.decode('utf-8') + self._names[product_id] = tools.ustr(product_name) for (dt,stock) in datas: if not dt in self._datas[product_id]: self._datas[product_id][dt]=0