diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index c798c703f37..06a53bb9548 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -33,6 +33,20 @@ class followup(osv.osv): _defaults = { 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c), } + + def check_company_uniq(self, cr, uid, ids, context=None): + sr_id = self.search(cr,uid,[],context=context) + lines = self.browse(cr, uid, sr_id, context=context) + company = [] + for l in lines: + if l.company_id.id in company: + return False + if l.company_id.id not in company: + company.append(l.company_id.id) + return True + _constraints = [ + (check_company_uniq, 'Only One Folllowup by Company.',['company_id'] ) + ] followup() @@ -47,6 +61,9 @@ class followup_line(osv.osv): 'followup_id': fields.many2one('account_followup.followup', 'Follow Ups', required=True, ondelete="cascade"), 'description': fields.text('Printed Message', translate=True), } + _defaults = { + 'start': 'days', + } followup_line() diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index 326264ffdcd..50c0fbcf222 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -8,10 +8,9 @@ tree - - + @@ -22,12 +21,12 @@ form
- - + - + +