From f7c0288478ee4655752479d68418a4d88d734a8d Mon Sep 17 00:00:00 2001 From: "Chirag Dodiya (OpenERP)" Date: Thu, 13 Mar 2014 16:56:25 +0530 Subject: [PATCH] [IMP]Improved view of followup level and set method on link to open form view of followup level bzr revid: cod@tinyerp.com-20140313112625-jaqka8ezgcn0exs6 --- addons/account_followup/account_followup.py | 17 +++++++++++++++-- .../account_followup/account_followup_view.xml | 5 ++++- addons/account_followup/res_config_view.xml | 5 +---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 9237282ad80..db4cc74be72 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -31,7 +31,7 @@ class followup(osv.osv): _columns = { 'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-up'), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'name': fields.related('company_id', 'name', string = "Name"), + 'name': fields.related('company_id', 'name', string = "Name", readonly=True, type="char"), } _defaults = { 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c), @@ -480,5 +480,18 @@ class res_partner(osv.osv): multi="followup", fnct_search=_payment_earliest_date_search), } - +class account_config_settings(osv.osv_memory): + _name = 'account.config.settings' + _inherit = 'account.config.settings' + + def open_followup_level_form(self, cr, uid, ids, context=None): + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + res_ids = self.pool.get('account_followup.followup').search(cr, uid, [('company_id','=', user.company_id.id)]) + return { + 'type': 'ir.actions.act_window', + 'name': 'Payment Follow-ups', + 'res_model': 'account_followup.followup', + 'res_id': res_ids and res_ids[0] or False, + 'view_mode': 'form,tree', + } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index 55e8d099cce..7ca30837ebb 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -71,7 +71,9 @@ account_followup.followup
-

+

+