diff options
| author | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-05-28 18:00:54 +0530 |
|---|---|---|
| committer | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-05-28 18:00:54 +0530 |
| commit | 0e90703ad0d1727c7a4511e30f335c0a3667357c (patch) | |
| tree | 1d7b40fbafd49fad81e881178701dbd9922a899a /addons/project_long_term/project_long_term.py | |
| parent | 2d7e6b8f1ee576b70c4478259c534d5a50fe0f36 (diff) | |
[IMP]add boolean of project,projec_longterm,and project issue and create related project
bzr revid: sgo@tinyerp.com-20120528123054-ntp1u33q1iavwtej
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 19d58f101ef..11ecdd940f9 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -225,13 +225,9 @@ class project(osv.osv): _columns = { 'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"), - 'use_phases': fields.boolean('Use Phases', help="Check this field if project manages phases"), 'phase_count': fields.function(_phase_count, type='integer', string="Open Phases"), } - _defaults = { - 'use_phases': True, - } - + def schedule_phases(self, cr, uid, ids, context=None): context = context or {} if type(ids) in (long, int,): @@ -273,6 +269,24 @@ class project(osv.osv): return True project() +class account_analytic_account(osv.osv): + _inherit = 'account.analytic.account' + _description = 'Analytic Account' + _columns = { + 'use_phases': fields.boolean('Phases Planing', help="Check this field if project manages phases"), + } +# _defaults = { +# 'use_phases': True, +# } + def create(self, cr, uid, vals, context=None): + if context is None: + context = {} + obj_id = super(account_analytic_account, self).create(cr, uid, vals, context=context) + if vals.get('use_phases', False): + self.project_create(cr, uid, obj_id, vals, context) + return obj_id +account_analytic_account() + class project_task(osv.osv): _inherit = "project.task" _columns = { |
