changeset 9c877cee41e9 in modules/analytic_invoice:default
details:
https://hg.tryton.org/modules/analytic_invoice?cmd=changeset;node=9c877cee41e9
description:
Remove mandatory on analytic roots
Having required field managed by user breaks automated workflows.
issue7605
review70531002
diffstat:
tests/scenario_analytic_invoice.rst | 33 ++-------------------------------
1 files changed, 2 insertions(+), 31 deletions(-)
diffs (78 lines):
diff -r 1a3532fb7ded -r 9c877cee41e9 tests/scenario_analytic_invoice.rst
--- a/tests/scenario_analytic_invoice.rst Sat Jan 26 01:10:47 2019 +0100
+++ b/tests/scenario_analytic_invoice.rst Mon Feb 18 18:39:29 2019 +0100
@@ -47,12 +47,6 @@
>>> analytic_account = AnalyticAccount(root=root, parent=root,
... name='Analytic')
>>> analytic_account.save()
- >>> mandatory_root = AnalyticAccount(type='root', name='Root',
- ... mandatory=True)
- >>> mandatory_root.save()
- >>> mandatory_analytic_account = AnalyticAccount(root=mandatory_root,
- ... parent=mandatory_root, name='Mandatory Analytic')
- >>> mandatory_analytic_account.save()
Create party::
@@ -95,17 +89,10 @@
>>> invoice.party = party
>>> invoice.payment_term = payment_term
>>> line = invoice.lines.new()
- >>> entry, mandatory_entry = line.analytic_accounts
+ >>> entry, = line.analytic_accounts
>>> entry.root == root
True
- >>> bool(entry.required)
- False
>>> entry.account = analytic_account
- >>> mandatory_entry.root == mandatory_root
- True
- >>> bool(mandatory_entry.required)
- True
- >>> mandatory_entry.account = mandatory_analytic_account
>>> line.product = product
>>> line.quantity = 5
>>> line.unit_price = Decimal('40')
@@ -117,11 +104,6 @@
Decimal('200.00')
>>> analytic_account.debit
Decimal('0.00')
- >>> mandatory_analytic_account.reload()
- >>> mandatory_analytic_account.credit
- Decimal('200.00')
- >>> mandatory_analytic_account.debit
- Decimal('0.00')
Create invoice with an empty analytic account::
@@ -130,8 +112,7 @@
>>> invoice.party = party
>>> invoice.payment_term = payment_term
>>> line = invoice.lines.new()
- >>> entry, mandatory_entry = line.analytic_accounts
- >>> mandatory_entry.account = mandatory_analytic_account
+ >>> entry, = line.analytic_accounts
>>> line.product = product
>>> line.quantity = 1
>>> line.unit_price = Decimal('40')
@@ -143,11 +124,6 @@
Decimal('200.00')
>>> analytic_account.debit
Decimal('0.00')
- >>> mandatory_analytic_account.reload()
- >>> mandatory_analytic_account.credit
- Decimal('240.00')
- >>> mandatory_analytic_account.debit
- Decimal('0.00')
Credit invoice with refund::
@@ -157,8 +133,3 @@
>>> invoice.reload()
>>> invoice.state
'cancel'
- >>> mandatory_analytic_account.reload()
- >>> mandatory_analytic_account.credit
- Decimal('240.00')
- >>> mandatory_analytic_account.debit
- Decimal('40.00')