From a6f5b92bc65dc63360d941988aa4a9937b33145a Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 30 Sep 2010 12:22:07 +0200 Subject: [PATCH 1/7] [FIX] account_voucher: fix sales_reicept tests to assert on the status of 'reconciled' rather than print random stuff to stdout bzr revid: xmo@openerp.com-20100930102207-7ozrm7o38kqfmr3a --- addons/account_voucher/test/sales_receipt.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml index af10d614730..628d1795bc8 100644 --- a/addons/account_voucher/test/sales_receipt.yml +++ b/addons/account_voucher/test/sales_receipt.yml @@ -42,11 +42,7 @@ if l.reconcile_id: reconciled = True break - if not reconciled: - print "Info: Voucher is not paid" - else: - print "Info: Voucher is paid" - + assert (not reconciled), "Found reconciled move lines, should not be" - I create and post a voucher payment of amount 30000.0 for the partner Seagate - @@ -74,8 +70,6 @@ assert (voucher_id.state=='draft'), "Voucher is not in draft state" wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr) - - - I check that move lines are reconciled meaning voucher is paid - @@ -85,7 +79,4 @@ if l.reconcile_id: reconciled = True break - if not reconciled: - print "Info: Voucher is not paid" - else: - print "Info: Voucher is paid" \ No newline at end of file + assert reconciled, "Found unreconciled move lines/unpaid voucher" From e198ff4d4a557b699db49e0c5fb025e54c4f9c4f Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Thu, 30 Sep 2010 16:41:14 +0200 Subject: [PATCH 2/7] [IMP] crm, leads and opportunities: when opening a case, the stage shouldn't change unless there is still not a stage set bzr revid: qdp-launchpad@tinyerp.com-20100930144114-3r5gcu6xsnehk31p --- addons/crm/crm_lead.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index cdc3553dc0e..76260082602 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -185,14 +185,16 @@ class crm_lead(crm_case, osv.osv): @param *args: Give Tuple Value """ old_state = self.read(cr, uid, ids, ['state'])[0]['state'] + old_stage_id = self.read(cr, uid, ids, ['stage_id'])[0]['stage_id'] res = super(crm_lead, self).case_open(cr, uid, ids, *args) if old_state == 'draft': - stage_id = super(crm_lead, self).stage_next(cr, uid, ids, *args) - if stage_id: - value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value'] - else: - value = {} - value.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S'), 'stage_id': stage_id}) + value = {} + if not old_stage_id: + stage_id = super(crm_lead, self).stage_next(cr, uid, ids, *args) + if stage_id: + value.update({'stage_id': stage_id}) + value.update(self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']) + value.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S')}) self.write(cr, uid, ids, value) for (id, name) in self.name_get(cr, uid, ids): From 44894f3db2ff581fe313f798a515676362fe63e6 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Thu, 30 Sep 2010 16:44:20 +0200 Subject: [PATCH 3/7] [IMP] crm, leads: closing a lead will now put the stage to 'lost' instead of 'won' bzr revid: qdp-launchpad@tinyerp.com-20100930144420-67jl2pjmdledrb70 --- addons/crm/crm_lead_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 40317a4b188..2cbd1581ff5 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -111,7 +111,7 @@