|
@@ -6,19 +6,20 @@ openerp.eiru_quota_analysis = function (instance, local) {
|
|
|
template : "eiru_quota_analysis.EiruQuotaAnalysis",
|
|
|
checkQuota: function(id) {
|
|
|
var self = this;
|
|
|
- self.id = id;
|
|
|
- if (id)
|
|
|
- self.Initial();
|
|
|
+ self.Initial();
|
|
|
},
|
|
|
start: function () {
|
|
|
var self = this;
|
|
|
var table = $('#quota_table');
|
|
|
table.bootstrapTable({data : self.rowsData});
|
|
|
},
|
|
|
+ updateId : function(id){
|
|
|
+ var self = this;
|
|
|
+ self.id = id;
|
|
|
+ },
|
|
|
Initial: function(){
|
|
|
var self = this;
|
|
|
- var id = openerp.webclient._current_state.id;
|
|
|
- self.fetchAccountInvoice(id).then(function (AccountInvoice){
|
|
|
+ self.fetchAccountInvoice().then(function (AccountInvoice){
|
|
|
return AccountInvoice;
|
|
|
}).then(function(AccountInvoice){
|
|
|
self.AccountInvoice = AccountInvoice;
|
|
@@ -29,10 +30,10 @@ openerp.eiru_quota_analysis = function (instance, local) {
|
|
|
});
|
|
|
return;
|
|
|
},
|
|
|
- fetchAccountInvoice: function (id){
|
|
|
+ fetchAccountInvoice: function (){
|
|
|
var self = this;
|
|
|
var domain = [
|
|
|
- ['id','=',id],
|
|
|
+ ['id','=',self.id],
|
|
|
];
|
|
|
var AccountInvoice = new model.web.Model('account.invoice');
|
|
|
return AccountInvoice.call('getAccountInvoiceQuoteAnalysis',[domain], {
|
|
@@ -51,6 +52,7 @@ openerp.eiru_quota_analysis = function (instance, local) {
|
|
|
},
|
|
|
build: function(){
|
|
|
var self = this;
|
|
|
+ console.log(self);
|
|
|
var data = [];
|
|
|
var state = '';
|
|
|
var date = '';
|
|
@@ -93,6 +95,7 @@ openerp.eiru_quota_analysis = function (instance, local) {
|
|
|
|
|
|
local.parentInstance = this;
|
|
|
if (local.widgetInstance) {
|
|
|
+ local.widgetInstance.updateId(record.id);
|
|
|
local.widgetInstance.checkQuota(record.id);
|
|
|
return
|
|
|
}
|
|
@@ -100,6 +103,7 @@ openerp.eiru_quota_analysis = function (instance, local) {
|
|
|
var elemento = this.$el.find('.oe_form_sheet.oe_form_sheet_width');
|
|
|
elemento = elemento.find('.quota_box');
|
|
|
local.widgetInstance.appendTo(elemento);
|
|
|
+ local.widgetInstance.updateId(record.id);
|
|
|
local.widgetInstance.checkQuota(record.id);
|
|
|
}
|
|
|
});
|