From 66c8141cc3d047327546de26e6f5bf48f466f6ec Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Tue, 9 Mar 2010 15:13:05 +0100 Subject: [PATCH 1/8] [REF] Cleanup and moved test to demo. bzr revid: jth@openerp.com-20100309141305-dgtazi5rew9h9sgr --- addons/account/__terp__.py | 1 + .../{test => demo}/price_accuracy00.yml | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) rename addons/account/{test => demo}/price_accuracy00.yml (81%) diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index a09b20d33f5..fc2e980c9f5 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -62,6 +62,7 @@ 'account_installer.xml', ], 'demo_xml': [ + 'demo/price_accuracy00.yml', 'account_demo.xml', 'project/project_demo.xml', 'project/analytic_account_demo.xml', diff --git a/addons/account/test/price_accuracy00.yml b/addons/account/demo/price_accuracy00.yml similarity index 81% rename from addons/account/test/price_accuracy00.yml rename to addons/account/demo/price_accuracy00.yml index 48b5ceca35b..81023395141 100644 --- a/addons/account/test/price_accuracy00.yml +++ b/addons/account/demo/price_accuracy00.yml @@ -49,7 +49,7 @@ - # This is not working, find a way to do that in YAML, *qty is not # interpreted because it's not a node. - And this account entry must have a credit equals to 163.70€ which is + And this account entry must have a credit equals to 163.97€ which is equal to *qty x *price x (1 + *tax) - !assert {model: account.invoice, id: invoice1}: @@ -76,17 +76,21 @@ - !python {model: account.invoice}: | self.action_move_create(cr, uid, [ref("invoice2")]) -- - !python {model: account.invoice}: | - invoice = self.browse(cr, uid, ref("invoice2")) - log(sum(x.credit for x in invoice.move_id.line_id)) - assert (sum(x.credit for x in invoice.move_id.line_id) - 163.968) < 0.000001, "Pas bon !!!" -- - !assert {model: account.invoice, id: invoice2}: - test: - - abs(sum(x.credit for x in move_id.line_id) - 163.968) < 0.000001 +- + Then this account entry must have a credit equals to the debit - !assert {model: account.invoice, id: invoice2}: test: - abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001 +- + And this account entry must have a credit equals to 163.968€ which is + equal to *qty x *price x (1 + *tax) +- + !python {model: account.invoice}: | + xid = "invoice2" + invoice = self.browse(cr, uid, ref(xid)) + sum_of_credits = sum(x.credit for x in invoice.move_id.line_id) + log("The sum of credits for %s is %f", xid, sum_of_credits) + expected_value = 163.968 + assert (sum_of_credits - expected_value) < 0.000001, "Wrong sum of credits: %f <> %f" % (sum_of_credits, expected_value) From 646b9aa0ab6c31da18f82f1a771686beb20f6f83 Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Tue, 9 Mar 2010 16:35:26 +0100 Subject: [PATCH 2/8] [IMP] Added YAML version of account structure test. bzr revid: jth@openerp.com-20100309153526-rx4mflcmn31v6o3w --- addons/account/__terp__.py | 1 + addons/account/test/test_parent_structure.yml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/account/test/test_parent_structure.yml diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index fc2e980c9f5..bbfbc085ff4 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -38,6 +38,7 @@ 'website': 'http://www.openerp.com', 'init_xml': [], 'update_xml': [ + 'test/test_parent_structure.yml', 'security/account_security.xml', 'security/ir.model.access.csv', 'account_menuitem.xml', diff --git a/addons/account/test/test_parent_structure.yml b/addons/account/test/test_parent_structure.yml new file mode 100644 index 00000000000..aed40e6f0f3 --- /dev/null +++ b/addons/account/test/test_parent_structure.yml @@ -0,0 +1,20 @@ +- + We retrieve all accounts and test they are in a tree data structure. +- + !python {model: account.account}: | + ids = self.search(cr, uid, []) + accounts_list = self.read(cr, uid, ids, ['parent_id','parent_left','parent_right']) + accounts = dict((x['id'], x) for x in accounts_list) + log("Testing parent structure for %d accounts", len(accounts_list)) + for a in accounts_list: + if a['parent_id']: + assert a['parent_left'] > accounts[a['parent_id'][0]]['parent_left'] + assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right'] + assert a['parent_left'] < a['parent_right'] + for a2 in accounts_list: + assert not ((a2['parent_right'] > a['parent_left']) and + (a2['parent_left'] < a['parent_left']) and + (a2['parent_right'] < a['parent_right'])) + if a2['parent_id']==a['id']: + assert (a2['parent_left'] > a['parent_left']) and (a2['parent_right'] < a['parent_right']) + From 6b01bd6f6870896d2acceede8358505b1ce34764 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 9 Mar 2010 17:42:11 +0100 Subject: [PATCH 3/8] [FIX] account: Disable the YAML test (jth will check the bug) bzr revid: stephane@openerp.com-20100309164211-m7a23eh6t67mlgju --- addons/account/__terp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index bbfbc085ff4..1c58efb161f 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -38,7 +38,7 @@ 'website': 'http://www.openerp.com', 'init_xml': [], 'update_xml': [ - 'test/test_parent_structure.yml', + #'test/test_parent_structure.yml', 'security/account_security.xml', 'security/ir.model.access.csv', 'account_menuitem.xml', @@ -63,7 +63,7 @@ 'account_installer.xml', ], 'demo_xml': [ - 'demo/price_accuracy00.yml', + #'demo/price_accuracy00.yml', 'account_demo.xml', 'project/project_demo.xml', 'project/analytic_account_demo.xml', From dc79eb07c6ee6c0bf57a581b7d06188d5e8610e7 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 9 Mar 2010 17:43:11 +0100 Subject: [PATCH 4/8] [FIX] account: Use the right xml id for the account workflow bzr revid: stephane@openerp.com-20100309164311-4rwzo3rdx404yf28 --- addons/account/account_invoice_workflow.xml | 2 +- addons/account/demo/account_minimal.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice_workflow.xml b/addons/account/account_invoice_workflow.xml index 1f41b9fb4ed..374a436e9ac 100644 --- a/addons/account/account_invoice_workflow.xml +++ b/addons/account/account_invoice_workflow.xml @@ -25,7 +25,7 @@ write({'state':'proforma'}) - + proforma2 write({'state':'proforma2'}) function diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index 9f15acb0449..37225273e03 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -1,6 +1,6 @@ - + + + view_hr_attendance_filter + hr.attendance + search + + + + + + + + hr.attendance.form hr.attendance From 68f85a1ee2fe55671c72b7e1aabd425d4207b79f Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 9 Mar 2010 18:05:42 +0100 Subject: [PATCH 8/8] [REF] hr_timesheet_sheet: Remove an unused view [IMP] hr_timesheet_sheet: Add the sheet_id field in the tree view of hr.attendance bzr revid: stephane@openerp.com-20100309170542-5zy2imvitdxk8506 --- .../hr_timesheet_sheet_view.xml | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index 772acf568e2..1aa048670d5 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -1,25 +1,6 @@ - - hr.timesheet.sheet.tree - hr_timesheet_sheet.sheet - tree - - - - - - - - - - - - - - - hr.timesheet.sheet.tree @@ -315,6 +296,17 @@ + + hr.attendance.tree + hr.attendance + tree + + + + + + +