From 82fe0985a54cfb51cb417f3ae296df5e051c2a4c Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP Trainee)" Date: Wed, 29 May 2013 14:56:36 +0530 Subject: [PATCH 01/20] [IMP] account: set breadcum Journal Items in bank statement, and align filter by field in partner ladger wizard. bzr revid: nco@tinyerp.com-20130529092636-0e81g0zx96butvmm --- addons/account/account_bank_statement.py | 1 + addons/account/wizard/account_report_partner_ledger_view.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 023765d73f0..bcdb60fe58b 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -491,6 +491,7 @@ class account_bank_statement(osv.osv): ctx = (context or {}).copy() ctx['journal_id'] = self.browse(cr, uid, ids[0], context=context).journal_id.id return { + 'name':'Journal Items', 'view_type':'form', 'view_mode':'tree', 'res_model':'account.move.line', diff --git a/addons/account/wizard/account_report_partner_ledger_view.xml b/addons/account/wizard/account_report_partner_ledger_view.xml index 34c5d55e4c1..61b57f87d7e 100644 --- a/addons/account/wizard/account_report_partner_ledger_view.xml +++ b/addons/account/wizard/account_report_partner_ledger_view.xml @@ -15,7 +15,7 @@ - + From 1f2bc6a0b910579ab7e4cd13cae456fdbdae7a9d Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP Trainee)" Date: Wed, 29 May 2013 15:05:08 +0530 Subject: [PATCH 02/20] [IMP] Webkit Logos and Webkit Headers/Footers have a parent menu : Settings > Technical > Webkit. bzr revid: nco@tinyerp.com-20130529093508-fovjf0zlpkpe4feg --- addons/report_webkit/header_view.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/report_webkit/header_view.xml b/addons/report_webkit/header_view.xml index 30407f89385..833e813ba4e 100644 --- a/addons/report_webkit/header_view.xml +++ b/addons/report_webkit/header_view.xml @@ -48,7 +48,8 @@ form tree,form - + + Webkit Headers/Footers @@ -56,7 +57,7 @@ form tree,form - + From 74e1e041a5954211ee4ef344fc0440104b0563f8 Mon Sep 17 00:00:00 2001 From: "Chandni Machchhar (OpenERP Trainee)" Date: Wed, 29 May 2013 15:15:16 +0530 Subject: [PATCH 03/20] [IMP] remove editable bottom from tree view of meeting types. bzr revid: nco@tinyerp.com-20130529094516-0x2dfc5gna1ccy5q --- addons/base_calendar/crm_meeting_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_calendar/crm_meeting_view.xml b/addons/base_calendar/crm_meeting_view.xml index d9b659b91fa..1befadf8bac 100644 --- a/addons/base_calendar/crm_meeting_view.xml +++ b/addons/base_calendar/crm_meeting_view.xml @@ -9,7 +9,7 @@ Meeting Types Tree crm.meeting.type - + From 608af8d06c97b4ed478a1cecc23a28a99e428a2b Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP Trainee)" Date: Wed, 29 May 2013 17:54:29 +0530 Subject: [PATCH 04/20] [IMP] remove unused warning given while Schedule a meeting from phone call, select Attendee and Save. so remve defalt state value. bzr revid: nco@tinyerp.com-20130529122429-q9u8qswk8rl3x01i --- addons/crm/crm_phonecall.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 0d7004e005b..d87d9ab26cb 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -264,7 +264,6 @@ class crm_phonecall(base_state, osv.osv): 'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False, 'default_user_id': uid, 'default_email_from': phonecall.email_from, - 'default_state': 'open', 'default_name': phonecall.name, } return res From e9fbcae722cedd4ad5ddaa2cef520cb0887697bf Mon Sep 17 00:00:00 2001 From: "Pooja Zankhariya (OpenERP Trainee)" Date: Wed, 29 May 2013 18:31:19 +0530 Subject: [PATCH 05/20] [IMP] set atendee of phone call contact into meeting if it creates form the phonecall. bzr revid: nco@tinyerp.com-20130529130119-nl0kdwo7lqkbo35w --- addons/crm/crm_phonecall.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index d87d9ab26cb..26e64e0ce0e 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -261,11 +261,12 @@ class crm_phonecall(base_state, osv.osv): res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { 'default_phonecall_id': phonecall.id, - 'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False, 'default_user_id': uid, 'default_email_from': phonecall.email_from, 'default_name': phonecall.name, } + if phonecall.partner_id and phonecall.partner_id.email: + res['context']['default_partner_ids']= [phonecall.partner_id] and [phonecall.partner_id.id] or False return res def action_button_convert2opportunity(self, cr, uid, ids, context=None): From cdfc5649749a9fab65a5612755e920135754257f Mon Sep 17 00:00:00 2001 From: "Nimesh Contractor (OpenERP)" Date: Wed, 29 May 2013 18:35:59 +0530 Subject: [PATCH 06/20] [IMP] improve code. bzr revid: nco@tinyerp.com-20130529130559-neom3q6ndlr1rxav --- addons/crm/crm_phonecall.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 26e64e0ce0e..225deb54866 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -257,16 +257,18 @@ class crm_phonecall(base_state, osv.osv): Open meeting's calendar view to schedule a meeting on current phonecall. :return dict: dictionary value for created meeting view """ + partner_ids = [] phonecall = self.browse(cr, uid, ids[0], context) + if phonecall.partner_id and phonecall.partner_id.email: + partner_ids.append(phonecall.partner_id.id) res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { 'default_phonecall_id': phonecall.id, + 'default_partner_ids': partner_ids or False, 'default_user_id': uid, 'default_email_from': phonecall.email_from, 'default_name': phonecall.name, } - if phonecall.partner_id and phonecall.partner_id.email: - res['context']['default_partner_ids']= [phonecall.partner_id] and [phonecall.partner_id.id] or False return res def action_button_convert2opportunity(self, cr, uid, ids, context=None): From 6d20cdc0439103aaf361c165f44f7c2d9c3e8aeb Mon Sep 17 00:00:00 2001 From: "Mahendra Barad (OpenERP Trainee)" Date: Fri, 31 May 2013 18:56:40 +0530 Subject: [PATCH 07/20] [IMP]account: set breadcum Journal Items in asset bzr revid: baradmahendra344@gmail.com-20130531132640-ycc72g8jlmtgm1km --- addons/account_asset/account_asset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 5c019155fdc..f95fcb60770 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -352,6 +352,7 @@ class account_asset_asset(osv.osv): context = {} context.update({'search_default_asset_id': ids, 'default_asset_id': ids}) return { + 'name':'journal items', 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'account.move.line', From c39b35fb478bcfe10602ae746cb0792eb8596e8b Mon Sep 17 00:00:00 2001 From: "Nimesh Contractor (OpenERP)" Date: Mon, 3 Jun 2013 15:50:12 +0530 Subject: [PATCH 08/20] [FIX] crm shedule call default state error. bzr revid: nco@tinyerp.com-20130603102012-obuz62351o1czhgx --- addons/crm/crm_phonecall_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml index 2344604a294..2e626965470 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -106,7 +106,7 @@ tree,calendar [('state','!=','done')] - + {}

From 91a657d4a3d5b76e19eb966c58eb820a5dbf3a42 Mon Sep 17 00:00:00 2001 From: "Nimesh Contractor (OpenERP)" Date: Mon, 3 Jun 2013 16:56:01 +0530 Subject: [PATCH 09/20] [IMP] make string translateable. bzr revid: nco@tinyerp.com-20130603112601-n1b14xdz2iacr1i8 --- addons/account/account_bank_statement.py | 2 +- addons/account_asset/account_asset.py | 2 +- addons/crm/crm_phonecall.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index bcdb60fe58b..74e8c8d51e9 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -491,7 +491,7 @@ class account_bank_statement(osv.osv): ctx = (context or {}).copy() ctx['journal_id'] = self.browse(cr, uid, ids[0], context=context).journal_id.id return { - 'name':'Journal Items', + 'name':_('Journal Items'), 'view_type':'form', 'view_mode':'tree', 'res_model':'account.move.line', diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index f95fcb60770..fdde5a7bdd2 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -352,7 +352,7 @@ class account_asset_asset(osv.osv): context = {} context.update({'search_default_asset_id': ids, 'default_asset_id': ids}) return { - 'name':'journal items', + 'name':_('journal items'), 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'account.move.line', diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 225deb54866..f4b66fc4d3e 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -264,7 +264,7 @@ class crm_phonecall(base_state, osv.osv): res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { 'default_phonecall_id': phonecall.id, - 'default_partner_ids': partner_ids or False, + 'default_partner_ids': partner_ids or [], 'default_user_id': uid, 'default_email_from': phonecall.email_from, 'default_name': phonecall.name, From 2b313fd2ae72ac48c8b3628b27b3abf7c339fcd0 Mon Sep 17 00:00:00 2001 From: "Nimesh Contractor (OpenERP)" Date: Mon, 3 Jun 2013 17:15:23 +0530 Subject: [PATCH 10/20] [IMP] improve code bzr revid: nco@tinyerp.com-20130603114523-vzdorpta47sbq5ub --- addons/account/account_bank_statement.py | 2 +- addons/account_asset/account_asset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 74e8c8d51e9..46fdac57f3e 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -491,7 +491,7 @@ class account_bank_statement(osv.osv): ctx = (context or {}).copy() ctx['journal_id'] = self.browse(cr, uid, ids[0], context=context).journal_id.id return { - 'name':_('Journal Items'), + 'name': _('Journal Items'), 'view_type':'form', 'view_mode':'tree', 'res_model':'account.move.line', diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index fdde5a7bdd2..d39a30ba4cc 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -352,7 +352,7 @@ class account_asset_asset(osv.osv): context = {} context.update({'search_default_asset_id': ids, 'default_asset_id': ids}) return { - 'name':_('journal items'), + 'name': _('Journal Items'), 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'account.move.line', From 45b427b8b56c271c35b8d8c7ece19bfa3231581f Mon Sep 17 00:00:00 2001 From: "Nimesh Contractor (OpenERP)" Date: Tue, 4 Jun 2013 18:45:33 +0530 Subject: [PATCH 11/20] [IMP] improve code. bzr revid: nco@tinyerp.com-20130604131533-uti2v9n35l3ma7zb --- addons/crm/crm_phonecall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index f4b66fc4d3e..e7a5e3c0cbd 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -264,7 +264,7 @@ class crm_phonecall(base_state, osv.osv): res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { 'default_phonecall_id': phonecall.id, - 'default_partner_ids': partner_ids or [], + 'default_partner_ids': partner_ids, 'default_user_id': uid, 'default_email_from': phonecall.email_from, 'default_name': phonecall.name, From 401445163458e1fd9e4570caaffe907c3131c94c Mon Sep 17 00:00:00 2001 From: "Jaydeep Barot (OpenERP Trainee)" Date: Thu, 22 Aug 2013 14:26:42 +0530 Subject: [PATCH 12/20] [IMP] add null context of action on logged calls bzr revid: jaydeep.gvp@gmail.com-20130822085642-82v9kbxjpmm3s0gx --- addons/crm/crm_phonecall_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml index 7b097f2f19a..2e626965470 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -58,7 +58,7 @@ tree,calendar [] - {'default_state': 'done'} + {}

From 7d696bc620e90797ada8bb6d0a07fd92000eb204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Feb 2014 13:19:21 +0100 Subject: [PATCH 13/20] [IMP] website: server actions: usability improvements - added website_path, the end of the path to access the server action, allowing more custom and short URLs, like website/action/partners instead of website/action/website.action_partners; - added website_url, computed file with the full address of the server action that is displayed on the form view, to ease usability - updated server action contorller: now takes xml_id, id, or website_path bzr revid: tde@openerp.com-20140207121921-7kdpxrf30zlte47l --- addons/website/controllers/main.py | 20 ++++++++++++------- addons/website/models/ir_actions.py | 30 +++++++++++++++++++++++++++++ addons/website/views/ir_actions.xml | 26 +++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 9 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index e97a3be9d97..cbfab26475f 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -369,20 +369,26 @@ class Website(openerp.addons.web.controllers.main.Home): #------------------------------------------------------ # Server actions #------------------------------------------------------ - @http.route(['/website/action/'], type='http', auth="public", website=True) - def actions_server(self, id_or_xml_id, **post): + _server_action_route = '/website/action' + + @http.route('%s/' % _server_action_route, type='http', auth="public", website=True) + def actions_server(self, path_or_xml_id_or_id, **post): cr, uid, context = request.cr, request.uid, request.context res, action_id, action = None, None, None ServerActions = request.registry['ir.actions.server'] - # find the action_id, either an int, an int into a basestring, or an xml_id - if isinstance(id_or_xml_id, basestring) and '.' in id_or_xml_id: - action_id = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, request.uid, id_or_xml_id, raise_if_not_found=False) - else: + # find the action_id: either an xml_id, the path, or an ID + if isinstance(path_or_xml_id_or_id, basestring) and '.' in path_or_xml_id_or_id: + action_id = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, request.uid, path_or_xml_id_or_id, raise_if_not_found=False) + if not action_id: + action_ids = ServerActions.search(cr, uid, [('website_path', '=', path_or_xml_id_or_id), ('website_publihsed', '=', True)], context=context) + action_id = action_ids and action_ids[0] or None + if not action_id: try: - action_id = int(id_or_xml_id) + action_id = int(path_or_xml_id_or_id) except ValueError: pass + # check it effectively exists if action_id: action_ids = ServerActions.exists(cr, uid, [action_id], context=context) diff --git a/addons/website/models/ir_actions.py b/addons/website/models/ir_actions.py index 731ee4c47e6..361191d6835 100644 --- a/addons/website/models/ir_actions.py +++ b/addons/website/models/ir_actions.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- +import urlparse + from openerp.addons.web.http import request +# from openerp.addons.website.controllers.main import Website from openerp.osv import fields, osv @@ -9,7 +12,28 @@ class actions_server(osv.Model): _name = 'ir.actions.server' _inherit = ['ir.actions.server'] + def _compute_website_url(self, cr, uid, id, website_path, xml_id, context=None): + base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url', context=context) + link = website_path or xml_id or (id and '%d' % id) or '' + if base_url and link: + path = '%s/%s' % ('/website/action', link) + return '%s' % urlparse.urljoin(base_url, path) + return '' + + def _get_website_url(self, cr, uid, ids, name, args, context=None): + res = dict.fromkeys(ids, False) + for action in self.browse(cr, uid, ids, context=context): + res[action.id] = self._compute_website_url(cr, uid, action.id, action.website_path, action.xml_id, context=context) + return res + _columns = { + 'xml_id': fields.function( + osv.osv.get_xml_id, type='char', string="External ID", + help="ID of the action if defined in a XML file"), + 'website_url': fields.function( + _get_website_url, type='char', string='Website URL', + help='The full URL to access the server action through the website.'), + 'website_path': fields.char('Website Path'), 'website_published': fields.boolean( 'Available on the Website', help='A code server action can be executed from the website, using a dedicated' @@ -18,6 +42,12 @@ class actions_server(osv.Model): 'set to is False the action cannot be run through the website.'), } + def on_change_website_path(self, cr, uid, ids, website_path, xml_id, context=None): + values = { + 'website_url': self._compute_website_url(cr, uid, ids[0], website_path, xml_id, context=context) + } + return {'value': values} + def _get_eval_context(self, cr, uid, action, context=None): """ Override to add the request object in eval_context. """ eval_context = super(actions_server, self)._get_eval_context(cr, uid, action, context=context) diff --git a/addons/website/views/ir_actions.xml b/addons/website/views/ir_actions.xml index 0b017a43192..5b7f80df2a7 100644 --- a/addons/website/views/ir_actions.xml +++ b/addons/website/views/ir_actions.xml @@ -6,10 +6,32 @@ ir.actions.server.form.website ir.actions.server + + + + + + + + + + + + + + + + ir.actions.server.search.website + ir.actions.server + - + From 21602f92a107ba1ea585354044c65ee140225d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Feb 2014 13:32:49 +0100 Subject: [PATCH 14/20] [FIX] website: server action: compute website_url only for published code actions bzr revid: tde@openerp.com-20140207123249-yfql78xurblyamze --- addons/website/models/ir_actions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website/models/ir_actions.py b/addons/website/models/ir_actions.py index 361191d6835..f6d98bf3632 100644 --- a/addons/website/models/ir_actions.py +++ b/addons/website/models/ir_actions.py @@ -23,7 +23,8 @@ class actions_server(osv.Model): def _get_website_url(self, cr, uid, ids, name, args, context=None): res = dict.fromkeys(ids, False) for action in self.browse(cr, uid, ids, context=context): - res[action.id] = self._compute_website_url(cr, uid, action.id, action.website_path, action.xml_id, context=context) + if action.state == 'code' and action.website_published: + res[action.id] = self._compute_website_url(cr, uid, action.id, action.website_path, action.xml_id, context=context) return res _columns = { From 167ac762ca1dc18fb038520056bcb8416caac3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Feb 2014 13:33:01 +0100 Subject: [PATCH 15/20] [IMP] website: server action: display website_url in tree view bzr revid: tde@openerp.com-20140207123301-4guyw8ay4e6fghuj --- addons/website/views/ir_actions.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/website/views/ir_actions.xml b/addons/website/views/ir_actions.xml index 5b7f80df2a7..0573c87af31 100644 --- a/addons/website/views/ir_actions.xml +++ b/addons/website/views/ir_actions.xml @@ -24,6 +24,17 @@ + + ir.actions.server.tree.website + ir.actions.server + + + + + + + + ir.actions.server.search.website ir.actions.server From c27dfb92ea9240a3b832a7ec2ac99063855db2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Feb 2014 13:33:55 +0100 Subject: [PATCH 16/20] [IMP] website: server action: demo data now have website_path bzr revid: tde@openerp.com-20140207123355-t3hxvqxjr5p8p0du --- addons/website/data/website_demo.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/website/data/website_demo.xml b/addons/website/data/website_demo.xml index a7fa4d76a07..6f37b871100 100644 --- a/addons/website/data/website_demo.xml +++ b/addons/website/data/website_demo.xml @@ -43,6 +43,7 @@ Website Partner Post and Thanks Demo True + partner_thanks partner_id, partner = False, None @@ -118,6 +119,7 @@ response = request.website.render("website.template_partner_post", values) Website Partners Comment Form True + partner_comment partner_ids = pool['res.partner'].search(cr, uid, [('customer', '=', True)], context=context) From 3c3bff14c099c52d2a77134010ae4b591e613c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 12 Feb 2014 11:37:53 +0100 Subject: [PATCH 17/20] [CLEAN] website: server action controllers: removed unnecessary variable bzr revid: tde@openerp.com-20140212103753-8fheizloj3minlt6 --- addons/website/controllers/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index cbfab26475f..85c17f301b6 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -369,9 +369,8 @@ class Website(openerp.addons.web.controllers.main.Home): #------------------------------------------------------ # Server actions #------------------------------------------------------ - _server_action_route = '/website/action' - @http.route('%s/' % _server_action_route, type='http', auth="public", website=True) + @http.route('/website/action/', type='http', auth="public", website=True) def actions_server(self, path_or_xml_id_or_id, **post): cr, uid, context = request.cr, request.uid, request.context res, action_id, action = None, None, None From 4c11416db6269a0f0e4a76e03dfb0f9cb659867b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 12 Feb 2014 11:39:12 +0100 Subject: [PATCH 18/20] [FIX] website: server action controllers: fixed typo in a domain bzr revid: tde@openerp.com-20140212103912-1rhyl3wxa2a084ls --- addons/website/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index c754fd81e00..5a5226cef81 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -389,7 +389,7 @@ class Website(openerp.addons.web.controllers.main.Home): if isinstance(path_or_xml_id_or_id, basestring) and '.' in path_or_xml_id_or_id: action_id = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, request.uid, path_or_xml_id_or_id, raise_if_not_found=False) if not action_id: - action_ids = ServerActions.search(cr, uid, [('website_path', '=', path_or_xml_id_or_id), ('website_publihsed', '=', True)], context=context) + action_ids = ServerActions.search(cr, uid, [('website_path', '=', path_or_xml_id_or_id), ('website_published', '=', True)], context=context) action_id = action_ids and action_ids[0] or None if not action_id: try: From 19d9b7309d8223f3550965d7e29aad1d48c1d41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 12 Feb 2014 11:42:27 +0100 Subject: [PATCH 19/20] [CLEAN] website: ir_actions: removed commented line + small reordering of columns definition + fixed an help string bzr revid: tde@openerp.com-20140212104227-bd2rsrewqizmxtf3 --- addons/website/models/ir_actions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/website/models/ir_actions.py b/addons/website/models/ir_actions.py index f6d98bf3632..5f627eec54a 100644 --- a/addons/website/models/ir_actions.py +++ b/addons/website/models/ir_actions.py @@ -3,7 +3,6 @@ import urlparse from openerp.addons.web.http import request -# from openerp.addons.website.controllers.main import Website from openerp.osv import fields, osv @@ -31,14 +30,14 @@ class actions_server(osv.Model): 'xml_id': fields.function( osv.osv.get_xml_id, type='char', string="External ID", help="ID of the action if defined in a XML file"), + 'website_path': fields.char('Website Path'), 'website_url': fields.function( _get_website_url, type='char', string='Website URL', help='The full URL to access the server action through the website.'), - 'website_path': fields.char('Website Path'), 'website_published': fields.boolean( 'Available on the Website', help='A code server action can be executed from the website, using a dedicated' - 'controller. The address is /website/action/.' + 'controller. The address is /website/action/.' 'Set this field as True to allow users to run this action. If it' 'set to is False the action cannot be run through the website.'), } From 9250fd83c5ffa9dd3b14897ca90867f8a55227af Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 12 Feb 2014 11:55:12 +0100 Subject: [PATCH 20/20] [FIX] oe initialize start http server to allow http tests to pass bzr revid: chs@openerp.com-20140212105512-lag945hh0l8z7owk --- openerpcommand/initialize.py | 54 ++++++++---------------------------- 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/openerpcommand/initialize.py b/openerpcommand/initialize.py index dfa14f7b9dd..cf4e54bfb82 100644 --- a/openerpcommand/initialize.py +++ b/openerpcommand/initialize.py @@ -9,26 +9,6 @@ import time import common -def install_openerp(database_name, create_database_flag, module_names, install_demo_data): - import openerp - config = openerp.tools.config - - if create_database_flag: - with lock_file('/tmp/global_openerp_create_database.lock'): - create_database(database_name) - - config['init'] = dict.fromkeys(module_names, 1) - - # Install the import hook, to import openerp.addons.. - openerp.modules.module.initialize_sys_path() - - print - - registry = openerp.modules.registry.RegistryManager.get( - database_name, update_module=True, force_demo=install_demo_data) - - return registry - # From http://code.activestate.com/recipes/576572/ @contextlib.contextmanager def lock_file(path, wait_delay=.1, max_try=600): @@ -52,21 +32,6 @@ def lock_file(path, wait_delay=.1, max_try=600): os.close(fd) os.unlink(path) -# TODO turn template1 in a parameter -# This should be exposed from openerp (currently in -# openerp/service/web_services.py). -def create_database(database_name): - import openerp - db = openerp.sql_db.db_connect('template1') - cr = db.cursor() # TODO `with db as cr:` - try: - cr.autocommit(True) - cr.execute("""CREATE DATABASE "%s" - ENCODING 'unicode' TEMPLATE "template1" """ \ - % (database_name,)) - finally: - cr.close() - def run(args): assert args.database assert not (args.module and args.all_modules) @@ -74,6 +39,7 @@ def run(args): import openerp config = openerp.tools.config + config['db_name'] = args.database if args.tests: config['log_handler'] = [':INFO'] @@ -92,14 +58,13 @@ def run(args): args.addons = [] config['addons_path'] = ','.join(args.addons) - print "MY addons path is", config['addons_path'] - if args.all_modules: module_names = common.get_addons_from_paths(args.addons, args.exclude) elif args.module: module_names = args.module else: module_names = ['base'] + config['init'] = dict.fromkeys(module_names, 1) if args.coverage: import coverage @@ -108,17 +73,22 @@ def run(args): cov = coverage.coverage(branch=True, include='*.py') cov.start() openerp.netsvc.init_logger() - registry = install_openerp(args.database, not args.no_create, module_names, not config['without_demo']) + + if not args.no_create: + with lock_file('/tmp/global_openerp_create_database.lock'): + openerp.service.db._create_empty_database(args.database) + + config['workers'] = False + + rc = openerp.service.server.start(preload=[args.database], stop=True) + if args.coverage: cov.stop() cov.html_report(directory='coverage') # If we wanted the report on stdout: # cov.report() - # The `_assertion_report` attribute was added on the registry during the - # OpenERP 7.0 development. - if hasattr(registry, '_assertion_report'): - sys.exit(1 if registry._assertion_report.failures else 0) + sys.exit(rc) def add_parser(subparsers): parser = subparsers.add_parser('initialize',