[MERGE] forward port branch 9.0 up to cf163d19ee
This commit is contained in:
@@ -172,8 +172,8 @@ var DashBoard = form_common.FormWidget.extend({
|
|||||||
board.columns.push(actions);
|
board.columns.push(actions);
|
||||||
});
|
});
|
||||||
var arch = QWeb.render('DashBoard.xml', board);
|
var arch = QWeb.render('DashBoard.xml', board);
|
||||||
this.rpc('/web/view/add_custom', {
|
this.rpc('/web/view/edit_custom', { // do not forward-port > saas-15
|
||||||
view_id: this.view.fields_view.view_id,
|
custom_id: this.view.fields_view.custom_view_id, // do not forward-port > saas-15
|
||||||
arch: arch
|
arch: arch
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
data_manager.invalidate();
|
data_manager.invalidate();
|
||||||
|
|||||||
@@ -927,14 +927,18 @@ class DataSet(http.Controller):
|
|||||||
|
|
||||||
class View(http.Controller):
|
class View(http.Controller):
|
||||||
|
|
||||||
@http.route('/web/view/add_custom', type='json', auth="user")
|
@http.route('/web/view/edit_custom', type='json', auth="user")
|
||||||
def add_custom(self, view_id, arch):
|
def edit_custom(self, custom_id, arch):
|
||||||
CustomView = request.env['ir.ui.view.custom']
|
"""
|
||||||
CustomView.create({
|
Edit a custom view
|
||||||
'user_id': request.session.uid,
|
|
||||||
'ref_id': view_id,
|
:param int custom_id: the id of the edited custom view
|
||||||
'arch': arch
|
:param str arch: the edited arch of the custom view
|
||||||
})
|
:returns: dict with acknowledged operation (result set to True)
|
||||||
|
"""
|
||||||
|
|
||||||
|
custom_view = request.env['ir.ui.view.custom'].browse(custom_id)
|
||||||
|
custom_view.write({ 'arch': arch })
|
||||||
return {'result': True}
|
return {'result': True}
|
||||||
|
|
||||||
class TreeView(View):
|
class TreeView(View):
|
||||||
|
|||||||
@@ -11466,6 +11466,18 @@ msgstr ""
|
|||||||
msgid "Memos pad"
|
msgid "Memos pad"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base
|
||||||
|
#: code:addons/base/ir/ir_model.py:382
|
||||||
|
#, python-format
|
||||||
|
msgid "Model %s does not exist"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base
|
||||||
|
#: code:addons/base/ir/ir_model.py:383
|
||||||
|
#, python-format
|
||||||
|
msgid "Please specify a valid model for the object relation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.model.fields,field_description:base.field_ir_ui_menu_name
|
#: model:ir.model.fields,field_description:base.field_ir_ui_menu_name
|
||||||
#: model:ir.ui.view,arch_db:base.edit_menu
|
#: model:ir.ui.view,arch_db:base.edit_menu
|
||||||
|
|||||||
@@ -393,6 +393,13 @@ class IrModelFields(models.Model):
|
|||||||
def _onchange_ttype(self):
|
def _onchange_ttype(self):
|
||||||
self.copy = (self.ttype != 'one2many')
|
self.copy = (self.ttype != 'one2many')
|
||||||
if self.ttype == 'many2many' and self.model_id and self.relation:
|
if self.ttype == 'many2many' and self.model_id and self.relation:
|
||||||
|
if self.relation not in self.env:
|
||||||
|
return {
|
||||||
|
'warning': {
|
||||||
|
'title': _('Model %s does not exist') % self.relation,
|
||||||
|
'message': _('Please specify a valid model for the object relation'),
|
||||||
|
}
|
||||||
|
}
|
||||||
names = self._custom_many2many_names(self.model_id.model, self.relation)
|
names = self._custom_many2many_names(self.model_id.model, self.relation)
|
||||||
self.relation_table, self.column1, self.column2 = names
|
self.relation_table, self.column1, self.column2 = names
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user