소스 검색

[FIX] ajustes varios

Rodney Elpidio Enciso Arias 6 년 전
부모
커밋
a3d3e60676
3개의 변경된 파일16개의 추가작업 그리고 11개의 파일을 삭제
  1. 9 4
      model/account.py
  2. BIN
      model/account.pyc
  3. 7 7
      static/src/js/main.js

+ 9 - 4
model/account.py

@@ -8,10 +8,14 @@ class AccountInvoice(models.Model):
 	@api.model
 	def getAccountInvoiceQuoteAnalysis(self,domain):
 		AccountInvoice = self.env['account.invoice'].search(domain)
-		AccountMoveLine = self.env['account.move.line'].search([('move_id','=',AccountInvoice.number),('debit','>',0)])
-		i = len(AccountMoveLine)
+		AccountMoveLine = self.env['account.move.line'].search([('move_id','=',AccountInvoice.number),('debit','>',0)],order='date_maturity')
+		# i = len(AccountMoveLine)
+		i = 1
 		x = len(AccountMoveLine)
 		values = []
+		# futbolistasTup.sort(key=lambda futbolista: futbolista[0])
+		# AccountMoveLine.sort(key=lambda futbolista: date_maturity)
+		# import web_pdb; web_pdb.set_trace()
 		for line in AccountMoveLine:
 			amount = 0
 			value = 0
@@ -32,7 +36,7 @@ class AccountInvoice(models.Model):
 				'amount': line.debit,
 				'residual': line.amount_residual,
 			})
-			i = i - 1
+			i = i + 1
 
 		return values
 
@@ -41,7 +45,8 @@ class ResCurrrency(models.Model):
 
 	@api.model
 	def getResCurrencyQuoteAnalysis(self,domain):
-		ResCurrency = self.env['res.currency'].search(domain)
+		AccountInvoice = self.env['account.invoice'].search(domain)
+		ResCurrency = self.env['res.currency'].search([('id','=',AccountInvoice.currency_id.id)])
 		values = []
 		for currency in ResCurrency:
 			values.append({

BIN
model/account.pyc


+ 7 - 7
static/src/js/main.js

@@ -43,7 +43,7 @@ openerp.eiru_quota_analysis = function (instance, local) {
         fetchResCurrency: function (){
             var self = this;
             var domain = [
-                ['base','=',true],
+                ['id','=',self.id],
             ];
             var ResCurrency = new model.web.Model('res.currency');
             return ResCurrency.call('getResCurrencyQuoteAnalysis',[domain], {
@@ -62,13 +62,13 @@ openerp.eiru_quota_analysis = function (instance, local) {
                     state = item.state + ' ( ' + accounting.formatMoney(item.value, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator) + ' )';
                 }else{
                     state = item.state;
-                };
-                date = moment(item.date).format('DD/MM/YYYY')
+                }
+                date = moment(item.date).format('DD/MM/YYYY');
                 if(item.state != 'Pagado'){
                     if(item.date < moment().format('YYYY-MM-DD')){
                         date = moment(item.date,'YYYY-MM-DD').format('DD/MM/YYYY') + ' (vencido) ';
-                    };
-                };
+                    }
+                }
                 data.push({
                     'date': date,
                     'name': item.name,
@@ -97,7 +97,7 @@ openerp.eiru_quota_analysis = function (instance, local) {
                 if (local.widgetInstance) {
                     local.widgetInstance.updateId(record.id);
                     local.widgetInstance.checkQuota(record.id);
-                    return
+                    return;
                 }
                 local.widgetInstance = new local.EiruQuotaAnalysisWidget(this);
                 var elemento = this.$el.find('.oe_form_sheet.oe_form_sheet_width');
@@ -108,4 +108,4 @@ openerp.eiru_quota_analysis = function (instance, local) {
             }
         });
     }
-}
+};