diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-10-02 09:49:31 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-10-02 09:49:31 +0200 |
| commit | 4d2299adc4e9d7db2cb52a79cf4ab8ebaad707ae (patch) | |
| tree | 8a45a95b39d3b060fdef188f3da8a70fbfe20ad5 /addons/project | |
| parent | 32d492acf9db0a57487a1c6c47e4311d842e99f7 (diff) | |
| parent | a5fac44994a5d2c0e20cdde0bf72ef152d2342dd (diff) | |
[MERGE] trunk
bzr revid: fme@openerp.com-20121002074931-845aiqhflw2rqrcn
Diffstat (limited to 'addons/project')
| -rw-r--r-- | addons/project/i18n/nl.po | 8 | ||||
| -rw-r--r-- | addons/project/project.py | 12 | ||||
| -rw-r--r-- | addons/project/project_view.xml | 61 |
3 files changed, 40 insertions, 41 deletions
diff --git a/addons/project/i18n/nl.po b/addons/project/i18n/nl.po index f543f48834e..f8c8bc84ba9 100644 --- a/addons/project/i18n/nl.po +++ b/addons/project/i18n/nl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-02-08 01:37+0100\n" -"PO-Revision-Date: 2012-06-28 12:50+0000\n" +"PO-Revision-Date: 2012-09-29 14:57+0000\n" "Last-Translator: Erwin <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-21 04:42+0000\n" -"X-Generator: Launchpad (build 15985)\n" +"X-Launchpad-Export-Date: 2012-09-30 04:44+0000\n" +"X-Generator: Launchpad (build 16049)\n" #. module: project #: view:report.project.task.user:0 @@ -1326,7 +1326,7 @@ msgstr "" #. module: project #: view:project.task:0 msgid "Delegation" -msgstr "" +msgstr "Delegeren" #. module: project #: model:ir.model,name:project.model_res_users diff --git a/addons/project/project.py b/addons/project/project.py index 3572fd094b3..0d92d71a45f 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -509,6 +509,8 @@ def Project(): model_name=vals.get('alias_model', 'project.task'), context=context) vals['alias_id'] = alias_id + if vals.get('partner_id', False): + vals['type'] = 'contract' project_id = super(project, self).create(cr, uid, vals, context) mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'project_id': project_id} }, context) self.create_send_note(cr, uid, [project_id], context=context) @@ -690,7 +692,6 @@ class task(base_stage, osv.osv): if not default.get('remaining_hours', False): default['remaining_hours'] = float(self.read(cr, uid, id, ['planned_hours'])['planned_hours']) default['active'] = True - default['stage_id'] = False if not default.get('name', False): default['name'] = self.browse(cr, uid, id, context=context).name or '' if not context.get('copy',False): @@ -768,7 +769,7 @@ class task(base_stage, osv.osv): }), 'user_id': fields.many2one('res.users', 'Assigned to'), 'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'), - 'partner_id': fields.many2one('res.partner', 'Contact'), + 'partner_id': fields.many2one('res.partner', 'Customer'), 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'), 'manager_id': fields.related('project_id', 'analytic_account_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'), 'company_id': fields.many2one('res.company', 'Company'), @@ -1100,6 +1101,10 @@ class task(base_stage, osv.osv): def create(self, cr, uid, vals, context=None): task_id = super(task, self).create(cr, uid, vals, context=context) + project_id = self.browse(cr, uid, task_id, context=context).project_id + if project_id: + followers = [follower.id for follower in project_id.message_follower_ids] + self.message_subscribe(cr, uid, [task_id], followers, context=context) self._store_history(cr, uid, [task_id], context=context) self.create_send_note(cr, uid, [task_id], context=context) return task_id @@ -1109,6 +1114,9 @@ class task(base_stage, osv.osv): def write(self, cr, uid, ids, vals, context=None): if isinstance(ids, (int, long)): ids = [ids] + if vals.get('project_id'): + project_id = self.pool.get('project.project').browse(cr, uid, vals.get('project_id'), context=context) + vals['message_follower_ids'] = [(4, follower.id) for follower in project_id.message_follower_ids] if vals and not 'kanban_state' in vals and 'stage_id' in vals: new_stage = vals.get('stage_id') vals_reset_kstate = dict(vals, kanban_state='normal') diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 83d3414f74e..e302199a65c 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -10,15 +10,14 @@ <menuitem id="menu_project_management" name="Project" parent="base.menu_main_pm" sequence="1"/> <menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/> - - <act_window - context="{'search_default_project_id': [active_id], 'default_project_id': active_id}" - id="act_project_project_2_project_task_all" - name="Tasks" - res_model="project.task" - src_model="project.project" - view_mode="kanban,tree,form,calendar,graph" - view_type="form"/> + + <record id="act_project_project_2_project_task_all" model="ir.actions.act_window"> + <field name="res_model">project.task</field> + <field name="view_type">form</field> + <field name="name">Tasks</field> + <field name="view_mode">kanban,tree,form,calendar,graph</field> + <field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field> + </record> <!-- Project Read/Unread actions --> <record id="actions_server_project_unread" model="ir.actions.server"> @@ -93,12 +92,12 @@ </div> <group> <group> + <field name="privacy_visibility"/> <field name="user_id" string="Project Manager" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/> - <field name="partner_id" string="Contact" on_change="onchange_partner_id(partner_id)"/> </group> <group> - <field name="privacy_visibility"/> - <field name="analytic_account_id" readonly="1" required="0"/> + <field name="partner_id" on_change="onchange_partner_id(partner_id)"/> + <field name="analytic_account_id" readonly="1" required="0" attrs="{'invisible': [('analytic_account_id','=',False)]}"/> </group> </group> <notebook> @@ -122,14 +121,14 @@ </field> </page> <page string="Other Info"> - <group string="Email Interface" colspan="2"> - <div attrs="{'invisible': [('alias_domain', '=', False)]}"> - <field name="alias_id" invisible="1" required="0"/> - <label for="alias_name" class="oe_edit_only "/> - <field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/> - </div> - </group> <group> + <group string="Email Interface" attrs="{'invisible': [('alias_domain', '=', False)]}"> + <div> + <field name="alias_id" invisible="1" required="0"/> + <label for="alias_name" class="oe_edit_only "/> + <field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/> + </div> + </group> <group string="Administration" groups="project.group_time_work_estimation_tasks"> <field name="planned_hours" widget="float_time"/> <field name="effective_hours" widget="float_time"/> @@ -137,8 +136,7 @@ </group> <group string="Miscellaneous" name="misc"> <field name="date"/> - <field name="parent_id" domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}"/> - <field name="priority"/> + <field name="priority" groups="base.group_no_one"/> <field name="active" attrs="{'invisible':[('state','in',['open', 'pending', 'template'])]}"/> <field name="currency_id" groups="base.group_multi_currency" required="1"/> @@ -152,8 +150,9 @@ </notebook> </sheet> <div class="oe_chatter"> + <field name="message_is_follower" invisible="1"/> <field name="message_ids" widget="mail_thread"/> - <field name="message_follower_ids" widget="mail_followers"/> + <field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically follow all related tasks and issues."/> </div> </form> </field> @@ -207,15 +206,6 @@ </field> </record> - <act_window - context="{'search_default_project_id': active_id, 'default_project_id': active_id}" - id="act_project_project_2_project_task_all" - name="Tasks" - res_model="project.task" - src_model="project.project" - view_mode="kanban,tree,form,calendar,graph" - view_type="form"/> - <record model="ir.ui.view" id="view_project_kanban"> <field name="name">project.project.kanban</field> <field name="model">project.project</field> @@ -250,7 +240,7 @@ <a t-if="record.use_tasks.raw_value" name="%(act_project_project_2_project_task_all)d" type="action"> <field name="task_count"/> Tasks</a> </div> <div class="oe_kanban_footer_left"> - <span> + <span groups="project.group_time_work_estimation_tasks"> <span class="oe_e">R</span> <t t-esc="Math.round(record.effective_hours.raw_value)"/>/<t t-esc="Math.round(record.planned_hours.raw_value)"/> <field name="company_uom_id"/> </span> @@ -478,6 +468,7 @@ </notebook> </sheet> <div class="oe_chatter"> + <field name="message_is_follower" invisible="1"/> <field name="message_ids" widget="mail_thread"/> <field name="message_follower_ids" widget="mail_followers"/> </div> @@ -529,7 +520,7 @@ <div class="oe_kanban_content"> <div><b><field name="name"/></b></div> <div> - <field name="project_id"/> + <field name="project_id"/><br/> <t t-esc="kanban_text_ellipsis(record.description.value, 160)"/><br/> <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t> <span t-attf-class="#{red || ''}"><i><field name="date_deadline"/></i></span> @@ -723,7 +714,7 @@ </record> <record id="ir_project_task_open" model="ir.values"> - <field eval=" 'tree_but_open'" name="key2"/> + <field eval="'tree_but_open'" name="key2"/> <field eval="'project.project'" name="model"/> <field name="name">View project's tasks</field> <field eval="'ir.actions.act_window,'+str(dblc_proj)" name="value"/> @@ -767,7 +758,7 @@ <field name="model">project.task.type</field> <field name="arch" type="xml"> <tree string="Task Stage"> - <field name="sequence"/> + <field name="sequence" widget="handle"/> <field name="name"/> <field name="state"/> </tree> |
