From 9bd2e38eafdf37e87bc9327e4d01363361c44f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 00:55:24 -0300 Subject: [PATCH 01/40] [REF] removed mx.DateTime unused import as well as 2 other unused imports (!!) bzr revid: rvalyi@gmail.com-20100301035524-4nejbvju86c1wwvb --- addons/hr/hr.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 475185aa10e..a4a36d0e052 100755 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -19,10 +19,6 @@ # ############################################################################## -from mx import DateTime -import time -import math - from osv import fields, osv from tools.translate import _ From b04e0c64d1d48c4219774912d3b03c87637f49dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 01:00:47 -0300 Subject: [PATCH 02/40] [REF] [account] removed unused mx.DateTime imports bzr revid: rvalyi@gmail.com-20100301040047-3p41ik9rzhq5luoz --- addons/account/report/general_ledger.py | 1 - addons/account/report/general_ledger_landscape.py | 1 - 2 files changed, 2 deletions(-) diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 43c298866ed..b06aa1198fc 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -25,7 +25,6 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import time -from mx.DateTime import * from report import report_sxw import xml import rml_parse diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index dcb4e47fbdd..c888994622b 100644 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -27,7 +27,6 @@ ############################################################################## import time -from mx.DateTime import * from report import report_sxw import xml import rml_parse From a421e021ed7aa289c217dbb7cb14202b6c0dd43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 01:09:24 -0300 Subject: [PATCH 03/40] [REF] [account] removed unused mx.DateTime imports bzr revid: rvalyi@gmail.com-20100301040924-b8wxwhmvopxas6v7 --- addons/account/invoice.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 96f3a0afb40..ae9428f19db 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -24,8 +24,6 @@ import netsvc from osv import fields, osv import ir import pooler -import mx.DateTime -from mx.DateTime import RelativeDateTime from tools import config from tools.translate import _ From b8d17ac8044fe2cfca00530d61966960525102c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 01:36:05 -0300 Subject: [PATCH 04/40] [REF] [account] replaced mx.DateTime usage by pure Python datime and dateutil bzr revid: rvalyi@gmail.com-20100301043605-35lca2eqgk774jgh --- addons/account/account.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 516c185b652..8134c6d0c30 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -27,8 +27,8 @@ from osv import fields, osv from tools.misc import currency from tools.translate import _ import pooler -import mx.DateTime -from mx.DateTime import RelativeDateTime, now, DateTime, localtime +from datetime import datetime +from dateutil.relativedelta import relativedelta from tools import config @@ -60,11 +60,11 @@ class account_payment_term(osv.osv): elif line.value == 'balance': amt = round(amount, int(config['price_accuracy'])) if amt: - next_date = mx.DateTime.strptime(date_ref, '%Y-%m-%d') + RelativeDateTime(days=line.days) + next_date = datetime.strptime(date_ref, '%y-%m-%d') + relativedelta(days=line.days) if line.days2 < 0: - next_date += RelativeDateTime(day=line.days2) + next_date += relativedelta(day=line.days2) if line.days2 > 0: - next_date += RelativeDateTime(day=line.days2, months=1) + next_date += relativedelta(day=line.days2, months=1) result.append( (next_date.strftime('%Y-%m-%d'), amt) ) amount -= amt return result @@ -582,12 +582,12 @@ class account_fiscalyear(osv.osv): def create_period(self,cr, uid, ids, context={}, interval=1): for fy in self.browse(cr, uid, ids, context): - ds = mx.DateTime.strptime(fy.date_start, '%Y-%m-%d') + ds = datetime.strptime(fy.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d')fy.date_stop: - de=mx.DateTime.strptime(fy.date_stop, '%Y-%m-%d') + de = datetime.strptime(fy.date_stop, '%Y-%m-%d') self.pool.get('account.period').create(cr, uid, { 'name': ds.strftime('%m/%Y'), @@ -596,7 +596,7 @@ class account_fiscalyear(osv.osv): 'date_stop': de.strftime('%Y-%m-%d'), 'fiscalyear_id': fy.id, }) - ds = ds + RelativeDateTime(months=interval) + ds = ds + relativedelta(months=interval) return True def find(self, cr, uid, dt=None, exception=True, context={}): @@ -1720,11 +1720,11 @@ class account_subscription(osv.osv): 'subscription_id': sub.id, }) if sub.period_type=='day': - ds = (mx.DateTime.strptime(ds, '%Y-%m-%d') + RelativeDateTime(days=sub.period_nbr)).strftime('%Y-%m-%d') + ds = (datetime.strptime(ds, '%Y-%m-%d') + relativedelta(days=sub.period_nbr)).strftime('%Y-%m-%d') if sub.period_type=='month': - ds = (mx.DateTime.strptime(ds, '%Y-%m-%d') + RelativeDateTime(months=sub.period_nbr)).strftime('%Y-%m-%d') + ds = (datetime.strptime(ds, '%Y-%m-%d') + relativedelta(months=sub.period_nbr)).strftime('%Y-%m-%d') if sub.period_type=='year': - ds = (mx.DateTime.strptime(ds, '%Y-%m-%d') + RelativeDateTime(years=sub.period_nbr)).strftime('%Y-%m-%d') + ds = (datetime.strptime(ds, '%Y-%m-%d') + relativedelta(years=sub.period_nbr)).strftime('%Y-%m-%d') self.write(cr, uid, ids, {'state':'running'}) return True account_subscription() From bb84484882f15ca7ea2b452d61505d1914c68be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 01:53:16 -0300 Subject: [PATCH 05/40] [REF] [account] further mx.DateTime cleanup bzr revid: rvalyi@gmail.com-20100301045316-mw67ahn1epe4lknq --- addons/account/account_move_line.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 8355cf6be3c..ba44f413410 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -24,8 +24,7 @@ import netsvc from osv import fields, osv from tools.translate import _ -import mx.DateTime -from mx.DateTime import RelativeDateTime, now, DateTime, localtime +from datetime import now import tools From fca1d230e4a87630b05cd704e0e077b8342b4b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 01:54:48 -0300 Subject: [PATCH 06/40] [REF] [account] removed unused mx.DateTime imports bzr revid: rvalyi@gmail.com-20100301045448-6c7j5ck2gtkc6u09 --- addons/account/account_bank_statement.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 01c1eb7fa37..e0a316ae2a1 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -26,10 +26,6 @@ from osv import fields, osv from tools.misc import currency from tools.translate import _ -import mx.DateTime -from mx.DateTime import RelativeDateTime, now, DateTime, localtime - - class account_bank_statement(osv.osv): def _default_journal_id(self, cr, uid, context={}): if context.get('journal_id', False): From 45edbf48b9626834469adc91f28d3e6bc12169c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 02:05:14 -0300 Subject: [PATCH 07/40] [REF] [stock] removed mx.DateTime from stock module bzr revid: rvalyi@gmail.com-20100301050514-0dq2xgpypxw52hbj --- addons/stock/report/product_stock.py | 7 ++++--- addons/stock/report/stock_graph.py | 1 - addons/stock/stock.py | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/addons/stock/report/product_stock.py b/addons/stock/report/product_stock.py index 49c1daef8ed..f9a61a8989a 100644 --- a/addons/stock/report/product_stock.py +++ b/addons/stock/report/product_stock.py @@ -19,7 +19,8 @@ # ############################################################################## -from mx import DateTime +from datetime import datetime +from dateutil.relativedelta import relativedelta import osv import time @@ -76,7 +77,7 @@ class report_stock(report_int): "group by date_planned,product_id",(('confirmed','assigned','waiting'),loc_ids ,product_ids,)) for (qty, dt, prod_id) in cr.fetchall(): if dt<=dt_from: - dt= (DateTime.now() + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d') + dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d') else: dt = dt[:10] products.setdefault(prod_id, []) @@ -91,7 +92,7 @@ class report_stock(report_int): for (qty, dt, prod_id) in cr.fetchall(): if dt<=dt_from: - dt= (DateTime.now() + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d') + dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d') else: dt = dt[:10] products.setdefault(prod_id, []) diff --git a/addons/stock/report/stock_graph.py b/addons/stock/report/stock_graph.py index 0fdf88da7ce..d20baa08d58 100644 --- a/addons/stock/report/stock_graph.py +++ b/addons/stock/report/stock_graph.py @@ -18,7 +18,6 @@ # along with this program. If not, see . # ############################################################################## -from mx.DateTime import * from pychart import * import pychart.legend import time diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 240bc9762ce..6cf6d5901c3 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -19,7 +19,9 @@ # ############################################################################## -from mx import DateTime +from datetime import datetime +from dateutil.relativedelta import relativedelta + from osv import fields, osv from tools import config from tools.translate import _ @@ -1169,8 +1171,8 @@ class stock_move(osv.osv): if dest: if dest[1] == 'transparent': self.write(cr, uid, [m.id], { - 'date_planned': (DateTime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \ - DateTime.RelativeDateTime(days=dest[2] or 0)).strftime('%Y-%m-%d'), + 'date_planned': (datetime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \ + relativedelta(days=dest[2] or 0)).strftime('%Y-%m-%d'), 'location_dest_id': dest[0].id}) else: result.setdefault(m.picking_id, []) @@ -1206,7 +1208,7 @@ class stock_move(osv.osv): 'picking_id': pickid, 'state': 'waiting', 'move_history_ids': [], - 'date_planned': (DateTime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + DateTime.RelativeDateTime(days=delay or 0)).strftime('%Y-%m-%d'), + 'date_planned': (datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'), 'move_history_ids2': []} ) self.pool.get('stock.move').write(cr, uid, [move.id], { From caef744e048f8b6562282bce6f9549de751c42a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 02:09:11 -0300 Subject: [PATCH 08/40] [REF] [sale] removed mx.DateTime usage from sale module bzr revid: rvalyi@gmail.com-20100301050911-sqnifbigc455bylm --- addons/sale/sale.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index a9d0935fc76..f3997e6334d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -22,7 +22,8 @@ import time import netsvc from osv import fields, osv -from mx import DateTime +from datetime import datetime, now +from dateutil.relativedelta import relativedelta from tools import config from tools.translate import _ @@ -581,8 +582,8 @@ class sale_order(osv.osv): picking_id = False for line in order.order_line: proc_id = False - date_planned = DateTime.now() + DateTime.DateTimeDeltaFromDays(line.delay or 0.0) - date_planned = (date_planned - DateTime.DateTimeDeltaFromDays(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') + date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) + date_planned = (date_planned - relativedelta(company.security_lead)).strftime('%Y-%m-%d %H:%M:%S') if line.state == 'done': continue if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'): From 325ba204715bb1e8e2a729d45ccbe7f0df3a132d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 02:13:20 -0300 Subject: [PATCH 09/40] [REF] [purchase] removed mx.DateTime usage from purchase module bzr revid: rvalyi@gmail.com-20100301051320-j20t2m079zh49rrx --- addons/purchase/purchase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 1d7745a82f7..581c055db7c 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -25,7 +25,8 @@ import time import netsvc import ir -from mx import DateTime +from datetime import datetime +from dateutil.relativedelta import relativedelta import pooler from tools import config from tools.translate import _ @@ -518,7 +519,7 @@ class purchase_order_line(osv.osv): 'uom': uom, 'date': date_order, })[pricelist] - dt = (DateTime.now() + DateTime.RelativeDateTime(days=seller_delay or 0.0)).strftime('%Y-%m-%d %H:%M:%S') + dt = (datetime.now() + relativedelta(days=seller_delay or 0.0)).strftime('%Y-%m-%d %H:%M:%S') prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1] From 42f1ff14d1a9c10b183a35e250042e1f481e4300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 1 Mar 2010 02:16:51 -0300 Subject: [PATCH 10/40] [REF] fixed datetime now() method call in account and sale modules bzr revid: rvalyi@gmail.com-20100301051651-2gdc7tn8ljyi5vz9 --- addons/account/account.py | 2 +- addons/account/account_move_line.py | 4 ++-- addons/sale/sale.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 8134c6d0c30..7fbab48d436 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -48,7 +48,7 @@ class account_payment_term(osv.osv): def compute(self, cr, uid, id, value, date_ref=False, context={}): if not date_ref: - date_ref = now().strftime('%Y-%m-%d') + date_ref = datetime.now().strftime('%Y-%m-%d') pt = self.browse(cr, uid, id, context) amount = value result = [] diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index ba44f413410..15c2c93b8fb 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -24,7 +24,7 @@ import netsvc from osv import fields, osv from tools.translate import _ -from datetime import now +from datetime import datetime import tools @@ -484,7 +484,7 @@ class account_move_line(osv.osv): if not partner_id: return {'value':val} if not date: - date = now().strftime('%Y-%m-%d') + date = datetime.now().strftime('%Y-%m-%d') part = self.pool.get('res.partner').browse(cr, uid, partner_id) if part.property_payment_term and part.property_payment_term.line_ids: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f3997e6334d..60e5b39a183 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -22,7 +22,7 @@ import time import netsvc from osv import fields, osv -from datetime import datetime, now +from datetime import datetime from dateutil.relativedelta import relativedelta from tools import config from tools.translate import _ From a974840afd4ce934150f277fa0f74b035e2f9c93 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 5 Mar 2010 11:03:51 +0530 Subject: [PATCH 11/40] [IMP] report_crm: set the default view tree in report bzr revid: sbh@tinyerp.com-20100305053351-0f3jb70roram90fo --- addons/report_crm/report_crm_claim_view.xml | 8 ++++---- addons/report_crm/report_crm_fundraising_view.xml | 8 ++++---- addons/report_crm/report_crm_lead_view.xml | 7 +++---- addons/report_crm/report_crm_opportunity_view.xml | 7 +++---- addons/report_crm/report_crm_phonecall_view.xml | 8 ++++---- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/addons/report_crm/report_crm_claim_view.xml b/addons/report_crm/report_crm_claim_view.xml index 8232d72792b..1766eabb94f 100644 --- a/addons/report_crm/report_crm_claim_view.xml +++ b/addons/report_crm/report_crm_claim_view.xml @@ -66,21 +66,21 @@ Claims report.crm.claim form - graph,tree - + tree,graph + - + tree - + graph diff --git a/addons/report_crm/report_crm_fundraising_view.xml b/addons/report_crm/report_crm_fundraising_view.xml index 1bdba2fb4a4..dc188ef9956 100644 --- a/addons/report_crm/report_crm_fundraising_view.xml +++ b/addons/report_crm/report_crm_fundraising_view.xml @@ -69,21 +69,21 @@ Fundraising report.crm.fundraising form - graph,tree - + tree,graph + - + tree - + graph diff --git a/addons/report_crm/report_crm_lead_view.xml b/addons/report_crm/report_crm_lead_view.xml index 027238cc279..d5f4e63fd16 100644 --- a/addons/report_crm/report_crm_lead_view.xml +++ b/addons/report_crm/report_crm_lead_view.xml @@ -66,21 +66,20 @@ Leads report.crm.lead form - graph,tree - + tree,graph - + tree - + graph diff --git a/addons/report_crm/report_crm_opportunity_view.xml b/addons/report_crm/report_crm_opportunity_view.xml index b4f149d3cfe..f093d07940d 100644 --- a/addons/report_crm/report_crm_opportunity_view.xml +++ b/addons/report_crm/report_crm_opportunity_view.xml @@ -71,18 +71,17 @@ Opportunities report.crm.opportunity form - graph,tree - + tree,graph - + tree - + graph diff --git a/addons/report_crm/report_crm_phonecall_view.xml b/addons/report_crm/report_crm_phonecall_view.xml index b89570192ef..672f6fe101d 100644 --- a/addons/report_crm/report_crm_phonecall_view.xml +++ b/addons/report_crm/report_crm_phonecall_view.xml @@ -64,20 +64,20 @@ Phone Calls report.crm.phonecall form - graph,tree - + tree,graph + - + tree - + graph From 990552c684cfc7103da4e5e47d82f8df76448ffd Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 5 Mar 2010 13:00:14 +0530 Subject: [PATCH 12/40] [IMP]report_crm: improve the view and set default in group by and filter bzr revid: sbh@tinyerp.com-20100305073014-vm9x4mjs9cfa2fes --- addons/report_crm/report_crm_opportunity.py | 6 ++++-- .../report_crm_opportunity_view.xml | 9 ++++++--- addons/report_crm/report_crm_view.xml | 19 +++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/report_crm/report_crm_opportunity.py b/addons/report_crm/report_crm_opportunity.py index 1adfbf4baed..8ff49af0e71 100644 --- a/addons/report_crm/report_crm_opportunity.py +++ b/addons/report_crm/report_crm_opportunity.py @@ -12,7 +12,8 @@ class report_crm_opportunity(osv.osv): 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True), 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"), - 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True), + 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_opportunity') @@ -27,6 +28,7 @@ class report_crm_opportunity(osv.osv): c.section_id, c.categ_id, c.stage_id, + c.partner_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, @@ -37,7 +39,7 @@ class report_crm_opportunity(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_opportunity c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,c.categ_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,c.categ_id,c.partner_id )""") report_crm_opportunity() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_opportunity_view.xml b/addons/report_crm/report_crm_opportunity_view.xml index f093d07940d..bd5e14edae6 100644 --- a/addons/report_crm/report_crm_opportunity_view.xml +++ b/addons/report_crm/report_crm_opportunity_view.xml @@ -13,14 +13,15 @@ + + - + + - - @@ -63,6 +64,8 @@ + + diff --git a/addons/report_crm/report_crm_view.xml b/addons/report_crm/report_crm_view.xml index b69ee89548b..8b88c7ef524 100644 --- a/addons/report_crm/report_crm_view.xml +++ b/addons/report_crm/report_crm_view.xml @@ -53,8 +53,8 @@ - - + + @@ -67,24 +67,19 @@ domain="[('section_id.user_id','=',uid)]" help="My section"/> - - - + - + + + + - - - From c872a4a4460b1031d474d4bb80cf496d5bbe4be8 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 5 Mar 2010 13:49:49 +0530 Subject: [PATCH 13/40] [IMP] report_crm: Add the partner_id and section_id in all view bzr revid: sbh@tinyerp.com-20100305081949-pd9032ukqas9oa1h --- addons/report_crm/report_crm_claim.py | 6 ++++-- addons/report_crm/report_crm_claim_view.xml | 5 +++-- addons/report_crm/report_crm_fundraising.py | 4 +++- addons/report_crm/report_crm_fundraising_view.xml | 5 +++-- addons/report_crm/report_crm_lead.py | 4 +++- addons/report_crm/report_crm_lead_view.xml | 5 +++-- addons/report_crm/report_crm_opportunity_view.xml | 2 +- addons/report_crm/report_crm_phonecall.py | 4 +++- addons/report_crm/report_crm_phonecall_view.xml | 5 +++-- 9 files changed, 26 insertions(+), 14 deletions(-) diff --git a/addons/report_crm/report_crm_claim.py b/addons/report_crm/report_crm_claim.py index e78f2c8aa51..7f171849462 100644 --- a/addons/report_crm/report_crm_claim.py +++ b/addons/report_crm/report_crm_claim.py @@ -8,7 +8,8 @@ class report_crm_claim(osv.osv): _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]", readonly=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"), + 'partner_id': fields.many2one('res.partner', 'Partner'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_claim') @@ -22,6 +23,7 @@ class report_crm_claim(osv.osv): c.user_id, c.stage_id, c.section_id, + c.partner_id, c.categ_id, count(*) as nbr, 0 as avg_answers, @@ -30,7 +32,7 @@ class report_crm_claim(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_claim c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id,c.partner_id )""") report_crm_claim() diff --git a/addons/report_crm/report_crm_claim_view.xml b/addons/report_crm/report_crm_claim_view.xml index 1766eabb94f..9186ff49865 100644 --- a/addons/report_crm/report_crm_claim_view.xml +++ b/addons/report_crm/report_crm_claim_view.xml @@ -10,12 +10,13 @@ + + + - - diff --git a/addons/report_crm/report_crm_fundraising.py b/addons/report_crm/report_crm_fundraising.py index 397a50896bc..bd136e28162 100644 --- a/addons/report_crm/report_crm_fundraising.py +++ b/addons/report_crm/report_crm_fundraising.py @@ -11,6 +11,7 @@ class report_crm_fundraising(osv.osv): 'amount_revenue': fields.float('Est.Revenue', readonly=True), 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True), 'delay_close': fields.char('Delay to close', size=20, readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_fundraising') @@ -24,6 +25,7 @@ class report_crm_fundraising(osv.osv): c.user_id, c.section_id, c.categ_id, + c.partner_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, @@ -34,7 +36,7 @@ class report_crm_fundraising(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_fundraising c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.partner_id )""") report_crm_fundraising() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_fundraising_view.xml b/addons/report_crm/report_crm_fundraising_view.xml index dc188ef9956..509adf7e530 100644 --- a/addons/report_crm/report_crm_fundraising_view.xml +++ b/addons/report_crm/report_crm_fundraising_view.xml @@ -13,14 +13,15 @@ + + + - - diff --git a/addons/report_crm/report_crm_lead.py b/addons/report_crm/report_crm_lead.py index 2f170bd1825..0f42c0803ef 100644 --- a/addons/report_crm/report_crm_lead.py +++ b/addons/report_crm/report_crm_lead.py @@ -9,6 +9,7 @@ class report_crm_lead(osv.osv): 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_lead') @@ -23,6 +24,7 @@ class report_crm_lead(osv.osv): c.stage_id, c.section_id, c.categ_id, + c.partner_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, @@ -30,7 +32,7 @@ class report_crm_lead(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_lead c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id )""") report_crm_lead() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_lead_view.xml b/addons/report_crm/report_crm_lead_view.xml index d5f4e63fd16..b5491dffd80 100644 --- a/addons/report_crm/report_crm_lead_view.xml +++ b/addons/report_crm/report_crm_lead_view.xml @@ -13,11 +13,12 @@ + + + - - diff --git a/addons/report_crm/report_crm_opportunity_view.xml b/addons/report_crm/report_crm_opportunity_view.xml index bd5e14edae6..3deb335ffd3 100644 --- a/addons/report_crm/report_crm_opportunity_view.xml +++ b/addons/report_crm/report_crm_opportunity_view.xml @@ -15,12 +15,12 @@ + - diff --git a/addons/report_crm/report_crm_phonecall.py b/addons/report_crm/report_crm_phonecall.py index e693179a258..129fd977356 100644 --- a/addons/report_crm/report_crm_phonecall.py +++ b/addons/report_crm/report_crm_phonecall.py @@ -9,6 +9,7 @@ class report_crm_phonecall(osv.osv): _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"), + } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_phonecall') @@ -22,6 +23,7 @@ class report_crm_phonecall(osv.osv): c.user_id, c.section_id, c.categ_id, + c.partner_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, @@ -29,7 +31,7 @@ class report_crm_phonecall(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_phonecall c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id,c.partner_id )""") report_crm_phonecall() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_phonecall_view.xml b/addons/report_crm/report_crm_phonecall_view.xml index 672f6fe101d..8b6e87f54a5 100644 --- a/addons/report_crm/report_crm_phonecall_view.xml +++ b/addons/report_crm/report_crm_phonecall_view.xml @@ -13,11 +13,12 @@ + + + - - From 110771a391c5367aac3182438a41019aa9bec18c Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 5 Mar 2010 14:50:14 +0530 Subject: [PATCH 14/40] [IMP] crm,report_crm: Fix the probelm probability aand add the company_id in all report bzr revid: sbh@tinyerp.com-20100305092014-id3njiugtdj2hb0a --- addons/crm/crm.py | 7 ++++--- addons/report_crm/report_crm_claim.py | 6 ++++-- addons/report_crm/report_crm_claim_view.xml | 1 + addons/report_crm/report_crm_fundraising.py | 4 +++- addons/report_crm/report_crm_fundraising_view.xml | 3 ++- addons/report_crm/report_crm_lead.py | 6 ++++-- addons/report_crm/report_crm_lead_view.xml | 1 + addons/report_crm/report_crm_opportunity.py | 6 ++++-- addons/report_crm/report_crm_opportunity_view.xml | 5 +++-- addons/report_crm/report_crm_phonecall.py | 5 +++-- addons/report_crm/report_crm_phonecall_view.xml | 1 + 11 files changed, 30 insertions(+), 15 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 7765f61ec32..33b75802e49 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -296,8 +296,8 @@ class crm_case(osv.osv): if section in s: st = case.stage_id.id or False if st in s[section]: - self.write(cr, uid, [case.id], {'stage_id': s[section][st]}) - + stage_value = self.pool.get('crm.case.stage').read(cr, uid,s[section][st] , ['probability'], context) + self.write(cr, uid, [case.id], {'stage_id': s[section][st],'probability':stage_value['probability']}) return True def get_stage_dict(self, cr, uid, ids, context={}): @@ -319,7 +319,8 @@ class crm_case(osv.osv): st = case.stage_id.id or False s[section] = dict([(v, k) for (k, v) in s[section].iteritems()]) if st in s[section]: - self.write(cr, uid, [case.id], {'stage_id': s[section][st]}) + stage_value = self.pool.get('crm.case.stage').read(cr, uid,s[section][st] ,['probability'], context) + self.write(cr, uid, [case.id], {'stage_id': s[section][st],'probability':stage_value['probability']}) return True diff --git a/addons/report_crm/report_crm_claim.py b/addons/report_crm/report_crm_claim.py index 7f171849462..f82444fb79b 100644 --- a/addons/report_crm/report_crm_claim.py +++ b/addons/report_crm/report_crm_claim.py @@ -9,7 +9,8 @@ class report_crm_claim(osv.osv): 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]", readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"), - 'partner_id': fields.many2one('res.partner', 'Partner'), + 'partner_id': fields.many2one('res.partner', 'Partner'), + 'company_id': fields.many2one('res.company','Company'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_claim') @@ -24,6 +25,7 @@ class report_crm_claim(osv.osv): c.stage_id, c.section_id, c.partner_id, + c.company_id, c.categ_id, count(*) as nbr, 0 as avg_answers, @@ -32,7 +34,7 @@ class report_crm_claim(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_claim c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id,c.partner_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id,c.partner_id,c.company_id )""") report_crm_claim() diff --git a/addons/report_crm/report_crm_claim_view.xml b/addons/report_crm/report_crm_claim_view.xml index 9186ff49865..99a715be840 100644 --- a/addons/report_crm/report_crm_claim_view.xml +++ b/addons/report_crm/report_crm_claim_view.xml @@ -12,6 +12,7 @@ + diff --git a/addons/report_crm/report_crm_fundraising.py b/addons/report_crm/report_crm_fundraising.py index bd136e28162..70497a71c31 100644 --- a/addons/report_crm/report_crm_fundraising.py +++ b/addons/report_crm/report_crm_fundraising.py @@ -12,6 +12,7 @@ class report_crm_fundraising(osv.osv): 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True), 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner'), + 'company_id': fields.many2one('res.company','Company'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_fundraising') @@ -25,6 +26,7 @@ class report_crm_fundraising(osv.osv): c.user_id, c.section_id, c.categ_id, + c.company_id, c.partner_id, count(*) as nbr, 0 as avg_answers, @@ -36,7 +38,7 @@ class report_crm_fundraising(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_fundraising c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.partner_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id )""") report_crm_fundraising() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_fundraising_view.xml b/addons/report_crm/report_crm_fundraising_view.xml index 509adf7e530..0861cd58a2b 100644 --- a/addons/report_crm/report_crm_fundraising_view.xml +++ b/addons/report_crm/report_crm_fundraising_view.xml @@ -15,9 +15,10 @@ + - + diff --git a/addons/report_crm/report_crm_lead.py b/addons/report_crm/report_crm_lead.py index 0f42c0803ef..0a233ce9b51 100644 --- a/addons/report_crm/report_crm_lead.py +++ b/addons/report_crm/report_crm_lead.py @@ -9,7 +9,8 @@ class report_crm_lead(osv.osv): 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True), - 'partner_id': fields.many2one('res.partner', 'Partner'), + 'partner_id': fields.many2one('res.partner', 'Partner'), + 'company_id': fields.many2one('res.company','Company'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_lead') @@ -22,6 +23,7 @@ class report_crm_lead(osv.osv): c.state, c.user_id, c.stage_id, + c.company_id, c.section_id, c.categ_id, c.partner_id, @@ -32,7 +34,7 @@ class report_crm_lead(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_lead c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id )""") report_crm_lead() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_lead_view.xml b/addons/report_crm/report_crm_lead_view.xml index b5491dffd80..fd7e56a0317 100644 --- a/addons/report_crm/report_crm_lead_view.xml +++ b/addons/report_crm/report_crm_lead_view.xml @@ -15,6 +15,7 @@ + diff --git a/addons/report_crm/report_crm_opportunity.py b/addons/report_crm/report_crm_opportunity.py index 8ff49af0e71..a261fd91f24 100644 --- a/addons/report_crm/report_crm_opportunity.py +++ b/addons/report_crm/report_crm_opportunity.py @@ -14,6 +14,7 @@ class report_crm_opportunity(osv.osv): 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"), 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner'), + 'company_id': fields.many2one('res.company', 'Company',readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_opportunity') @@ -29,17 +30,18 @@ class report_crm_opportunity(osv.osv): c.categ_id, c.stage_id, c.partner_id, + c.company_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, 0.0 as perc_cancel, sum(planned_revenue) as amount_revenue, - sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob, + sum((planned_revenue*probability)/100.0)::decimal(16,2) as amount_revenue_prob, avg(probability)::decimal(16,2) as probability, to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_opportunity c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,c.categ_id,c.partner_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,c.categ_id,c.partner_id,company_id )""") report_crm_opportunity() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_opportunity_view.xml b/addons/report_crm/report_crm_opportunity_view.xml index 3deb335ffd3..8dfe91c4031 100644 --- a/addons/report_crm/report_crm_opportunity_view.xml +++ b/addons/report_crm/report_crm_opportunity_view.xml @@ -15,9 +15,10 @@ + - + @@ -64,8 +65,8 @@ + - diff --git a/addons/report_crm/report_crm_phonecall.py b/addons/report_crm/report_crm_phonecall.py index 129fd977356..77ce3c17f94 100644 --- a/addons/report_crm/report_crm_phonecall.py +++ b/addons/report_crm/report_crm_phonecall.py @@ -9,7 +9,7 @@ class report_crm_phonecall(osv.osv): _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"), - + 'company_id': fields.many2one('res.company','Company'), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_phonecall') @@ -24,6 +24,7 @@ class report_crm_phonecall(osv.osv): c.section_id, c.categ_id, c.partner_id, + c.company_id, count(*) as nbr, 0 as avg_answers, 0.0 as perc_done, @@ -31,7 +32,7 @@ class report_crm_phonecall(osv.osv): to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_phonecall c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id,c.partner_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id )""") report_crm_phonecall() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/report_crm_phonecall_view.xml b/addons/report_crm/report_crm_phonecall_view.xml index 8b6e87f54a5..71889fb994c 100644 --- a/addons/report_crm/report_crm_phonecall_view.xml +++ b/addons/report_crm/report_crm_phonecall_view.xml @@ -15,6 +15,7 @@ + From 33a87c8dea87caf6284cfbe409f1240884d245e5 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 5 Mar 2010 14:51:22 +0530 Subject: [PATCH 15/40] [FIX]: base_calendar: Fixed problem of editing recurrent event+ exporting attendee without email bzr revid: rpa@openerp.co.in-20100305092122-d6ujxcrmpk2ctyle --- addons/base_calendar/base_calendar.py | 18 +++++++++++------- addons/caldav/caldav.py | 5 ++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 5c8aa460da0..18b27820766 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -811,18 +811,18 @@ rule or repeating pattern for anexception to a recurrence set"), 'interval': lambda *x: 1, } - def modify_this(self, cr, uid, ids, defaults, context=None, *args): + def modify_this(self, cr, uid, ids, defaults, real_date, context=None, *args): ids = map(lambda x: base_calendar_id2real_id(x), ids) datas = self.read(cr, uid, ids[0], context=context) defaults.update({ 'recurrent_uid': base_calendar_id2real_id(datas['id']), - 'recurrent_id': defaults.get('date'), + 'recurrent_id': defaults.get('date') or real_date, 'rrule_type': 'none', 'rrule': '' }) exdate = datas['exdate'] and datas['exdate'].split(',') or [] - if defaults.get('date'): - exdate.append(defaults.get('date')) + if real_date and defaults.get('date'): + exdate.append(real_date) self.write(cr, uid, ids, {'exdate': ','.join(exdate)}, context=context) new_id = self.copy(cr, uid, ids[0], default=defaults, context=context) return new_id @@ -986,9 +986,13 @@ rule or repeating pattern for anexception to a recurrence set"), new_ids = [] for id in select: if len(str(id).split('-')) > 1: - data = self.read(cr, uid, id, ['date', 'date_deadline']) - self.modify_this(cr, uid, [id], vals, context) - continue + data = self.read(cr, uid, id, ['date', 'date_deadline', 'rrule', 'duration']) + if data.get('rrule'): + real_date = data.get('date') + data.update(vals) + new_id = self.modify_this(cr, uid, [id], data, real_date, context) + context.update({'active_id': new_id,'active_ids': [new_id]}) + continue id = base_calendar_id2real_id(id) if not id in new_ids: new_ids.append(id) diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py index 3afcc28dd40..ce7bbe62e24 100644 --- a/addons/caldav/caldav.py +++ b/addons/caldav/caldav.py @@ -804,7 +804,10 @@ class Attendee(CalDAV, osv.osv_memory): cn_val = [str(attendee[a_val['field']])] if cn_val: attendee_add.params['CN'] = cn_val - attendee_add.value = 'MAILTO:' + attendee['email'] + if not attendee['email']: + raise osv.except_osv(_('Error !'), _('Attendee must have an Email Id')) + elif attendee['email']: + attendee_add.value = 'MAILTO:' + attendee['email'] return vevent Attendee() From 6c3969b38914af23dd72be7edf0efee4596c5290 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 5 Mar 2010 15:01:42 +0530 Subject: [PATCH 16/40] [IMP] report_crm: set readonly on some field bzr revid: sbh@tinyerp.com-20100305093142-lh7migddq6dnzj30 --- addons/report_crm/report_crm.py | 4 +++- addons/report_crm/report_crm_claim.py | 6 +++--- addons/report_crm/report_crm_lead.py | 6 +++--- addons/report_crm/report_crm_opportunity.py | 4 ++-- addons/report_crm/report_crm_phonecall.py | 3 ++- addons/report_crm/report_crm_view.xml | 3 +++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/addons/report_crm/report_crm.py b/addons/report_crm/report_crm.py index da9ba2e9ba3..91ad7269351 100644 --- a/addons/report_crm/report_crm.py +++ b/addons/report_crm/report_crm.py @@ -74,6 +74,7 @@ class report_crm_case(osv.osv): 'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), + 'company_id': fields.many2one('res.company','Company',readonly=True), } _order = 'name desc, user_id' def init(self, cr): @@ -87,10 +88,11 @@ class report_crm_case(osv.osv): c.state, c.user_id, c.section_id, + c.company_id, count(*) as nbr from crm_case c - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.company_id )""") report_crm_case() diff --git a/addons/report_crm/report_crm_claim.py b/addons/report_crm/report_crm_claim.py index f82444fb79b..5ec1cf05849 100644 --- a/addons/report_crm/report_crm_claim.py +++ b/addons/report_crm/report_crm_claim.py @@ -8,9 +8,9 @@ class report_crm_claim(osv.osv): _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]", readonly=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"), - 'partner_id': fields.many2one('res.partner', 'Partner'), - 'company_id': fields.many2one('res.company','Company'), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]",readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True), + 'company_id': fields.many2one('res.company','Company',readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_claim') diff --git a/addons/report_crm/report_crm_lead.py b/addons/report_crm/report_crm_lead.py index 0a233ce9b51..e9c79ed772d 100644 --- a/addons/report_crm/report_crm_lead.py +++ b/addons/report_crm/report_crm_lead.py @@ -7,10 +7,10 @@ class report_crm_lead(osv.osv): _inherit = "report.crm.case" _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]" ,readonly=True), 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True), - 'partner_id': fields.many2one('res.partner', 'Partner'), - 'company_id': fields.many2one('res.company','Company'), + 'partner_id': fields.many2one('res.partner', 'Partner' ,readonly=True), + 'company_id': fields.many2one('res.company','Company',readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_lead') diff --git a/addons/report_crm/report_crm_opportunity.py b/addons/report_crm/report_crm_opportunity.py index a261fd91f24..2ded021a71e 100644 --- a/addons/report_crm/report_crm_opportunity.py +++ b/addons/report_crm/report_crm_opportunity.py @@ -11,9 +11,9 @@ class report_crm_opportunity(osv.osv): 'amount_revenue': fields.float('Est.Revenue', readonly=True), 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True), 'delay_close': fields.char('Delay to close', size=20, readonly=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True), 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True), - 'partner_id': fields.many2one('res.partner', 'Partner'), + 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True), 'company_id': fields.many2one('res.company', 'Company',readonly=True), } def init(self, cr): diff --git a/addons/report_crm/report_crm_phonecall.py b/addons/report_crm/report_crm_phonecall.py index 77ce3c17f94..f89af4b1d15 100644 --- a/addons/report_crm/report_crm_phonecall.py +++ b/addons/report_crm/report_crm_phonecall.py @@ -9,7 +9,8 @@ class report_crm_phonecall(osv.osv): _columns = { 'delay_close': fields.char('Delay to close', size=20, readonly=True), 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"), - 'company_id': fields.many2one('res.company','Company'), + 'partner_id': fields.many2one('res.partner', 'Partner' ,readonly=True), + 'company_id': fields.many2one('res.company','Company',readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'report_crm_phonecall') diff --git a/addons/report_crm/report_crm_view.xml b/addons/report_crm/report_crm_view.xml index 8b88c7ef524..2e52d59b87c 100644 --- a/addons/report_crm/report_crm_view.xml +++ b/addons/report_crm/report_crm_view.xml @@ -11,6 +11,7 @@ + @@ -72,6 +73,7 @@ + @@ -79,6 +81,7 @@ + From f3cd7c3a9751436d6b7b5b828fbf6e1719bafa78 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 5 Mar 2010 15:33:09 +0530 Subject: [PATCH 17/40] [IMP]: crm(Opportunity): Added domain for Current Opportunity in schedule a meeting wizard bzr revid: rpa@openerp.co.in-20100305100309-xy1we9khjuy5tcqx --- addons/crm/wizard/crm_opportunity_wizard.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/crm/wizard/crm_opportunity_wizard.py b/addons/crm/wizard/crm_opportunity_wizard.py index d7ec0b72cb6..e2636027c92 100644 --- a/addons/crm/wizard/crm_opportunity_wizard.py +++ b/addons/crm/wizard/crm_opportunity_wizard.py @@ -154,16 +154,20 @@ class opportunity2meeting(wizard.interface): partner_id = opportunity.partner_id and opportunity.partner_id.id or False name = opportunity.name email = opportunity.email_from - section_id = opportunity.section_id and opportunity.section_id.id or False + section_id = opportunity.section_id and opportunity.section_id.id or False return { 'name': _('Meetings'), - 'domain' : "[('user_id','=',%s)]"%(uid), - 'context': {'default_partner_id': partner_id, 'default_section_id': section_id, 'default_email_from': email, 'default_state':'open', 'default_name':name}, + 'domain' : "[('user_id','=',%s), ('opportunity_id', '=', %s)]"%(uid, data['id']), + 'context': {'default_partner_id': partner_id, + 'default_opportunity_id': data['id'], + 'default_section_id': section_id, + 'default_email_from': email, + 'default_state':'open', 'default_name':name}, 'view_type': 'form', - 'view_mode': 'calendar,form,tree', + 'view_mode': 'tree,form,calendar', 'res_model': 'crm.meeting', 'view_id': False, - 'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')], + 'views': [(id3, 'tree'), (id2, 'form'), (id1, 'calendar')], 'type': 'ir.actions.act_window', 'search_view_id': id['res_id'] } From 48e7f8370a2f0024fb2356bf3bd52275df9922be Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Fri, 5 Mar 2010 15:38:13 +0530 Subject: [PATCH 18/40] [ADD]: Added access rules for remaining objects in account, hr, mail_gateway, mrp, stock, project, base_calendar and resource modules. bzr revid: uco@tinyerp.co.in-20100305100813-2wsyownr15sk335s --- addons/account/security/ir.model.access.csv | 1 + addons/account_voucher/__terp__.py | 1 + .../base_calendar/security/ir.model.access.csv | 2 ++ addons/hr/security/ir.model.access.csv | 2 ++ addons/mail_gateway/security/ir.model.access.csv | 3 +++ addons/mrp/mrp.py | 2 +- addons/mrp/security/ir.model.access.csv | 2 ++ addons/project/security/ir.model.access.csv | 2 ++ addons/resource/__terp__.py | 2 +- addons/resource/security/ir.model.access.csv | 8 ++++---- addons/stock/security/ir.model.access.csv | 7 +++++++ addons/stock/stock_wizard.py | 16 ++++++++-------- addons/stock/stock_wizard_view.xml | 4 ++-- 13 files changed, 36 insertions(+), 16 deletions(-) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 4cf67851760..271a4efe0ab 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -87,3 +87,4 @@ "access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1 "access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1 "access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0 +"access_account_installer","account.installer","model_account_installer","base.group_user",1,0,0,0 diff --git a/addons/account_voucher/__terp__.py b/addons/account_voucher/__terp__.py index 242cc5fb391..20bf2c579ff 100755 --- a/addons/account_voucher/__terp__.py +++ b/addons/account_voucher/__terp__.py @@ -39,6 +39,7 @@ ], "update_xml" : [ + "security/account_security.xml", "voucher_sequence.xml", "account_report.xml", "voucher_view.xml", diff --git a/addons/base_calendar/security/ir.model.access.csv b/addons/base_calendar/security/ir.model.access.csv index 8a720533140..2851e392e0b 100644 --- a/addons/base_calendar/security/ir.model.access.csv +++ b/addons/base_calendar/security/ir.model.access.csv @@ -3,3 +3,5 @@ "access_calendar_alarm","calendar.alarm","model_calendar_alarm",,1,1,1,1 "access_res_alarm","res.alarm","model_res_alarm",,1,1,1,1 "access_calendar_event_all","calendar.event","model_calendar_event",,1,1,1,1 +"access_calendar_todo","calendar.todo","model_calendar_todo",,1,1,1,1 +"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",,1,1,1,1 diff --git a/addons/hr/security/ir.model.access.csv b/addons/hr/security/ir.model.access.csv index cd1a18d246b..3853a6e8e38 100644 --- a/addons/hr/security/ir.model.access.csv +++ b/addons/hr/security/ir.model.access.csv @@ -5,3 +5,5 @@ "access_hr_employee_category_manager","hr.employee.category.manager","model_hr_employee_category","hr.group_hr_manager",1,1,1,1 "access_hr_department_manager","hr.department.manager","model_hr_department","hr.group_hr_manager",1,1,1,1 "access_hr_employee_marital_status","hr.employee.marital.status","model_hr_employee_marital_status","hr.group_hr_user",1,1,1,1 +"access_hr_job","hr.job","model_hr_job","hr.group_hr_user",1,0,0,0 +"access_hr_installer","hr.installer","model_hr_installer","hr.group_hr_user",1,0,0,0 \ No newline at end of file diff --git a/addons/mail_gateway/security/ir.model.access.csv b/addons/mail_gateway/security/ir.model.access.csv index 996147308f6..864db00acb0 100644 --- a/addons/mail_gateway/security/ir.model.access.csv +++ b/addons/mail_gateway/security/ir.model.access.csv @@ -1,4 +1,7 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_mail_gateway_server","mail.gateway.server","model_mail_gateway_server","base.group_user",1,0,0,0 +"access_mail_gateway","mail.gateway","model_mail_gateway","base.group_user",1,0,0,0 +"access_mail_gateway_history","mail.gateway.history","model_mail_gateway_history","base.group_user",1,0,0,0 diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 5bb5d8a59c4..40fd2e46525 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1422,7 +1422,7 @@ StockPicking() class spilt_in_production_lot(osv.osv_memory): - _inherit = "stock.move.spilt" + _inherit = "stock.move.split" def split(self, cr, uid, ids, move_ids, context=None): production_obj = self.pool.get('mrp.production') move_obj = self.pool.get('stock.move') diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index f3cae96266c..cdc658ff7c0 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -30,3 +30,5 @@ "access_hr_timesheet_group_mrp_worker","resource.calendar mrp_worker","resource.model_resource_calendar","mrp.group_mrp_user",1,0,0,0 "access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,1,1,1 "access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0 +"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0 +"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0 diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index efeda2170a5..b5877b688b7 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -11,3 +11,5 @@ "access_project_task_work_manager","project.task.work.manager","model_project_task_work","project.group_project_manager",1,1,1,1 "access_config_compute_remaining","project.config.compute.remaining","model_config_compute_remaining","project.group_project_user",1,1,1,1 "access_config_compute_remaining_manager","project.config.compute.remaining.manager","model_config_compute_remaining","project.group_project_manager",1,1,1,1 +"access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0 +"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0 \ No newline at end of file diff --git a/addons/resource/__terp__.py b/addons/resource/__terp__.py index 7c924574cf1..fb2a0f5899c 100755 --- a/addons/resource/__terp__.py +++ b/addons/resource/__terp__.py @@ -37,7 +37,7 @@ 'init_xml': [], 'update_xml': [ #'security/resource_security.xml', -# 'security/ir.model.access.csv', + 'security/ir.model.access.csv', 'resource_view.xml', ], 'demo_xml': ['resource_demo.xml' diff --git a/addons/resource/security/ir.model.access.csv b/addons/resource/security/ir.model.access.csv index 0874bf97235..796d29dcb94 100644 --- a/addons/resource/security/ir.model.access.csv +++ b/addons/resource/security/ir.model.access.csv @@ -1,5 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_timesheet_group","resource.calendar","model_resource_calendar","hr.group_hr_user",1,0,0,0 -"access_hr_timesheet","hr.timesheet","model_hr_timesheet","hr.group_hr_user",1,1,1,1 -"access_hr_timesheet_manager","hr.timesheet manager","model_hr_timesheet","hr.group_hr_manager",1,1,1,1 -"access_hr_timesheet_group_manager","hr.timesheet.group.manager","model_hr_timesheet_group","hr.group_hr_manager",1,1,1,1 +"access_resource_calendar","resource.calendar","model_resource_calendar","base.group_user",1,0,0,0 +"access_resource_calendar_week","resource.calendar.week","model_resource_calendar_week","base.group_user",1,0,0,0 +"access_resource_resource","resource.resource","model_resource_resource","base.group_user",1,0,0,0 +"access_resource_calendar_leaves","resource.calendar.leaves","model_resource_calendar_leaves","base.group_user",1,0,0,0 \ No newline at end of file diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index 25a455e771f..eea058ebde1 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -16,3 +16,10 @@ "access_stock_location_product_manager","stock.location product manager","model_stock_location","product.group_product_manager",1,0,0,0 "access_stock_lines_date","report.stock.lines.date all","model_report_stock_lines_date",,1,0,0,0 "access_stock_report_tracklots","stock.report.tracklots","model_stock_report_tracklots","stock.group_stock_user",1,1,1,1 +"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,0,0,0 +"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,0,0,0 +"access_stock_move_track","stock.move.track","model_stock_move_track","stock.group_stock_user",1,0,0,0 +"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0 +"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0 +"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0 +"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0 \ No newline at end of file diff --git a/addons/stock/stock_wizard.py b/addons/stock/stock_wizard.py index c813b8583b6..548375db199 100644 --- a/addons/stock/stock_wizard.py +++ b/addons/stock/stock_wizard.py @@ -110,13 +110,13 @@ class stock_move_scrap(osv.osv_memory): stock_move_scrap() -class spilt_in_production_lot(osv.osv_memory): - _name = "stock.move.spilt" +class split_in_production_lot(osv.osv_memory): + _name = "stock.move.split" _description = "Split in Production lots" _columns = { 'product_id': fields.many2one('product.product', 'Product', required=True, select=True), - 'line_ids': fields.one2many('stock.move.spilt.lines', 'lot_id', 'Lots Number') + 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number') } def _get_product_id(self, cr, uid, context): @@ -185,17 +185,17 @@ class spilt_in_production_lot(osv.osv_memory): return new_move -spilt_in_production_lot() +split_in_production_lot() -class stock_move_spilt_lines(osv.osv_memory): - _name = "stock.move.spilt.lines" +class stock_move_split_lines(osv.osv_memory): + _name = "stock.move.split.lines" _description = "Split lines" _columns = { 'name': fields.char('Tracking serial', size=64), 'quantity': fields.integer('Quantity'), 'use_exist' : fields.boolean('Use Exist'), - 'lot_id': fields.many2one('stock.move.spilt', 'Lot'), + 'lot_id': fields.many2one('stock.move.split', 'Lot'), 'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'), } _defaults = { @@ -203,4 +203,4 @@ class stock_move_spilt_lines(osv.osv_memory): 'action' : lambda *x: 'split', } -stock_move_spilt_lines() +stock_move_split_lines() diff --git a/addons/stock/stock_wizard_view.xml b/addons/stock/stock_wizard_view.xml index 72200beaee8..55fc8a6d8a7 100644 --- a/addons/stock/stock_wizard_view.xml +++ b/addons/stock/stock_wizard_view.xml @@ -100,7 +100,7 @@ Split in lots - stock.move.spilt + stock.move.split form
@@ -131,7 +131,7 @@ Split in lots ir.actions.act_window - stock.move.spilt + stock.move.split form form new From 23ef56589e6e88fbd55c11920e149f10abd52a12 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 5 Mar 2010 15:47:26 +0530 Subject: [PATCH 19/40] [IMP]: crm(claim): Improved filter + put buttons in list view bzr revid: rpa@openerp.co.in-20100305101726-12bnj0b8ytr2ujlz --- addons/crm/crm_claims_view.xml | 20 ++++++++++++++++---- addons/crm/crm_fund_view.xml | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/addons/crm/crm_claims_view.xml b/addons/crm/crm_claims_view.xml index e0fd5d90c80..ae6635bdbcb 100644 --- a/addons/crm/crm_claims_view.xml +++ b/addons/crm/crm_claims_view.xml @@ -43,6 +43,11 @@ +