diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index d437074023a..cf8bb5133fd 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -495,6 +495,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_asset/account_asset.py b/addons/account_asset/account_asset.py index 6792682fdbe..f4e5d17a8e0 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', diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 01c4b596592..ddcf41af352 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -9,7 +9,7 @@ Meeting Types Tree calendar.event.type - + diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 71654912ac0..19bc98c585a 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -264,14 +264,16 @@ class crm_phonecall(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, 'calendar', 'action_calendar_event', context) res['context'] = { 'default_phonecall_id': phonecall.id, - 'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False, + 'default_partner_ids': partner_ids, 'default_user_id': uid, 'default_email_from': phonecall.email_from, - 'default_state': 'open', 'default_name': phonecall.name, } return res diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml index 294e2b1702d..6380f80c89f 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -58,7 +58,7 @@ tree,calendar [] - {'default_state': 'done'} + {}

@@ -106,7 +106,7 @@ tree,calendar [('state','!=','done')] - + {}

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 - + diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index eac1f163cf6..5a5226cef81 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -378,20 +378,25 @@ 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): + + @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 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_published', '=', 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/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) diff --git a/addons/website/models/ir_actions.py b/addons/website/models/ir_actions.py index 731ee4c47e6..5f627eec54a 100644 --- a/addons/website/models/ir_actions.py +++ b/addons/website/models/ir_actions.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import urlparse + from openerp.addons.web.http import request from openerp.osv import fields, osv @@ -9,15 +11,43 @@ 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): + 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 = { + '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_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.'), } + 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..0573c87af31 100644 --- a/addons/website/views/ir_actions.xml +++ b/addons/website/views/ir_actions.xml @@ -6,10 +6,43 @@ ir.actions.server.form.website ir.actions.server + + + + + + + + + + + + + + + + ir.actions.server.tree.website + ir.actions.server + + + + + + + + + + ir.actions.server.search.website + ir.actions.server + - +