Skip to content
Extraits de code Groupes Projets
Valider 04ae1637 rédigé par jordan's avatar jordan
Parcourir les fichiers

[update] report invoice and contribution deal with multi-modules (cg, riga, idf)

parent 9c656de0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -45,10 +45,33 @@ class AccountInvoiceReport(models.Model): ...@@ -45,10 +45,33 @@ class AccountInvoiceReport(models.Model):
], ],
} }
# ------------------------------------------------------
# Query
# ------------------------------------------------------
def _select(self): def _select(self):
select_str = """
SELECT
ROW_NUMBER() OVER(ORDER BY c.date_invoice, c.partner_id) AS id,
c.invoice_id,
c.date_invoice,
c.date_due,
c.number,
c.company_id,
c.partner_id,
c.user_id,
c.amount_untaxed_signed,
c.amount_total_signed,
c.residual_company_signed,
c.payment_mode_id,
c.type,
c.state
FROM (
"""
return select_str
def _subquery(self):
select_str = """ select_str = """
(SELECT (SELECT
id,
id AS invoice_id, id AS invoice_id,
date_invoice, date_invoice,
date_due, date_due,
...@@ -76,7 +99,7 @@ class AccountInvoiceReport(models.Model): ...@@ -76,7 +99,7 @@ class AccountInvoiceReport(models.Model):
tools.drop_view_if_exists(self.env.cr, self._table) tools.drop_view_if_exists(self.env.cr, self._table)
self.env.cr.execute("""CREATE or REPLACE VIEW %s as ( self.env.cr.execute("""CREATE or REPLACE VIEW %s as (
%s %s
)""" % (self._table, self._select())) )""" % (self._table, self._select() + self._subquery() + ') c '))
# ------------------------------------------------------ # ------------------------------------------------------
# Computed fields # Computed fields
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter