changeset be01a2ddcb79 in modules/analytic_sale:default
details:
https://hg.tryton.org/modules/analytic_sale?cmd=changeset;node=be01a2ddcb79
description:
Remove mandatory on analytic roots
Having required field managed by user breaks automated workflows.
issue7605
review70531002
diffstat:
tests/scenario_analytic_sale.rst | 30 +++++-------------------------
1 files changed, 5 insertions(+), 25 deletions(-)
diffs (79 lines):
diff -r 157ecbc3e862 -r be01a2ddcb79 tests/scenario_analytic_sale.rst
--- a/tests/scenario_analytic_sale.rst Sat Jan 26 01:10:47 2019 +0100
+++ b/tests/scenario_analytic_sale.rst Mon Feb 18 18:39:29 2019 +0100
@@ -60,12 +60,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 parties::
@@ -112,17 +106,10 @@
>>> sale.payment_term = payment_term
>>> sale.invoice_method = 'order'
>>> sale_line = sale.lines.new()
- >>> entry, mandatory_entry = sale_line.analytic_accounts
+ >>> entry, = sale_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
>>> sale_line.product = product
>>> sale_line.quantity = 5
>>> sale.click('quote')
@@ -134,11 +121,9 @@
>>> Invoice = Model.get('account.invoice')
>>> invoice = Invoice(sale.invoices[0].id)
>>> invoice_line, = invoice.lines
- >>> entry, mandatory_entry = invoice_line.analytic_accounts
+ >>> entry, = invoice_line.analytic_accounts
>>> entry.account == analytic_account
True
- >>> mandatory_entry.account == mandatory_analytic_account
- True
Sale with an empty analytic account::
@@ -150,8 +135,7 @@
>>> sale.payment_term = payment_term
>>> sale.invoice_method = 'order'
>>> sale_line = sale.lines.new()
- >>> entry, mandatory_entry = sale_line.analytic_accounts
- >>> mandatory_entry.account = mandatory_analytic_account
+ >>> entry, = sale_line.analytic_accounts
>>> sale_line.product = product
>>> sale_line.quantity = 5
>>> sale.click('quote')
@@ -162,10 +146,8 @@
Check invoice analytic accounts::
>>> invoice_line, = invoice.lines
- >>> entry, mandatory_entry = invoice_line.analytic_accounts
+ >>> entry, = invoice_line.analytic_accounts
>>> entry.account
- >>> mandatory_entry.account == mandatory_analytic_account
- True
Return sales using the wizard::
@@ -176,7 +158,5 @@
... ('state', '=', 'draft'),
... ])
>>> sale_line, = returned_sale.lines
- >>> entry, mandatory_entry = sale_line.analytic_accounts
+ >>> entry, = sale_line.analytic_accounts
>>> entry.account
- >>> mandatory_entry.account == mandatory_analytic_account
- True