Commit 38b70722 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py2/py3: async is a reserved word in Python 3.7 or later.

parent 8ef95688
"""Resets grouping reference on this line and all related lines. """Resets grouping reference on this line and all related lines.
This runs by default asynchronously, but can be call with `async=False` to This runs by default asynchronoushronously, but can be call with `asynchronous=False` to
run synchronously and returns the list of ungrouped lines. With `async=True`, run synchronously and returns the list of ungrouped lines. With `asynchronous=True`,
the returned list is always empty. the returned list is always empty.
""" """
...@@ -13,7 +13,7 @@ if not context.getGroupingReference(): ...@@ -13,7 +13,7 @@ if not context.getGroupingReference():
portal = context.getPortalObject() portal = context.getPortalObject()
resetGroupingReference = portal.ERP5Site_resetAccountingTransactionLineGroupingReference resetGroupingReference = portal.ERP5Site_resetAccountingTransactionLineGroupingReference
if async: if asynchronous:
resetGroupingReference = portal.portal_simulation.activate( resetGroupingReference = portal.portal_simulation.activate(
activity='SQLQueue', activity='SQLQueue',
after_tag='accounting_grouping_reference' after_tag='accounting_grouping_reference'
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>async=True</string> </value> <value> <string>asynchronous=True</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -119,7 +119,7 @@ else: ...@@ -119,7 +119,7 @@ else:
if line.getGroupingReference(): if line.getGroupingReference():
# Call AccountingTransactionLine_resetGroupingReference synchronously # Call AccountingTransactionLine_resetGroupingReference synchronously
# to know the number of ungrouped lines. # to know the number of ungrouped lines.
ungrouped_line_list.extend(line.AccountingTransactionLine_resetGroupingReference(async=False)) ungrouped_line_list.extend(line.AccountingTransactionLine_resetGroupingReference(asynchronous=False))
psm = Base_translateString('${ungrouped_line_count} lines ungrouped.', psm = Base_translateString('${ungrouped_line_count} lines ungrouped.',
mapping=dict(ungrouped_line_count=len(ungrouped_line_list))) mapping=dict(ungrouped_line_count=len(ungrouped_line_list)))
......
...@@ -3907,7 +3907,7 @@ class TestTransactions(AccountingTestCase): ...@@ -3907,7 +3907,7 @@ class TestTransactions(AccountingTestCase):
# reset from the payment line, the invoice line from the same group will be # reset from the payment line, the invoice line from the same group will be
# ungrouped # ungrouped
payment_line.AccountingTransactionLine_resetGroupingReference(async=False) payment_line.AccountingTransactionLine_resetGroupingReference(asynchronous=False)
self.assertFalse(payment_line.getGroupingReference()) self.assertFalse(payment_line.getGroupingReference())
self.assertFalse(payment_line.getGroupingDate()) self.assertFalse(payment_line.getGroupingDate())
self.assertFalse(invoice_line.getGroupingReference()) self.assertFalse(invoice_line.getGroupingReference())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment