2006-12-07 13:41:40 +00:00
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
##############################################################################
|
|
|
|
#
|
2008-11-03 19:18:56 +00:00
|
|
|
# OpenERP, Open Source Management Solution
|
2009-01-04 22:12:50 +00:00
|
|
|
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
2008-11-03 19:18:56 +00:00
|
|
|
# $Id$
|
2006-12-07 13:41:40 +00:00
|
|
|
#
|
2008-11-03 19:18:56 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2006-12-07 13:41:40 +00:00
|
|
|
#
|
2008-11-03 19:18:56 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2006-12-07 13:41:40 +00:00
|
|
|
#
|
2008-11-03 19:18:56 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-12-07 13:41:40 +00:00
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
from osv import fields, osv
|
|
|
|
|
|
|
|
class followup(osv.osv):
|
2008-07-22 15:11:28 +00:00
|
|
|
_name = 'account_followup.followup'
|
|
|
|
_description = 'Follow-Ups'
|
|
|
|
_columns = {
|
|
|
|
'name': fields.char('Name', size=64, required=True),
|
|
|
|
'description': fields.text('Description'),
|
|
|
|
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-Up'),
|
|
|
|
'company_id': fields.many2one('res.company', 'Company'),
|
|
|
|
}
|
2006-12-07 13:41:40 +00:00
|
|
|
followup()
|
|
|
|
|
|
|
|
class followup_line(osv.osv):
|
2008-07-22 15:11:28 +00:00
|
|
|
_name = 'account_followup.followup.line'
|
|
|
|
_description = 'Follow-Ups Criteria'
|
|
|
|
_columns = {
|
|
|
|
'name': fields.char('Name', size=64, required=True),
|
|
|
|
'sequence': fields.integer('Sequence'),
|
|
|
|
'delay': fields.integer('Days of delay'),
|
|
|
|
'start': fields.selection([('days','Net Days'),('end_of_month','End of Month')], 'Type of Term', size=64, required=True),
|
|
|
|
'followup_id': fields.many2one('account_followup.followup', 'Follow Ups', required=True, ondelete="cascade"),
|
2009-01-28 14:43:31 +00:00
|
|
|
'description': fields.text('Printed Message', translate=True),
|
2008-07-22 15:11:28 +00:00
|
|
|
}
|
2006-12-07 13:41:40 +00:00
|
|
|
followup_line()
|
|
|
|
|
|
|
|
class account_move_line(osv.osv):
|
2008-07-22 15:11:28 +00:00
|
|
|
_name = 'account.move.line'
|
|
|
|
_inherit = 'account.move.line'
|
|
|
|
_columns = {
|
|
|
|
'followup_line_id': fields.many2one('account_followup.followup.line', 'Follow-up Level'),
|
|
|
|
'followup_date': fields.date('Latest Follow-up'),
|
|
|
|
}
|
2006-12-07 13:41:40 +00:00
|
|
|
account_move_line()
|
|
|
|
|
2009-09-15 05:45:34 +00:00
|
|
|
class res_company(osv.osv):
|
|
|
|
_inherit = "res.company"
|
|
|
|
_columns = {
|
|
|
|
'follow_up_msg' : fields.text('Follow-up Message', translate=True),
|
|
|
|
}
|
|
|
|
|
|
|
|
_defaults = {
|
|
|
|
'overdue_msg': lambda *a: '''
|
|
|
|
Date : %(date)s
|
|
|
|
|
|
|
|
Dear %(partner_name)s,
|
|
|
|
|
|
|
|
Please find in attachment a reminder of all your unpaid invoices, for a total amount due of:
|
|
|
|
|
|
|
|
%(followup_amount).2f %(company_currency)s
|
|
|
|
|
|
|
|
Thanks,
|
|
|
|
--
|
|
|
|
%(user_signature)s
|
|
|
|
%(company_name)s
|
|
|
|
'''
|
|
|
|
}
|
|
|
|
res_company()
|
2008-07-23 14:41:47 +00:00
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
|
|
|