From 8ca8f50656740a3204e85358683f6c93671182a8 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 19 Oct 2012 13:07:20 +0200 Subject: [PATCH 1/2] [FIX] account_voucher: fixed yaml test in order to reflect what the client are really sending as information bzr revid: qdp-launchpad@openerp.com-20121019110720-xhkhzd04caczsz41 --- addons/account_voucher/account_voucher.py | 2 +- addons/account_voucher/test/account_voucher.yml | 1 - addons/account_voucher/test/sales_payment.yml | 5 ++++- addons/account_voucher/test/sales_receipt.yml | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 648576443a0..3ae421308b5 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1422,7 +1422,7 @@ class account_voucher_line(osv.osv): } def onchange_reconcile(self, cr, uid, ids, reconcile, amount, amount_unreconciled, context=None): - vals = { 'amount': 0.0} + vals = {'amount': 0.0} if reconcile: vals = { 'amount': amount_unreconciled} return {'value': vals} diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml index f8e20f496e5..c9270dc695c 100644 --- a/addons/account_voucher/test/account_voucher.yml +++ b/addons/account_voucher/test/account_voucher.yml @@ -53,7 +53,6 @@ account_id: account.cash amount: 1000.0 company_id: base.main_company - currency_id: base.EUR journal_id: account.bank_journal name: Voucher Axelor narration: PC Assemble SC234 diff --git a/addons/account_voucher/test/sales_payment.yml b/addons/account_voucher/test/sales_payment.yml index 88f10e55918..b71e42add0b 100644 --- a/addons/account_voucher/test/sales_payment.yml +++ b/addons/account_voucher/test/sales_payment.yml @@ -45,7 +45,6 @@ 'account_id': ref('account.cash'), 'amount': 450.0, 'company_id': ref('base.main_company'), - 'currency_id': ref('base.EUR'), 'journal_id': ref('account.bank_journal'), 'partner_id': ref('base.res_partner_19'), 'period_id': ref('account.period_8'), @@ -53,6 +52,10 @@ } if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + #clients aren't sending value of readonly fields in the view, and there is a good reason for that, so here the + #create should only use values of fields that are not readonly. That's why i'm removing some of these values + del(res['value']['line_cr_ids'][0]['date_original']) + del(res['value']['line_cr_ids'][0]['date_due']) res['value']['line_cr_ids'][0]['amount'] = 450.0 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml index 7cd82eecaff..cf4bc5c46d3 100644 --- a/addons/account_voucher/test/sales_receipt.yml +++ b/addons/account_voucher/test/sales_receipt.yml @@ -53,7 +53,6 @@ 'account_id': ref('account.cash'), 'amount': 30000.0, 'company_id': ref('base.main_company'), - 'currency_id': ref('base.EUR'), 'journal_id': ref('account.bank_journal'), 'partner_id': ref('base.res_partner_19'), 'period_id': ref('account.period_8'), From b5f8932458fb35c51e26c090df0fad6f50f2acd5 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 19 Oct 2012 13:54:25 +0200 Subject: [PATCH 2/2] [FIX] hr_timesheet: fixed yaml test that as giving a value for a related readonly field bzr revid: qdp-launchpad@openerp.com-20121019115425-97fxn854e3icp3dm --- addons/hr_timesheet/test/test_hr_timesheet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index cc04bed734d..59d688f183b 100644 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -23,7 +23,7 @@ import time uid = ref('base.user_demo') new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Quentin Paolino', - 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'}) + 'server_date': time.strftime('%Y-%m-%d %H:%M:%S')}) self.sign_in_result(cr, uid, [new_id], context) - I change my project "Thymbra" and I click on the "Change Work" button of this wizard