|
@@ -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({
|