From 767fad5f96155b07e9261ddf9dd4e684e4b69dc8 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 7 Dec 2012 09:57:46 +0100 Subject: [PATCH] [REF] account_followup: use payment_amount_due instead of credit field bzr revid: qdp-launchpad@openerp.com-20121207085746-fcnkni42jruaiqlu --- addons/account_followup/account_followup.py | 4 ++++ addons/account_followup/account_followup_customers.xml | 4 ++-- addons/account_followup/tests/test_account_followup.py | 7 +++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index c6c9bd8e079..0d748384672 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -309,6 +309,10 @@ class res_partner(osv.osv): def _get_amounts_and_date(self, cr, uid, ids, name, arg, context=None): + ''' + Function that computes values for the followup functional fields. Note that 'payment_amount_due' + is similar to 'credit' field on res.partner except it filters on user's company. + ''' res = {} company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id current_date = fields.date.context_today(cr, uid, context) diff --git a/addons/account_followup/account_followup_customers.xml b/addons/account_followup/account_followup_customers.xml index 3a7b5315b62..0471eb52fbe 100644 --- a/addons/account_followup/account_followup_customers.xml +++ b/addons/account_followup/account_followup_customers.xml @@ -67,9 +67,9 @@

The , the latest payment follow-up diff --git a/addons/account_followup/tests/test_account_followup.py b/addons/account_followup/tests/test_account_followup.py index c46977bd6b5..4495ffa6469 100644 --- a/addons/account_followup/tests/test_account_followup.py +++ b/addons/account_followup/tests/test_account_followup.py @@ -108,7 +108,7 @@ class TestAccountFollowup(TransactionCase): def test_03_filter_on_credit(self): """ Check the partners can be filtered on having credits """ cr, uid = self.cr, self.uid - ids = self.partner.search(cr, uid, [('credit', '>=', 0.0)]) + ids = self.partner.search(cr, uid, [('payment_amount_due', '>=', 0.0)]) self.assertIn(self.partner_id, ids) def test_04_action_done(self): @@ -153,7 +153,6 @@ class TestAccountFollowup(TransactionCase): }, context={"followup_id": self.followup_id}) self.wizard.do_process(cr, uid, [self.wizard_id], context={"followup_id": self.followup_id}) partner_ref = self.partner.browse(cr, uid, self.partner_id) - print partner_ref.credit, partner_ref.payment_next_action_date, partner_ref.payment_responsible_id - self.assertEqual(0, self.partner.browse(cr, uid, self.partner_id).credit, "Credit != 0") + self.assertEqual(0, self.partner.browse(cr, uid, self.partner_id).payment_amount_due, "Amount Due != 0") self.assertFalse(self.partner.browse(cr, uid, self.partner_id).payment_next_action_date, "Next action date not cleared") - \ No newline at end of file +