From 3c8de333a4e648fc3d827e69379990217ee5c792 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 6 Jul 2011 17:36:44 +0530 Subject: [PATCH 1/5] [IMP] add boolean field on account_followup wizard and fix partner_id many2many fields gives error bzr revid: ara@tinyerp.com-20110706120644-etqtptxkmjer6qsa --- addons/account_followup/wizard/account_followup_print.py | 7 ++++--- .../wizard/account_followup_print_view.xml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index a8608c2fdd0..c1b5247dec2 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -115,12 +115,13 @@ class account_followup_print_all(osv.osv_memory): _name = 'account.followup.print.all' _description = 'Print Followup & Send Mail to Customers' _columns = { - 'partner_ids': fields.many2many('account_followup.stat.by.partner', 'partner_stat_rel', 'osv_memory_id', 'partner_id', 'Partners', required=True, domain="[('account_id.type', '=', 'receivable'), ('account_id.reconcile', '=', True), ('reconcile_id','=', False), ('state', '!=', 'draft'), ('account_id.active', '=', True), ('debit', '>', 0)]"), + 'partner_ids': fields.many2many('account_followup.stat.by.partner', 'partner_stat_rel', 'osv_memory_id', 'partner_id', 'Partners', required=True), 'email_conf': fields.boolean('Send email confirmation'), 'email_subject': fields.char('Email Subject', size=64), 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), 'email_body': fields.text('Email body'), - 'summary': fields.text('Summary', required=True, readonly=True) + 'summary': fields.text('Summary', required=True, readonly=True), + 'test': fields.boolean('Test File') } def _get_summary(self, cr, uid, context=None): if context is None: @@ -316,7 +317,7 @@ class account_followup_print_all(osv.osv_memory): data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and context['date'] or data['date'] for id in to_update.keys(): - if to_update[id]['partner_id'] in data['partner_ids']: + if to_update[id]['partner_id'] in data['partner_ids'] and not data['test']: cr.execute( "UPDATE account_move_line "\ "SET followup_line_id=%s, followup_date=%s "\ diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml index af105b17c55..1ece8ea2959 100644 --- a/addons/account_followup/wizard/account_followup_print_view.xml +++ b/addons/account_followup/wizard/account_followup_print_view.xml @@ -86,6 +86,7 @@ + From db4c8d395d520e1388ef3731994e092f29942bc8 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 6 Jul 2011 17:57:33 +0530 Subject: [PATCH 2/5] [IMP] add help on test field bzr revid: ara@tinyerp.com-20110706122733-qszw297j0w7si3q7 --- addons/account_followup/wizard/account_followup_print.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index c1b5247dec2..d7730c1cfff 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -121,7 +121,7 @@ class account_followup_print_all(osv.osv_memory): 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), 'email_body': fields.text('Email body'), 'summary': fields.text('Summary', required=True, readonly=True), - 'test': fields.boolean('Test File') + 'test': fields.boolean('Test File', help='Check if you want to print follow ups without increase follow ups level.') } def _get_summary(self, cr, uid, context=None): if context is None: From 469ca9b5f4bbf1e67d22f63c1fac6905aeac2796 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 6 Jul 2011 17:58:07 +0530 Subject: [PATCH 3/5] [IMP] add help on test field bzr revid: ara@tinyerp.com-20110706122807-t13hbmxzximo561h --- addons/account_followup/wizard/account_followup_print.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index d7730c1cfff..03f376d9af2 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -121,7 +121,7 @@ class account_followup_print_all(osv.osv_memory): 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), 'email_body': fields.text('Email body'), 'summary': fields.text('Summary', required=True, readonly=True), - 'test': fields.boolean('Test File', help='Check if you want to print follow ups without increase follow ups level.') + 'test': fields.boolean('Test File', help='Check if you want to print follow ups without changing follow ups level.') } def _get_summary(self, cr, uid, context=None): if context is None: From 71a33c47bd404488e7beaab04584f9cf67b95478 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 11 Jul 2011 15:39:03 +0530 Subject: [PATCH 4/5] [IMP] account_followups: improve varible name bzr revid: ara@tinyerp.com-20110711100903-dts3dzar0tv95wh3 --- .../wizard/account_followup_print.py | 19 ++++++++++--------- .../wizard/account_followup_print_view.xml | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 03f376d9af2..59cdb915a8f 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -121,7 +121,7 @@ class account_followup_print_all(osv.osv_memory): 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), 'email_body': fields.text('Email body'), 'summary': fields.text('Summary', required=True, readonly=True), - 'test': fields.boolean('Test File', help='Check if you want to print follow ups without changing follow ups level.') + 'test_print': fields.boolean('Test Print', help='Check if you want to print followups without changing follow ups level.') } def _get_summary(self, cr, uid, context=None): if context is None: @@ -316,14 +316,15 @@ class account_followup_print_all(osv.osv_memory): to_update = res data['followup_id'] = 'followup_id' in context and context['followup_id'] or False date = 'date' in context and context['date'] or data['date'] - for id in to_update.keys(): - if to_update[id]['partner_id'] in data['partner_ids'] and not data['test']: - cr.execute( - "UPDATE account_move_line "\ - "SET followup_line_id=%s, followup_date=%s "\ - "WHERE id=%s", - (to_update[id]['level'], - date, int(id),)) + if not data['test_print']: + for id in to_update.keys(): + if to_update[id]['partner_id'] in data['partner_ids']: + cr.execute( + "UPDATE account_move_line "\ + "SET followup_line_id=%s, followup_date=%s "\ + "WHERE id=%s", + (to_update[id]['level'], + date, int(id),)) data.update({'date': context['date']}) datas = { 'ids': [], diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml index 1ece8ea2959..9d74060b19a 100644 --- a/addons/account_followup/wizard/account_followup_print_view.xml +++ b/addons/account_followup/wizard/account_followup_print_view.xml @@ -86,7 +86,7 @@ - + From 758ca5c4f47a26152e7edf7afdfc8a4e838591f9 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 11 Jul 2011 15:56:13 +0530 Subject: [PATCH 5/5] [IMP] account_followups: improve varible name bzr revid: ara@tinyerp.com-20110711102613-msoe0my3j7qwil2j --- addons/account_followup/wizard/account_followup_print.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 59cdb915a8f..794bf13a1d4 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -121,7 +121,7 @@ class account_followup_print_all(osv.osv_memory): 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), 'email_body': fields.text('Email body'), 'summary': fields.text('Summary', required=True, readonly=True), - 'test_print': fields.boolean('Test Print', help='Check if you want to print followups without changing follow ups level.') + 'test_print': fields.boolean('Test Print', help='Check if you want to print followups without changing followups level.') } def _get_summary(self, cr, uid, context=None): if context is None: