[MERGE] Modified Form Fields to able to set their value before they are rendered

bzr revid: nicolas.vanhoren@openerp.com-20121016123645-ikqfkx7p4tsae2hh
This commit is contained in:
niv-openerp
2012-10-16 14:36:45 +02:00
3 changed files with 8 additions and 18 deletions
+1 -8
View File
@@ -1155,14 +1155,7 @@ openerp.mail = function(session) {
_check_visibility: function() {
this.$el.toggle(this.view.get("actual_mode") !== "create");
},
/**
* Reinitialize the widget field and Display the threads
* @param {Object} new_context: context of the refresh
*/
set_value: function() {
var self = this;
this._super.apply(this, arguments);
render_value: function() {
if (! this.view.datarecord.id || session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) {
this.$('oe_mail_thread').hide();
return;
+2 -2
View File
@@ -88,9 +88,9 @@ openerp_mail_followers = function(session, mail) {
});
},
set_value: function(value_) {
render_value: function() {
this.reinit();
return this.fetch_followers(value_ || this.get_value());
return this.fetch_followers(this.get("value"));
},
set_is_follower: function(value_) {
+5 -8
View File
@@ -4,16 +4,13 @@ openerp.pad = function(instance) {
template: 'FieldPad',
configured: false,
content: "",
set_value: function(val) {
render_value: function() {
var self = this;
var _super = self._super;
_super.apply(self,[val]);
if (val === false || val === "") {
self.field_manager.dataset.call('pad_generate_url',{context:{
model: self.field_manager.model,
if (this.get("value") === false || this.get("value") === "") {
self.view.dataset.call('pad_generate_url',{context:{
model: self.view.model,
field_name: self.name,
object_id: self.field_manager.datarecord.id
object_id: self.view.datarecord.id
}}).then(function(data) {
if(data&&data.url){
_super.apply(self,[data.url]);