@@ -118,7 +117,7 @@
order to not include it in the next payment
follow-ups.
-
+
diff --git a/addons/account_followup/account_followup_data.xml b/addons/account_followup/account_followup_data.xml
index c1ec4d53311..df9020ab93a 100644
--- a/addons/account_followup/account_followup_data.xml
+++ b/addons/account_followup/account_followup_data.xml
@@ -33,19 +33,22 @@ ${user.name}
-
+
+
- | Invoice date |
- Reference |
+ Invoice date |
+ Reference |
Due date |
Amount |
Lit. |
+
<%
- amls = object.accountmoveline_ids
+ amls = object.unreconciled_aml_ids
mel = {}
- for aml in amls:
+ total = 0
+ for aml in amls:
strbegin = " "
strend = " | "
date = False
@@ -65,20 +68,22 @@ ${user.name}
block = " "
if aml.blocked:
block = "X"
- mel[aml.id] = strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend
+ mel[aml.id] = "" + strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend + "
"
+ if (aml.company_id.id != user.company_id.id):
+ mel[aml.id] = ""
+ else:
+ total += aml.result
%>
% for aml in amls:
-
${mel[aml.id]}
-
% endfor
-
-Total overdue amount: ${object.credit} ${object.company_id.currency_id.name}
+Amount due: ${total} ${object.company_id.currency_id.name}
+
]]>
@@ -116,20 +121,22 @@ ${user.name}
-
+
+
- | Invoice date |
- Reference |
+ Invoice date |
+ Reference |
Due date |
Amount |
Lit. |
<%
- amls = object.accountmoveline_ids
+ amls = object.unreconciled_aml_ids
mel = {}
- for aml in amls:
+ total = 0
+ for aml in amls:
strbegin = " "
strend = " | "
date = False
@@ -149,20 +156,22 @@ ${user.name}
block = " "
if aml.blocked:
block = "X"
- mel[aml.id] = strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend
+ mel[aml.id] = "" + strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend + "
"
+ if (aml.company_id.id != user.company_id.id):
+ mel[aml.id] = ""
+ else:
+ total += aml.result
%>
% for aml in amls:
-
${mel[aml.id]}
-
% endfor
-
-Total overdue amount: ${object.credit} ${object.company_id.currency_id.name}
+Amount due: ${total} ${object.company_id.currency_id.name}
+
]]>
@@ -195,20 +204,22 @@ ${user.name}
-
+
+
- | Invoice date |
- Reference |
+ Invoice date |
+ Reference |
Due date |
Amount |
Lit. |
<%
- amls = object.accountmoveline_ids
+ amls = object.unreconciled_aml_ids
mel = {}
- for aml in amls:
+ total = 0
+ for aml in amls:
strbegin = " "
strend = " | "
date = False
@@ -228,21 +239,22 @@ ${user.name}
block = " "
if aml.blocked:
block = "X"
- mel[aml.id] = strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend
+ mel[aml.id] = "" + strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend + "
"
+ if (aml.company_id.id != user.company_id.id):
+ mel[aml.id] = ""
+ else:
+ total += aml.result
%>
% for aml in amls:
-
${mel[aml.id]}
-
% endfor
-
-Total overdue amount: ${object.credit} ${object.company_id.currency_id.name}
-
+Amount due: ${total} ${object.company_id.currency_id.name}
+
]]>
@@ -277,20 +289,22 @@ ${user.name}
-
+
+
- | Invoice date |
- Reference |
+ Invoice date |
+ Reference |
Due date |
Amount |
Lit. |
<%
- amls = object.accountmoveline_ids
+ amls = object.unreconciled_aml_ids
mel = {}
- for aml in amls:
+ total = 0
+ for aml in amls:
strbegin = " "
strend = " | "
date = False
@@ -310,19 +324,22 @@ ${user.name}
block = " "
if aml.blocked:
block = "X"
- mel[aml.id] = strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend
+ mel[aml.id] = "" + strbegin + str(aml.date) + strend + strbegin + aml.ref + strend + strbegin + str(date) + strend + strbegin + str(aml.result) + strend + strbegin + block + strend + "
"
+ if (aml.company_id.id != user.company_id.id):
+ mel[aml.id] = ""
+ else:
+ total += aml.result
%>
% for aml in amls:
-
${mel[aml.id]}
-
% endfor
-Total overdue amount: ${object.credit} ${object.company_id.currency_id.name}
+Amount due: ${total} ${object.company_id.currency_id.name}
+
]]>
diff --git a/addons/account_followup/security/ir.model.access.csv b/addons/account_followup/security/ir.model.access.csv
index a20c057e050..8774015efc6 100644
--- a/addons/account_followup/security/ir.model.access.csv
+++ b/addons/account_followup/security/ir.model.access.csv
@@ -4,4 +4,4 @@ access_account_followup_followup_line_manager,account_followup.followup.line.man
access_account_followup_followup_accountant,account_followup.followup user,model_account_followup_followup,account.group_account_invoice,1,0,0,0
access_account_followup_followup_manager,account_followup.followup.manager,model_account_followup_followup,account.group_account_manager,1,1,1,1
access_account_followup_stat_invoice,account_followup.stat.invoice,model_account_followup_stat,account.group_account_invoice,1,1,1,1
-access_account_followup_stat_by_partner_manager,account_followup.stat.by.partner,model_account_followup_stat_by_partner,account.group_account_manager,1,1,1,1
+access_account_followup_stat_by_partner_manager,account_followup.stat.by.partner,model_account_followup_stat_by_partner,account.group_account_user,1,1,1,1
diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py
index 9dce1d604a6..7cdeaf2c8ee 100644
--- a/addons/account_followup/wizard/account_followup_print.py
+++ b/addons/account_followup/wizard/account_followup_print.py
@@ -140,9 +140,6 @@ class account_followup_print(osv.osv_memory):
-
-
-
def process_partners(self, cr, uid, partner_ids, data, context=None):
partner_obj = self.pool.get('res.partner')
partner_ids_to_print = []
@@ -167,7 +164,7 @@ class account_followup_print(osv.osv_memory):
if partner.max_followup_id.send_letter:
partner_ids_to_print.append(partner.id)
nbprints += 1
- message = _("Follow-up letter of ") + "\"" + partner.partner_id.latest_followup_level_id_without_lit.name + "\"" + "" + _(" will be sent")
+ 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")
@@ -177,10 +174,10 @@ class account_followup_print(osv.osv_memory):
needprinting = False
if nbprints > 0:
needprinting = True
- resulttext += ""
+ resulttext += ""
result = {}
action = partner_obj.do_partner_print(cr, uid, partner_ids_to_print, data, context)
result['needprinting'] = needprinting
@@ -189,7 +186,7 @@ class account_followup_print(osv.osv_memory):
return result
def do_update_followup_level(self, cr, uid, to_update, partner_list, date, context=None):
- #update the followupo level on account.move.line
+ #update the follow-up level on account.move.line
for id in to_update.keys():
if to_update[id]['partner_id'] in partner_list:
self.pool.get('account.move.line').write(cr, uid, [int(id)], {'followup_line_id': to_update[id]['level'], 'followup_date': date})
@@ -235,7 +232,7 @@ class account_followup_print(osv.osv_memory):
}
def _get_partners_followp(self, cr, uid, ids, context=None):
- data = {}
+ data = {}
data = self.browse(cr, uid, ids, context=context)[0]
company_id = data.company_id.id
@@ -277,7 +274,7 @@ class account_followup_print(osv.osv_memory):
# 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, will anything happen?
+ #fups[old] = (datetime.date(datetime.MAXYEAR, 12, 31), old) --> By commenting this, last level won't be printed again and again
fups
partner_list = []
to_update = {}