Commit 8f76608b authored by Jérome Perrin's avatar Jérome Perrin

accounting: make it possible to delete in cancelled state

There is no good reason to prevent editing in cancelled state and
it can be needed, for example to remove a cancelled payment
transaction from a payment transaction group.
parent 79cbb949
Pipeline #25702 failed with stage
in 0 seconds
...@@ -1053,6 +1053,22 @@ class TestTransactionValidation(AccountingTestCase): ...@@ -1053,6 +1053,22 @@ class TestTransactionValidation(AccountingTestCase):
self.assertFalse(_checkPermission('Modify portal content', self.assertFalse(_checkPermission('Modify portal content',
accounting_transaction)) accounting_transaction))
another_accounting_transaction = self._makeOne(
portal_type='Accounting Transaction',
start_date=DateTime('2007/01/02'),
destination_section_value=self.organisation_module.client_1,
lines=(dict(source_value=self.account_module.payable,
destination_value=self.account_module.receivable,
source_debit=500),
dict(source_value=self.account_module.receivable,
destination_value=self.account_module.payable,
source_credit=500)))
doActionFor(another_accounting_transaction, 'cancel_action')
self.assertEqual('cancelled', another_accounting_transaction.getSimulationState())
self.assertTrue(_checkPermission('Modify portal content',
another_accounting_transaction))
def test_UneededSourceAssetPrice(self): def test_UneededSourceAssetPrice(self):
# It is refunsed to validate an accounting transaction if lines have an # It is refunsed to validate an accounting transaction if lines have an
# asset price but the resource is the same as the accounting resource # asset price but the resource is the same as the accounting resource
......
...@@ -85,11 +85,11 @@ ...@@ -85,11 +85,11 @@
<key> <string>Access contents information</string> </key> <key> <string>Access contents information</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Assignee</string>
<string>Manager</string> <string>Manager</string>
<string>Auditor</string>
<string>Owner</string> <string>Owner</string>
</tuple> </tuple>
</value> </value>
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
<key> <string>Add portal content</string> </key> <key> <string>Add portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -106,6 +108,8 @@ ...@@ -106,6 +108,8 @@
<key> <string>Delete objects</string> </key> <key> <string>Delete objects</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -114,6 +118,8 @@ ...@@ -114,6 +118,8 @@
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -122,11 +128,11 @@ ...@@ -122,11 +128,11 @@
<key> <string>View</string> </key> <key> <string>View</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string> <string>Assignee</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Auditor</string>
<string>Associate</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -85,11 +85,11 @@ ...@@ -85,11 +85,11 @@
<key> <string>Access contents information</string> </key> <key> <string>Access contents information</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Assignee</string>
<string>Manager</string> <string>Manager</string>
<string>Auditor</string>
<string>Owner</string> <string>Owner</string>
</tuple> </tuple>
</value> </value>
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
<key> <string>Add portal content</string> </key> <key> <string>Add portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -106,6 +108,8 @@ ...@@ -106,6 +108,8 @@
<key> <string>Delete objects</string> </key> <key> <string>Delete objects</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -114,6 +118,8 @@ ...@@ -114,6 +118,8 @@
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -122,11 +128,11 @@ ...@@ -122,11 +128,11 @@
<key> <string>View</string> </key> <key> <string>View</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string> <string>Assignee</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Auditor</string>
<string>Associate</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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