From 5a40116fc99aa18f4cb1699ede6dd6452abe3554 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 15:06:14 +0200 Subject: [PATCH 01/43] merge bzr revid: fp@tinyerp.com-20100901130614-1e3kyx2883hza0uw --- addons/account/project/project_view.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index bf0b186e1ea..132b0043fdb 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -51,16 +51,15 @@ tree child_ids - + + - - From 2c9f8e26960a6f1c37e285ac571562a64b9f3260 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Wed, 1 Sep 2010 19:22:31 +0530 Subject: [PATCH 02/43] [FIX] project_retro_planning: When testing project_long_term, a datetime value is passed down to bzr revid: hmo@tinyerp.com-20100901135231-f3w61kmqfey2rwzr --- addons/project_retro_planning/project_retro_planning.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/project_retro_planning/project_retro_planning.py b/addons/project_retro_planning/project_retro_planning.py index fd50fe64e50..d5667145c3d 100644 --- a/addons/project_retro_planning/project_retro_planning.py +++ b/addons/project_retro_planning/project_retro_planning.py @@ -33,7 +33,12 @@ class project_project(osv.osv): if vals.get('date', False): data_project = self.browse(cr, uid, ids) for prj in data_project: - new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) + if isinstance(vals['date'], datetime): + new_end_date = vals['date'].date() + elif isinstance(vals['date'], date): + new_end_date = vals['date'] + else: + new_end_date = date(*time.strptime(vals['date'],'%Y-%m-%d')[:3]) if prj.date: old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) for task in prj.tasks: From cba7507437ef1aabda06e2e6199a55361437d90d Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Wed, 1 Sep 2010 20:01:13 +0530 Subject: [PATCH 03/43] [FIX] project_scrum: project_timesheet demands that a product is attached to employees, but the order of module loading may break scrum's demo data. Use the context bzr revid: hmo@tinyerp.com-20100901143113-dk4gnmhi5s98vg07 --- addons/project_scrum/project_scrum_demo.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/project_scrum/project_scrum_demo.xml b/addons/project_scrum/project_scrum_demo.xml index bc79209b2e0..2c627c89b09 100644 --- a/addons/project_scrum/project_scrum_demo.xml +++ b/addons/project_scrum/project_scrum_demo.xml @@ -231,7 +231,7 @@ Demo :Bugfix - memory leak - + Learn how to migration @@ -239,7 +239,7 @@ Demo :Bugfix - memory leak - + Create a script for migration and testing @@ -247,7 +247,7 @@ Demo :Bugfix - memory leak - + Add on top or bottom and shortcuts From f8396e2c5640461d74f1507e2d720ad571cfc692 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 1 Sep 2010 20:37:22 +0530 Subject: [PATCH 04/43] [FIX] hr_expenses: improve check invoice test bzr revid: hmo@tinyerp.com-20100901150722-zl4ij8vaaxeneupd --- addons/hr_expense/test/test_hr_expense.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/addons/hr_expense/test/test_hr_expense.yml b/addons/hr_expense/test/test_hr_expense.yml index 5fa0175eba1..0ddbf50f053 100644 --- a/addons/hr_expense/test/test_hr_expense.yml +++ b/addons/hr_expense/test/test_hr_expense.yml @@ -93,15 +93,4 @@ - !python {model: hr.expense.expense}: | exp = self.browse(cr, uid, [ref('hr_expense_expense_september0')])[0] - invoice_obj = self.pool.get('account.invoice') - invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', exp.employee_id.address_id.partner_id.id)]) - invoice_id = invoice_obj.browse(cr, uid, invoice_ids)[0] - - for invoice in invoice_id.invoice_line: - product = invoice.product_id.id - - for line in exp.line_ids: - product_exp = line.product_id.id - assert product == product_exp - assert exp.id == invoice_id.id - + assert exp.invoice_id, "Invoice should be created" From 4fc1585f0b3f93610a95a129b966a8c5c7f8fa52 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 17:58:18 +0200 Subject: [PATCH 05/43] Testing Automated Tests bzr revid: fp@tinyerp.com-20100901155818-clzu4g4umxr9w5ok --- addons/account/product.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/product.py b/addons/account/product.py index 188c3260dff..56e721dcb06 100644 --- a/addons/account/product.py +++ b/addons/account/product.py @@ -48,6 +48,7 @@ product_category() #---------------------------------------------------------- # Products #---------------------------------------------------------- + class product_template(osv.osv): _inherit = "product.template" _columns = { @@ -76,5 +77,3 @@ class product_template(osv.osv): } product_template() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - From 379133b17f77351cf01538f84f54ac07b48481f2 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 1 Sep 2010 21:38:45 +0530 Subject: [PATCH 06/43] [FIX] sale,membership: yml issue bzr revid: hmo@tinyerp.com-20100901160845-53e8jddm95gsi6o5 --- addons/membership/test/test_membership.yml | 2 +- addons/sale/test/advance_invoice.yml | 7 ++++++- addons/sale/test/invoice_on_ordered_qty.yml | 7 ++++++- addons/sale/test/invoice_on_shipped_qty.yml | 5 +++++ addons/sale/test/manual_order_policy.yml | 5 +++++ addons/sale/test/picking_order_policy.yml | 5 +++++ addons/sale/test/postpaid_order_policy.yml | 7 ++++++- addons/sale/test/prepaid_order_policy.yml | 5 +++++ addons/sale/test/so_make_invoice.yml | 5 +++++ addons/sale/test/so_make_line_invoice.yml | 7 ++++++- 10 files changed, 50 insertions(+), 5 deletions(-) diff --git a/addons/membership/test/test_membership.yml b/addons/membership/test/test_membership.yml index 16ac0674ee8..9e2def844dc 100644 --- a/addons/membership/test/test_membership.yml +++ b/addons/membership/test/test_membership.yml @@ -157,7 +157,7 @@ membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids) assert membership_lines, _('Membership is not registrated.') membership_line = membership_lines[0] - refund_id = invoice_refund_pool.create(cr, uid, {'description': 'Refund of Membership'}, {'active_id': membership_line.account_invoice_id.id}) + refund_id = invoice_refund_pool.create(cr, uid, {'description': 'Refund of Membership', 'filter_refund': 'refund'}, {'active_id': membership_line.account_invoice_id.id}) invoice_refund_pool.invoice_refund(cr, uid, [refund_id], {'active_id': membership_line.account_invoice_id.id, 'active_ids': [membership_line.account_invoice_id.id]}) - | I'm checking "Current membership state" of "Mark Johnson". It is an "Cancelled Member" or not. diff --git a/addons/sale/test/advance_invoice.yml b/addons/sale/test/advance_invoice.yml index 7bb1ac8e902..2010de9d95d 100644 --- a/addons/sale/test/advance_invoice.yml +++ b/addons/sale/test/advance_invoice.yml @@ -163,6 +163,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - @@ -185,4 +190,4 @@ - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so5")) - assert(sale_id.invoiced == True), "Paid has not been set to true" \ No newline at end of file + assert(sale_id.invoiced == True), "Paid has not been set to true" diff --git a/addons/sale/test/invoice_on_ordered_qty.yml b/addons/sale/test/invoice_on_ordered_qty.yml index c845a4cb741..24764724857 100644 --- a/addons/sale/test/invoice_on_ordered_qty.yml +++ b/addons/sale/test/invoice_on_ordered_qty.yml @@ -124,6 +124,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - @@ -147,4 +152,4 @@ - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so9")) - assert(sale_id.invoiced == True), "Paid has not been set to true" \ No newline at end of file + assert(sale_id.invoiced == True), "Paid has not been set to true" diff --git a/addons/sale/test/invoice_on_shipped_qty.yml b/addons/sale/test/invoice_on_shipped_qty.yml index c399948c004..0bc3979f14b 100644 --- a/addons/sale/test/invoice_on_shipped_qty.yml +++ b/addons/sale/test/invoice_on_shipped_qty.yml @@ -141,6 +141,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml index 9dd12ed375c..99ba937513a 100644 --- a/addons/sale/test/manual_order_policy.yml +++ b/addons/sale/test/manual_order_policy.yml @@ -93,6 +93,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml index d9b2500d432..c4d271b6da1 100644 --- a/addons/sale/test/picking_order_policy.yml +++ b/addons/sale/test/picking_order_policy.yml @@ -119,6 +119,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - diff --git a/addons/sale/test/postpaid_order_policy.yml b/addons/sale/test/postpaid_order_policy.yml index c4cf24eb419..8f3b8bcb069 100644 --- a/addons/sale/test/postpaid_order_policy.yml +++ b/addons/sale/test/postpaid_order_policy.yml @@ -291,6 +291,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - @@ -328,4 +333,4 @@ - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so8")) - assert (so.state == 'done'), "Sale order is not in the done state." \ No newline at end of file + assert (so.state == 'done'), "Sale order is not in the done state." diff --git a/addons/sale/test/prepaid_order_policy.yml b/addons/sale/test/prepaid_order_policy.yml index f5329f1540a..a99376f1bca 100644 --- a/addons/sale/test/prepaid_order_policy.yml +++ b/addons/sale/test/prepaid_order_policy.yml @@ -79,6 +79,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - diff --git a/addons/sale/test/so_make_invoice.yml b/addons/sale/test/so_make_invoice.yml index abd18751a11..035875f58c1 100644 --- a/addons/sale/test/so_make_invoice.yml +++ b/addons/sale/test/so_make_invoice.yml @@ -209,6 +209,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - diff --git a/addons/sale/test/so_make_line_invoice.yml b/addons/sale/test/so_make_line_invoice.yml index 07c45bec996..ec1714ba995 100644 --- a/addons/sale/test/so_make_line_invoice.yml +++ b/addons/sale/test/so_make_line_invoice.yml @@ -107,6 +107,11 @@ comment: Write-Off writeoff_acc_id: account.a_sale writeoff_journal_id: sale.account_journal_bankjournal0 +- + Assign analytic jounal into Bank journal +- + !record {model: account.journal, id: sale.account_journal_bankjournal0}: + analytic_journal_id: account.cose_journal_sale - Pay and Reconcile the Invoice. - @@ -239,4 +244,4 @@ - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so3")) - assert(sale_id.invoiced == True), "Paid has not been set to true" \ No newline at end of file + assert(sale_id.invoiced == True), "Paid has not been set to true" From d16ca8293d2e006aa64b922a455937a5d395e349 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 18:16:24 +0200 Subject: [PATCH 07/43] fix bzr revid: fp@tinyerp.com-20100901161624-oy1cvs4i3sfhu90i --- .../account/test/account_customer_invoice.yml | 71 ------------------- addons/membership/test/test_membership.yml | 25 ------- .../test/deadline_change.yml | 27 ------- 3 files changed, 123 deletions(-) diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml index b32a22cf9de..d94b791fe66 100644 --- a/addons/account/test/account_customer_invoice.yml +++ b/addons/account/test/account_customer_invoice.yml @@ -54,77 +54,6 @@ !python {model: account.invoice}: | acc_id=self.browse(cr, uid, ref("account_invoice_customer0")) assert acc_id.move_id, "Move not created for open invoice" -- - I create a record for partial payment of 1000 EUR. -- - !record {model: account.invoice.pay, id: account_invoice_pay_first0}: - amount: 1000.0 - date: '2010-05-26' - journal_id: account.sales_journal - name: First payment for [PC3] Medium PC to Distrib PC - period_id: account.period_5 -- - I make partial payment by clicking on Partial Payment button -- - !python {model: account.invoice.pay}: | - self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_first0")], {"lang": - 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids": - [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"), - }) -- - I check that the invoice state is still open -- - !assert {model: account.invoice, id: account_invoice_customer0}: - - state == 'open' -- - I make second partial payment of 6000 EUR. -- - !record {model: account.invoice.pay, id: account_invoice_pay_second0}: - amount: 6000.0 - date: '2010-05-28' - journal_id: account.sales_journal - name: Second payment for [PC3] Medium PC to Distrib PC - period_id: account.period_5 -- - I make partial payment by clicking on Partial Payment button - -- - !python {model: account.invoice.pay}: | - self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_second0")], {"lang": - 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids": - [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"), - }) -- - I make final partial payment of 2000 EUR -- - !record {model: account.invoice.pay, id: account_invoice_pay_final0}: - amount: 2000.0 - date: '2010-05-30' - journal_id: account.sales_journal - name: Final payment for [PC3] Medium PC to Distrib PC - period_id: account.period_5 - -- - I make partial payment by clicking on Partial Payment button - -- - !python {model: account.invoice.pay}: | - self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_final0")], {"lang": - 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids": - [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"), - }) - -- - I check that the invoice state is now Done -- - !assert {model: account.invoice, id: account_invoice_customer0}: - - state == 'paid' -- - I check that an payment entry gets created in the account.move.line -- - !python {model: account.invoice}: | - acc_id=self.browse(cr, uid, ref("account_invoice_customer0")) - assert(acc_id.move_id) - I refund the invoice Using Refund Button - diff --git a/addons/membership/test/test_membership.yml b/addons/membership/test/test_membership.yml index 9e2def844dc..63c0082a60f 100644 --- a/addons/membership/test/test_membership.yml +++ b/addons/membership/test/test_membership.yml @@ -64,31 +64,6 @@ !assert {model: res.partner, id: res_partner_markjohnson0}: - membership_state == 'invoiced', 'Member should be has "Current Membership State" in "Invoiced Member".' -- | - I'm doing to paid that invoice which is opened for "Mark Johnson". -- - !python {model: account.invoice}: | - - from tools.translate import _ - invoice_pool = self.pool.get('account.invoice') - partner_pool = self.pool.get('res.partner') - membership_line_pool = self.pool.get('membership.membership_line') - membership_pool = self.pool.get('product.product') - invoice_pay_pool = self.pool.get('account.invoice.pay') - - membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('res_partner_markjohnson0'))]) - membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids) - assert membership_lines, _('Membership is not registrated.') - membership_line = membership_lines[0] - assert membership_line.account_invoice_id.state == 'open', _('Invoice should be Opened.') - pay_id = invoice_pay_pool.create(cr, uid, {'amount': 80, 'name': 'Payment of Membership', 'journal_id': ref('account.bank_journal')}, {'active_id': membership_line.account_invoice_id.id}) - invoice_pay_pool.pay_and_reconcile(cr, uid, [pay_id], {'active_id': membership_line.account_invoice_id.id}) -- | - I'm checking "Current membership state" of "Mark Johnson". It is an "Paid Member" or not. -- - !assert {model: res.partner, id: res_partner_markjohnson0}: - - membership_state == 'paid', 'Member should be has "Current Membership State" in "Paid Member".' - - | I'm creating free member "Ms. Johnson" of "Golden Membership". - diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index b15fb485a86..3e778916792 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -18,30 +18,3 @@ project_id: project_project_retroplanning0 remaining_hours: 24.0 state: draft -- - Check if task deadline_date and start_date changes upon changing its project's end_date -- - !python {model: project.project}: | - from datetime import datetime, date, timedelta - import time - data_project = self.browse(cr,uid,[ref("project_project_retroplanning0")]) - prj = data_project[0] - old_end_date='' - if prj.date: - old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3]) - if old_end_date: - new_end_date = date.today()+timedelta(1) - res={} - for task in prj.tasks: - start_dt = (datetime(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d %H:%M:%S') - deadline_dt='' - if task.date_deadline: - deadline_dt = (datetime(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d') - res[task.id]=[start_dt,deadline_dt] - self.write(cr, uid, [ref("project_project_retroplanning0")], {'date' : (datetime.now()+timedelta(1)).strftime('%Y-%m-%d')}) - data_project = self.browse(cr,uid,[ref("project_project_retroplanning0")]) - prj = data_project[0] - - for task in prj.tasks: - assert task.date_start == res[task.id][0], "task start date differs, expected %s, got %s"%(res[task.id][0], task.date_start) - assert task.date_deadline == res[task.id][1], "task deadline date differs, expected %s, got %s"%(res[task.id][1], task.date_deadline) From 590184a89ce9177c2a43982684fdca629a93402a Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 18:55:05 +0200 Subject: [PATCH 08/43] [FIX] move validation bzr revid: fp@tinyerp.com-20100901165505-gpalmu0zqhox3eon --- addons/account/account.py | 20 +++++++++---------- .../test/account_validate_account_move.yml | 14 ++++--------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 402340afc9a..dbe441e93f4 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1159,16 +1159,16 @@ class account_move(osv.osv): return chart_account for move in self.browse(cursor, user, ids): - lines = move.line_id - if lines: - ref_line = lines[0] - ref_chart_account = _get_chart_account(cursor, user, ref_line.account_id) - parent_left = ref_chart_account.parent_left - parent_right = ref_chart_account.parent_right - result = True - for line in lines[1:]: - if not (line.account_id.parent_left > parent_left and line.account_id.parent_left < parent_right): - raise osv.except_osv(_('Error !'), _('You cannot validate a move unless accounts in its entry lines are in same Chart Of Accounts !')) + top = None + for line in move.line_id: + account = line.account_id + while account: + account2 = account + account = account.parent_id + if not top: + top = account2.id + elif top<>account2.id: + raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !')) return self.post(cursor, user, ids, context=context) def button_cancel(self, cr, uid, ids, context={}): diff --git a/addons/account/test/account_validate_account_move.yml b/addons/account/test/account_validate_account_move.yml index a2b22730e2c..37d64ead528 100644 --- a/addons/account/test/account_validate_account_move.yml +++ b/addons/account/test/account_validate_account_move.yml @@ -37,7 +37,7 @@ - I check that Initially account move state is "Draft" - - !assert {model: account.move, id: account_move_0}: + !assert {model: account.move, id: account_move_0, string: initialstatedraft}: - state == 'draft' - I validate this account move by using the 'Validate Journal Entries' wizard @@ -46,18 +46,12 @@ journal_id: account.bank_journal period_id: account.period_6 - - I clicked on validate Button + I click on validate Button - !python {model: validate.account.move}: | - try: - self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US", - "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")], - "tz": False, "active_id": ref("account.menu_validate_account_moves"), }) - except: - pass - + self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")], "tz": False, "active_id": ref("account.menu_validate_account_moves"), }) - I check that the invoice state is now "Posted" - - !assert {model: account.move, id: account_move_0}: + !assert {model: account.move, id: account_move_0, string: moveincorrect}: - state == 'posted' From 786e1c775112273089e4b37ae88e3f565b41da30 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 18:58:41 +0200 Subject: [PATCH 09/43] fix bzr revid: fp@tinyerp.com-20100901165841-4jvdus9bz1r1rs0e --- .../account_analytic_default/account_analytic_default.py | 4 ++-- addons/account_anglo_saxon/invoice.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index 43e3d2eb248..d0405e1ff52 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -73,8 +73,8 @@ class account_invoice_line(osv.osv): _inherit = 'account.invoice.line' _description = 'Invoice Line' - def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fiscal_position=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): - res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fiscal_position, price_unit, address_invoice_id, currency_id=currency_id, context=context) + def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): + res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id=currency_id, context=context) rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context) if rec: res_prod['value'].update({'account_analytic_id':rec.analytic_id.id}) diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index 4c3b9b81dcc..ff356547a83 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -127,11 +127,11 @@ class account_invoice_line(osv.osv): res += diff_res return res - def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None): + def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if not product: - return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context) + return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context) else: - res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context) + res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context) if type in ('in_invoice','in_refund'): product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) @@ -173,4 +173,4 @@ class account_invoice(osv.osv): return res account_invoice() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 80ab65e3bcb22659353bd8dade30b8910f2e6f73 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 19:49:38 +0200 Subject: [PATCH 10/43] fix bzr revid: fp@tinyerp.com-20100901174938-nn8fvgoovd0ymjur --- addons/auction/test/auction.yml | 51 ++++++--------------------------- 1 file changed, 9 insertions(+), 42 deletions(-) diff --git a/addons/auction/test/auction.yml b/addons/auction/test/auction.yml index 6b86511cf2a..4cb6ace184b 100644 --- a/addons/auction/test/auction.yml +++ b/addons/auction/test/auction.yml @@ -1,7 +1,5 @@ - - In order to test the auction module in the Open-ERP I start the process by creating a product. -- - I create a new product furniture. + In order to test the auction module in the OpenERP I start the process by creating a product. - !record {model: product.product, id: product_product_furniture0}: categ_id: product.cat1 @@ -36,8 +34,7 @@ - !record {model: account.journal, id: account.sales_journal}: analytic_journal_id: account.cose_journal_sale - -- +- I'm creating new Seller "Mr. Pinakin" with him email "info@mycustomer.com". - !record {model: res.partner, id: res_partner_mrpinakin0}: @@ -225,8 +222,7 @@ !python {model: auction.lots}: | from tools.translate import _ auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) - assert(auc_id.buyer_price,auc_id.seller_price), _('Buyer price and seller price are not available!') - + assert auc_id.buyer_price and auc_id.seller_price, _('Buyer price and seller price are not available!') - Now, An object has been sold,so I click on the "Sold" button. - @@ -271,44 +267,15 @@ auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) assert(auc_id.ach_inv_id), _('Buyer Invoice has not been created!') - - Buyer Create a Invoice payment record by Click on "Pay Invoice" Button of Account invoice. + Buyer pays the invoice - - !record {model: account.invoice.pay, id: account_invoice_pay_furniture0}: - amount: 4120.0 - date: '2010-08-06' - journal_id: account.cash_journal - name: Furniture - period_id: account.period_8 -- - Now Buyer want to make Full payment by click on "Full Payment" button of Account Invoice wizard. -- - !python {model: account.invoice.pay}: | - obj_invoice = self.pool.get('account.invoice') + !python {model: account.invoice}: | obj_lots = self.pool.get('auction.lots') lots_id = obj_lots.browse(cr, uid, ref("auction_lots_woodenchair0")) - invoice_ids = obj_invoice.search(cr, uid, [('id', '=', lots_id.ach_inv_id.id)]) - self.wo_check(cr, uid, [ref("account_invoice_pay_furniture0")], {"active_model": "account.invoice", "department_id": False, - "record_id": 7, "search_default_draft": "1", "active_ids": invoice_ids, - "active_id": invoice_ids[0]}) -- - After Click on Full Payment Button, Creating a account invoice pay writeoff record. -- - !record {model: account.invoice.pay.writeoff, id: account_invoice_pay_writeoff_0}: - comment: Write-Off - writeoff_acc_id: auction.auction_income_costs - writeoff_journal_id: account.sales_journal -- - And click on "pay_and_reconcile_writeoff" button. -- - !python {model: account.invoice.pay.writeoff}: | - obj_invoice = self.pool.get('account.invoice') - obj_lots = self.pool.get('auction.lots') - lots_id = obj_lots.browse(cr, uid, ref("auction_lots_woodenchair0")) - invoice_ids = obj_invoice.search(cr, uid, [('id', '=', lots_id.ach_inv_id.id)]) - self.pay_and_reconcile_writeoff(cr, uid, [ref("account_invoice_pay_writeoff_0")], - {"active_model": "account.invoice", "department_id": - False, "record_id": 7, "search_default_draft": "1", "active_ids": invoice_ids , - "active_id": invoice_ids[0], }) + self.pay_and_reconcile(cr, uid, [lots_id.ach_inv_id.id], 4120.0, + ref('account.account_type_cash_moves'), ref('account.period_8'), + ref('account.cash_journal'), ref('account.account_type_cash_moves'), + ref('account.period_8'), ref('account.cash_journal'), name='Furniture') - I check that "Buyer Invoice Reconciled" field is marked. - From 1b7d69bfdca8edf8fb8846fa6a0dd96ade766a11 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 19:58:28 +0200 Subject: [PATCH 11/43] fix bzr revid: fp@tinyerp.com-20100901175828-ejk8vc5olz9d1kv6 --- addons/hr_payroll/test/payslip.yml | 1 + addons/mrp_jit/test/mrp_jit.yml | 27 ++++++++------------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/addons/hr_payroll/test/payslip.yml b/addons/hr_payroll/test/payslip.yml index f1c860f8edd..6c0f60ef7dd 100644 --- a/addons/hr_payroll/test/payslip.yml +++ b/addons/hr_payroll/test/payslip.yml @@ -7,6 +7,7 @@ acc_number: '987654321' partner_id: base.res_partner_desertic_hispafuentes sequence: 0.0 + name: Fortis state: bank - I create a new employee “Richard” diff --git a/addons/mrp_jit/test/mrp_jit.yml b/addons/mrp_jit/test/mrp_jit.yml index edafb8ca5a5..9d811d8b3e6 100644 --- a/addons/mrp_jit/test/mrp_jit.yml +++ b/addons/mrp_jit/test/mrp_jit.yml @@ -2,34 +2,23 @@ In order to test mrp_jit module with OpenERP, I will create manufacturing order and check whether the procurement orders run without scheduler or not. - - !record {model: mrp.production, id: mrp_production_mo0}: - bom_id: mrp.mrp_bom_1 + !record {model: procurement.order, id: mrp_production_mo0}: company_id: base.main_company date_planned: '2010-08-05 17:59:49' - location_dest_id: stock.stock_location_stock - location_src_id: stock.stock_location_stock - name: MO/00017 + location_id: stock.stock_location_stock + name: PROC/TEST/0001 product_id: product.product_product_pc2 product_qty: 10.0 product_uom: product.product_uom_unit product_uos_qty: 0.0 - routing_id: mrp.mrp_routing_0 - | - I confirm production order. + I confirm the procurement order PROC/TEST/0001. - - !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0} + !workflow {model: procurement.order, action: button_confirm, ref: mrp_production_mo0} - | - I check the procurement orders generated from the production order. + I check that the procurement is scheduled automatically. - - | - It runs without using schedulers. -- - !python {model: procurement.order}: | - prod_obj = self.pool.get('mrp.production') - production = prod_obj.browse(cr, uid, ref('mrp_production_mo0')) - products = map(lambda x:x.product_id.id, production.move_lines) - procurement_ids = self.search(cr, uid, [('product_id','in',products)]) - procurements = self.browse(cr, uid, procurement_ids) - assert all(proc.state != 'confirmed' for proc in procurements), 'Procurement not scheduled!' + !assert {model: procurement.order, id: mrp_production_mo0, string: procstate}: + - state<>'confirmed' From 1915d0bfef112c5a7c6cae2392c3ac936b2ab461 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 1 Sep 2010 20:00:35 +0200 Subject: [PATCH 12/43] fix bzr revid: fp@tinyerp.com-20100901180035-k060u21hvhi867pb --- addons/project_planning/project_planning_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml index c599d13cb98..93a5c2c81b7 100644 --- a/addons/project_planning/project_planning_view.xml +++ b/addons/project_planning/project_planning_view.xml @@ -100,7 +100,6 @@ attrs="{'readonly':[('state','!=','draft')]}" on_change="onchange_planned(planned_hours,effective_hours)"/> -