[FIX] some undefined references:
[odoo/odoo.git] / addons / account_followup / followup.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #    
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6 #
7 #    This program is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU Affero General Public License as
9 #    published by the Free Software Foundation, either version 3 of the
10 #    License, or (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU Affero General Public License for more details.
16 #
17 #    You should have received a copy of the GNU Affero General Public License
18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
19 #
20 ##############################################################################
21
22 from osv import fields, osv
23
24 class followup(osv.osv):
25     _name = 'account_followup.followup'
26     _description = 'Follow-Ups'
27     _columns = {
28         'name': fields.char('Name', size=64, required=True),
29         'description': fields.text('Description'),
30         'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-Up'),
31         'company_id': fields.many2one('res.company', 'Company'),
32     }
33 followup()
34
35 class followup_line(osv.osv):
36     _name = 'account_followup.followup.line'
37     _description = 'Follow-Ups Criteria'
38     _columns = {
39         'name': fields.char('Name', size=64, required=True),
40         'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of follow-up lines."),
41         'delay': fields.integer('Days of delay'),
42         'start': fields.selection([('days','Net Days'),('end_of_month','End of Month')], 'Type of Term', size=64, required=True),
43         'followup_id': fields.many2one('account_followup.followup', 'Follow Ups', required=True, ondelete="cascade"),
44         'description': fields.text('Printed Message', translate=True),
45     }
46 followup_line()
47
48 class account_move_line(osv.osv):
49     _name = 'account.move.line'
50     _inherit = 'account.move.line'
51     _columns = {
52         'followup_line_id': fields.many2one('account_followup.followup.line', 'Follow-up Level'),
53         'followup_date': fields.date('Latest Follow-up'),
54     }
55 account_move_line()
56
57 class res_company(osv.osv):
58     _inherit = "res.company"
59     _columns = {
60         'follow_up_msg' : fields.text('Follow-up Message', translate=True),
61     }
62
63     _defaults = {
64         'overdue_msg': lambda *a: '''
65 Date : %(date)s
66
67 Dear %(partner_name)s,
68
69 Please find in attachment a reminder of all your unpaid invoices, for a total amount due of:
70
71 %(followup_amount).2f %(company_currency)s
72
73 Thanks,
74 --
75 %(user_signature)s
76 %(company_name)s
77         '''
78     }
79 res_company()
80
81 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
82