[MERGE] Merge with trunk upto revision no 664.

bzr revid: ysa@tinyerp.com-20110721051803-ljk33jb5oikrqgx3
This commit is contained in:
Yogesh (OpenERP)
2011-07-21 10:48:03 +05:30
7 changed files with 46 additions and 29 deletions
+2 -2
View File
@@ -1784,7 +1784,7 @@ openerp.base.form.FieldMany2Many = openerp.base.form.Field.extend({
self.on_ui_change();
});
this.list_view = new openerp.base.form.Many2ManyListView(this.view.view_manager, this.list_id, this.dataset, false, {
this.list_view = new openerp.base.form.Many2ManyListView(new openerp.base.NullViewManager(this), this.list_id, this.dataset, false, {
'addable': 'Add',
'selectable': self.multi_selection
});
@@ -1918,7 +1918,7 @@ openerp.base.form.SelectCreatePopup = openerp.base.BaseWidget.extend({
$sbutton.click(function() {
self.on_select_elements(self.selected_ids);
});
self.view_list = new openerp.base.form.SelectCreateListView(this,
self.view_list = new openerp.base.form.SelectCreateListView(self,
self.element_id + "_view_list", self.dataset, false,
{'deletable': false});
self.view_list.popup = self;
+2 -1
View File
@@ -391,7 +391,8 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi
this.groups.apoptosis().render());
this.hidden = false;
}
this.view_manager.sidebar.do_refresh(true);
if(this.view_manager.sidebar)
this.view_manager.sidebar.do_refresh(true);
},
do_hide: function () {
this.$element.hide();
+23 -15
View File
@@ -593,32 +593,40 @@ openerp.base.search.BooleanField = openerp.base.search.Field.extend({
}
}
});
openerp.base.search.IntegerField = openerp.base.search.Field.extend({
openerp.base.search.NumberField = openerp.base.search.Field.extend(/** @lends openerp.base.search.NumberField# */{
get_value: function () {
if (!this.$element.val()) {
return null;
}
var val = parseInt(this.$element.val());
var check = Number(this.$element.val());
if (isNaN(check) || val !== check) {
var val = this.parse(this.$element.val()),
check = Number(this.$element.val());
if (isNaN(val) || val !== check) {
this.$element.addClass('error');
throw new openerp.base.search.Invalid(
this.attrs.name, this.$element.val(), "not a valid integer");
this.attrs.name, this.$element.val(), this.error_message);
}
this.$element.removeClass('error');
return val;
}
});
openerp.base.search.FloatField = openerp.base.search.Field.extend({
get_value: function () {
var val = Number(this.$element.val());
if (isNaN(val)) {
this.$element.addClass('error');
throw new openerp.base.search.Invalid(
this.attrs.name, this.$element.val(), "not a valid number");
}
this.$element.removeClass('error');
return val;
/**
* @class
* @extends openerp.base.search.NumberField
*/
openerp.base.search.IntegerField = openerp.base.search.NumberField.extend(/** @lends openerp.base.search.IntegerField# */{
error_message: "not a valid integer",
parse: function (value) {
return parseInt(value, 10);
}
});
/**
* @class
* @extends openerp.base.search.NumberField
*/
openerp.base.search.FloatField = openerp.base.search.NumberField.extend(/** @lends openerp.base.search.FloatField# */{
error_message: "not a valid number",
parse: function (value) {
return parseFloat(value);
}
});
openerp.base.search.SelectionField = openerp.base.search.Field.extend({
+4 -2
View File
@@ -268,8 +268,10 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
});
openerp.base.NullViewManager = openerp.base.generate_null_object_class(openerp.base.ViewManager, {
init: function() {
this._super();
init: function(parent) {
this._super(parent);
if(parent)
this.session = parent.session;
this.action = {flags: {}};
this.sidebar = new openerp.base.NullSidebar();
}
+3 -3
View File
@@ -143,8 +143,8 @@
<div class="company_logo" />
</a>
<h1 class="header_title" t-if="session.session_is_valid()">
<span class="company">$company</span> - (<span class="database">$database</span>)<br/>
<small class="username">$username session_id: <t t-esc="session.session_id"/></small>
<span class="database"><t t-esc="session.db"/></span> - <t t-esc="session.login"/> <br/>
<small class="username">rpc_session_id: <t t-esc="session.session_id"/></small>
</h1>
<div class="header_corner">
<ul class="block" t-if="session.session_is_valid()">
@@ -521,7 +521,7 @@
<img src="/base/static/src/img/icons/gtk-index.png"/></span>
<div t-att-id="widget.cm_id" class="contextMenu" style="display:none"><ul>
<li t-att-id="widget.cm_id + '_open'" style="color:grey">Open...</li>
<li t-att-id="widget.cm_id + '_create'">Create and Edit...</li>
<li t-att-id="widget.cm_id + '_create'">Create...</li>
<li t-att-id="widget.cm_id + '_search'">Search...</li>
</ul></div>
</div>
+9 -1
View File
@@ -76,12 +76,20 @@ openerp.base_graph.GraphView = openerp.base.View.extend({
load_chart: function(data) {
var self = this;
var domain = false;
if(data){
this.x_title = this.all_fields[this.chart_info_fields]['string'];
this.y_title = this.all_fields[this.operator_field]['string'];
self.schedule_chart(data);
}else{
this.dataset.read_slice(this.fields, 0, false, function(res) {
if(! _.isEmpty(this.view_manager.dataset.domain)){
domain = this.view_manager.dataset.domain;
}else if(! _.isEmpty(this.view_manager.action.domain)){
domain = this.view_manager.action.domain;
}
this.dataset.domain = domain;
this.dataset.context = this.view_manager.dataset.context;
this.dataset.read_slice(_(this.fields).keys(), 0, false, function(res) {
self.schedule_chart(res);
});
}
@@ -1,6 +1,4 @@
<template>
<t t-name="GraphView">
<h2 class="oe_view_title"><t t-esc="fields_view.arch.attrs.string"/></h2>
<div t-att-id="elem_id+'-'+chart+'chart'" style="height:300px;position:relative;"></div>
</t>
</template>
<div t-name="GraphView" t-att-id="elem_id+'-'+chart+'chart'"
style="height:300px;position:relative;"/>
</template>