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):
self.assertFalse(_checkPermission('Modify portal content',
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):
# It is refunsed to validate an accounting transaction if lines have an
# asset price but the resource is the same as the accounting resource
......
......@@ -85,11 +85,11 @@
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Assignee</string>
<string>Manager</string>
<string>Auditor</string>
<string>Owner</string>
</tuple>
</value>
......@@ -98,6 +98,8 @@
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -106,6 +108,8 @@
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -114,6 +118,8 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -122,11 +128,11 @@
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Assignee</string>
<string>Manager</string>
<string>Auditor</string>
<string>Associate</string>
</tuple>
</value>
</item>
......
......@@ -85,11 +85,11 @@
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Assignee</string>
<string>Manager</string>
<string>Auditor</string>
<string>Owner</string>
</tuple>
</value>
......@@ -98,6 +98,8 @@
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -106,6 +108,8 @@
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -114,6 +118,8 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -122,11 +128,11 @@
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Assignee</string>
<string>Manager</string>
<string>Auditor</string>
<string>Associate</string>
</tuple>
</value>
</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