Removed issue3131002_20001.diff patch
This commit is contained in:
parent
082132510e
commit
511f17cf67
|
@ -1,31 +0,0 @@
|
|||
Index: invoice.py
|
||||
===================================================================
|
||||
|
||||
--- ./modules/account_invoice/invoice.py
|
||||
+++ ./modules/account_invoice/invoice.py
|
||||
@@ -6,7 +6,8 @@
|
||||
import operator
|
||||
from sql import Literal
|
||||
from sql.aggregate import Count, Sum
|
||||
-from sql.conditionals import Coalesce
|
||||
+from sql.conditionals import Coalesce, Case
|
||||
+from sql.functions import Abs
|
||||
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields
|
||||
from trytond.report import Report
|
||||
@@ -589,7 +590,13 @@
|
||||
condition=invoice.move == move.id
|
||||
).join(line, condition=move.id == line.move
|
||||
).select(invoice.id,
|
||||
- Coalesce(Sum(line.debit - line.credit), 0).cast(type_name),
|
||||
+ Coalesce(Sum(
|
||||
+ Case((line.second_currency == invoice.currency,
|
||||
+ Abs(line.amount_second_currency)
|
||||
+ * Abs(line.debit - line.credit)
|
||||
+ / (line.debit - line.credit)),
|
||||
+ else_=line.debit - line.credit)),
|
||||
+ 0).cast(type_name),
|
||||
where=(invoice.account == line.account) & red_sql,
|
||||
group_by=invoice.id))
|
||||
for invoice_id, sum_ in cursor.fetchall():
|
||||
|
Loading…
Reference in New Issue