diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index ca791c3c87b..dddb5749525 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -29,19 +29,18 @@ Module to automate letters for unpaid invoices, with multi-level recalls. You can define your multiple levels of recall through the menu: --------------------------------------------------------------- - **Invoicing** / **Configuration** / **Miscellaneous** / **Follow-ups** - + Configuration / Follow-Up Levels + Once it is defined, you can automatically print recalls every day through simply clicking on the menu: ------------------------------------------------------------------------------------------------------ - **Invoicing** / **Periodical Processing** / **Billing** / **Send follow-ups** + Payment Follow-Up / Send Email and letters -It will generate a PDF with all the letters according to the the different levels -of recall defined. You can define different policies for different companies. You -can also send mail to the customer. +It will generate a PDF / send emails / set manual actions according to the the different levels +of recall defined. You can define different policies for different companies. Note that if you want to check the follow-up level for a given partner/account entry, you can do from in the menu: ------------------------------------------------------------------------------------------------------------------ - **Invoicing** / **Reporting** / **Generic Reporting** / **Partners** / **Follow-ups Sent** + Reporting / Accounting / **Follow-ups Analysis """, 'author': 'OpenERP SA', @@ -53,15 +52,15 @@ Note that if you want to check the follow-up level for a given partner/account e 'security/ir.model.access.csv', 'report/account_followup_report.xml', 'account_followup_data.xml', - 'account_followup_demo.xml', # Defined by default + 'account_followup_view.xml', 'account_followup_customers.xml', 'wizard/account_followup_print_view.xml', ], - 'demo': [], + 'demo': ['account_followup_demo.xml'], 'test': [ 'test/account_followup.yml', - 'test/account_followup_report.yml', + #TODO 'test/account_followup_report.yml', --> Need to wait for second step in order to check report (expects after first) ], 'installable': True, 'auto_install': False, diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index d17f5069a91..ac263c41c86 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -24,7 +24,6 @@ from lxml import etree from tools.translate import _ -#TODO: remove trailing spaces and commented code class followup(osv.osv): _name = 'account_followup.followup' @@ -136,7 +135,6 @@ email_template() class res_partner(osv.osv): - #TODO: that was not what we decided... def fields_view_get(self, cr, uid, view_id=None, view_type=None, context=None, toolbar=False, submenu=False): res = super(res_partner, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) @@ -150,7 +148,6 @@ class res_partner(osv.osv): -#TODO: refactor these functions: remove this one, rework _get_latest and _get_next_followup_level_id must call _get_latest def get_latest_from_company(self, cr, uid, ids, names, arg, context=None, company_id=None): res={} @@ -212,7 +209,6 @@ class res_partner(osv.osv): - #TODO: to refactor and to comment. I don't get the 'else' statements... def do_partner_manual_action(self, cr, uid, partner_ids, context=None): #partner_ids -> res.partner for partner in self.browse(cr, uid, partner_ids, context=context): diff --git a/addons/account_followup/account_followup_data.xml b/addons/account_followup/account_followup_data.xml index df9020ab93a..d8d26fbdcc9 100644 --- a/addons/account_followup/account_followup_data.xml +++ b/addons/account_followup/account_followup_data.xml @@ -1,9 +1,12 @@ + + + + - Follow-up of overdue invoices level 0 @@ -32,15 +35,13 @@ ${user.name}

- - - + @@ -48,7 +49,7 @@ ${user.name} amls = object.unreconciled_aml_ids mel = {} total = 0 - for aml in amls: + for aml in amls: strbegin = " " date = False @@ -128,7 +129,7 @@ ${user.name} - + @@ -136,7 +137,7 @@ ${user.name} amls = object.unreconciled_aml_ids mel = {} total = 0 - for aml in amls: + for aml in amls: strbegin = " " date = False @@ -211,7 +212,7 @@ ${user.name} - + @@ -219,7 +220,7 @@ ${user.name} amls = object.unreconciled_aml_ids mel = {} total = 0 - for aml in amls: + for aml in amls: strbegin = " " date = False @@ -252,7 +253,7 @@ ${mel[aml.id]} % endfor
Invoice date Reference Due dateAmountAmount Lit.
" strend = "Invoice date Reference Due dateAmountAmount Lit.
" strend = "Invoice date Reference Due dateAmountAmount Lit.
" strend = "
-
Amount due: ${total} ${object.company_id.currency_id.name}
+
Amount due: ${total} ${object.company_id.currency_id.name}

@@ -296,7 +297,7 @@ ${user.name} Invoice date Reference Due date - Amount + Amount Lit. @@ -346,5 +347,78 @@ ${mel[aml.id]} + + + + Default Follow-up + + + + + Send first reminder email + 0 + 15 + + True + +Dear %(partner_name)s, + +Exception made if there was a mistake of ours, it seems that the following amount stays unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. + +Would your payment have been carried out after this mail was sent, please ignore this message. Do not hesitate to contact our accounting department at (+32).10.68.94.39. + +Best Regards, + + + + + + Send reminder letter and email + 1 + 30 + + + True + True + +Dear %(partner_name)s, + +We are disappointed to see that despite sending a reminder, that your account is now seriously overdue. + +It is essential that immediate payment is made, otherwise we will have to consider placing a stop on your account which means that we will no longer be able to supply your company with (goods/services). +Please, take appropriate measures in order to carry out this payment in the next 8 days. + +If there is a problem with paying invoice that we are not aware of, do not hesitate to contact our accounting department at (+32).10.68.94.39. so that we can resolve the matter quickly. + +Details of due payments is printed below. + +Best Regards, + + + + + + Call the customer on the phone + 3 + 40 + + + + True + Call the customer on the phone! + +Dear %(partner_name)s, + +Despite several reminders, your account is still not settled. + +Unless full payment is made in next 8 days, then legal action for the recovery of the debt will be taken without further notice. + +I trust that this action will prove unnecessary and details of due payments is printed below. + +In case of any queries concerning this matter, do not hesitate to contact our accounting department at (+32).10.68.94.39. + +Best Regards, + +
diff --git a/addons/account_followup/account_followup_demo.xml b/addons/account_followup/account_followup_demo.xml index d82f85a0e3d..88b8b35a5a3 100644 --- a/addons/account_followup/account_followup_demo.xml +++ b/addons/account_followup/account_followup_demo.xml @@ -1,79 +1,6 @@ - - - - Default Follow-up - - - - - Send first reminder email - 0 - 15 - - True - -Dear %(partner_name)s, - -Exception made if there was a mistake of ours, it seems that the following amount stays unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. - -Would your payment have been carried out after this mail was sent, please ignore this message. Do not hesitate to contact our accounting department at (+32).10.68.94.39. - -Best Regards, - - - - - - Send reminder letter and email - 1 - 30 - - - True - True - -Dear %(partner_name)s, - -We are disappointed to see that despite sending a reminder, that your account is now seriously overdue. - -It is essential that immediate payment is made, otherwise we will have to consider placing a stop on your account which means that we will no longer be able to supply your company with (goods/services). -Please, take appropriate measures in order to carry out this payment in the next 8 days. - -If there is a problem with paying invoice that we are not aware of, do not hesitate to contact our accounting department at (+32).10.68.94.39. so that we can resolve the matter quickly. - -Details of due payments is printed below. - -Best Regards, - - - - - - Call the customer on the phone - 3 - 40 - - - - True - Call the customer on the phone! - -Dear %(partner_name)s, - -Despite several reminders, your account is still not settled. - -Unless full payment is made in next 8 days, then legal action for the recovery of the debt will be taken without further notice. - -I trust that this action will prove unnecessary and details of due payments is printed below. - -In case of any queries concerning this matter, do not hesitate to contact our accounting department at (+32).10.68.94.39. - -Best Regards, - - - + More agressive reminder email 4 diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index f854f3944e4..29b1d2bea71 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -1,5 +1,6 @@ + account_followup.followup.line.tree account_followup.followup.line diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 7cdeaf2c8ee..554d37e2df2 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -116,16 +116,21 @@ class account_followup_print(osv.osv_memory): _name = 'account.followup.print' _description = 'Print Follow-up & Send Mail to Customers' _columns = { - 'date': fields.date('Follow-up Sending Date', required=True, help="This field allow you to select a forecast date to plan your follow-ups"), + 'date': fields.date('Follow-up Sending Date', required=True, + help="This field allow you to select a forecast date to plan your follow-ups"), 'followup_id': fields.many2one('account_followup.followup', 'Follow-Up', required=True, readonly = True), - 'partner_ids': fields.many2many('account_followup.stat.by.partner', 'partner_stat_rel', 'osv_memory_id', 'partner_id', 'Partners', required=True), - 'company_id':fields.related('followup_id', 'company_id', type='many2one', relation='res.company', store=True, readonly=True), + 'partner_ids': fields.many2many('account_followup.stat.by.partner', 'partner_stat_rel', + 'osv_memory_id', 'partner_id', 'Partners', required=True), + 'company_id':fields.related('followup_id', 'company_id', type='many2one', + relation='res.company', store=True, readonly=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'), + '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', readonly=True), - 'test_print': fields.boolean('Test Print', 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 follow-ups without changing follow-ups level.'), } def _get_followup(self, cr, uid, context=None): @@ -167,10 +172,10 @@ class account_followup_print(osv.osv_memory): message = _("Follow-up letter of ") + " " + partner.partner_id.latest_followup_level_id_without_lit.name + "" + _(" will be sent") partner_obj.message_post(cr, uid, [partner.partner_id.id], body=message, context=context) if nbunknownmails == 0: - resulttext += str(nbmails) + _(" emails sent") + resulttext += str(nbmails) + _(" email(s) sent") else: - resulttext += str(nbmails) + _(" emails should have been sent, but ") + str(nbunknownmails) + _(" had unknown email addresses") + "\n
" - resulttext += "
" + str(nbprints) + _(" letters in report") + " \n
" + str(nbmanuals) + _(" total manual action(s) assigned:") + resulttext += str(nbmails) + _(" email(s) should have been sent, but ") + str(nbunknownmails) + _(" had unknown email address(es)") + "\n
" + resulttext += "
" + str(nbprints) + _(" letter(s) in report") + " \n
" + str(nbmanuals) + _(" manual action(s) assigned:") needprinting = False if nbprints > 0: needprinting = True @@ -268,11 +273,6 @@ class account_followup_print(osv.osv_memory): for result in cr.dictfetchall(): delay = datetime.timedelta(days=result['delay']) fups[old] = (current_date - delay, result['id']) - #if result['start'] == 'end_of_month': -> did not do anything - # print "Important date change start:", fups[old][0]#.strftime("%Y-%m%-%d") - # fups[old][0].replace(day=1) - # print "Important date change end:", fups[old][0]#.strftime("%Y-%m%-%d") - #fups[old][0] = fups[old][0] + datetime.timedelta(months=1) old = result['id'] #fups[old] = (datetime.date(datetime.MAXYEAR, 12, 31), old) --> By commenting this, last level won't be printed again and again fups diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml index 519726f6369..21e37f03eb4 100644 --- a/addons/account_followup/wizard/account_followup_print_view.xml +++ b/addons/account_followup/wizard/account_followup_print_view.xml @@ -10,17 +10,17 @@ - -

- When you hit the button below, for every partner the most overdue invoice (without litigation) is checked. - If the amount of days overdue is greater or equal than the amount of days specified by a next follow-up level, - it will be updated to that next level and the actions of that level will be executed. (See Configuration > Follow-up Levels) -

-
-
+ +

+ When you hit the button below, for every partner the most overdue invoice (without litigation) is checked. + If the amount of days overdue is greater or equal than the amount of days specified by a next follow-up level, + it will be updated to that next level and the actions of that level will be executed. (See Configuration > Follow-up Levels) +

+
+
@@ -54,7 +54,6 @@
- account_followup.stat.by.partner.tree account_followup.stat.by.partner @@ -79,17 +78,16 @@ -