|
@@ -12,6 +12,7 @@ class ResPartner(models.Model):
|
|
for customer in self.env['res.partner'].search(domain):
|
|
for customer in self.env['res.partner'].search(domain):
|
|
categories = []
|
|
categories = []
|
|
invoices = []
|
|
invoices = []
|
|
|
|
+ partner_invoice = []
|
|
|
|
|
|
for category in customer.category_id:
|
|
for category in customer.category_id:
|
|
categories.append({
|
|
categories.append({
|
|
@@ -20,7 +21,17 @@ class ResPartner(models.Model):
|
|
'display_name': category.display_name
|
|
'display_name': category.display_name
|
|
})
|
|
})
|
|
|
|
|
|
- for invoice in customer.invoice_ids:
|
|
|
|
|
|
+ for invoice_ids in customer.invoice_ids:
|
|
|
|
+ if invoice_ids.state == 'open':
|
|
|
|
+ partner_invoice.append(invoice_ids.id)
|
|
|
|
+
|
|
|
|
+ if customer.is_company == True:
|
|
|
|
+ for child in customer.child_ids:
|
|
|
|
+ for invoice_ids in child.invoice_ids:
|
|
|
|
+ if invoice_ids.state == 'open':
|
|
|
|
+ partner_invoice.append(invoice_ids.id)
|
|
|
|
+
|
|
|
|
+ for invoice in self.env['account.invoice'].browse(partner_invoice):
|
|
movelines = []
|
|
movelines = []
|
|
moves = []
|
|
moves = []
|
|
currency_symbol = ""
|
|
currency_symbol = ""
|
|
@@ -47,12 +58,7 @@ class ResPartner(models.Model):
|
|
'amount_total': invoice.amount_total,
|
|
'amount_total': invoice.amount_total,
|
|
'residual': invoice.residual,
|
|
'residual': invoice.residual,
|
|
'moveLines': movelines,
|
|
'moveLines': movelines,
|
|
- 'currency_symbol' : currency_symbol,
|
|
|
|
- 'moves' :{
|
|
|
|
- 'id': invoice.move_id.id,
|
|
|
|
- 'name': invoice.move_id.name,
|
|
|
|
- 'date': invoice.move_id.date
|
|
|
|
- }
|
|
|
|
|
|
+ 'currency_symbol' : currency_symbol
|
|
})
|
|
})
|
|
|
|
|
|
partners.append({
|
|
partners.append({
|