summaryrefslogtreecommitdiff
path: root/addons/project_long_term/project_long_term.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-07-25 22:58:40 +0200
committerAntony Lesuisse <al@openerp.com>2012-07-25 22:58:40 +0200
commitecd5ca73c8b87e44905f6083f1b2bf280f87b3f9 (patch)
tree6ef34889dd89deda604e62e2df1e2badf03a265c /addons/project_long_term/project_long_term.py
parent4b073c0a888b38eb6d79e0c8c78b2cd5096b3b3b (diff)
parent649fa8798e349916e8088136b73d0193eac95da7 (diff)
[MERGE] trunk
bzr revid: al@openerp.com-20120725205840-8d86kc0zr0uwb6j2
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
-rw-r--r--addons/project_long_term/project_long_term.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 19d58f101ef..7604d43af1b 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -114,7 +114,7 @@ class project_phase(osv.osv):
'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'user_force_ids': fields.many2many('res.users', string='Force Assigned Users'),
'user_ids': fields.one2many('project.user.allocation', 'phase_id', "Assigned Users",states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]},
- help="The ressources on the project can be computed automatically by the scheduler"),
+ help="The resources on the project can be computed automatically by the scheduler."),
'state': fields.selection([('draft', 'New'), ('cancelled', 'Cancelled'),('open', 'In Progress'), ('pending', 'Pending'), ('done', 'Done')], 'Status', readonly=True, required=True,
help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\
\n If the phase is over, the states is set to \'Done\'.'),
@@ -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,19 @@ 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"),
+ }
+
+ def _trigger_project_creation(self, cr, uid, vals, context=None):
+ res= super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context)
+ return res or vals.get('use_phases')
+
+account_analytic_account()
+
class project_task(osv.osv):
_inherit = "project.task"
_columns = {