diff options
| author | sbh (Open ERP) <sbh@tinyerp.com> | 2010-01-25 10:44:10 +0530 |
|---|---|---|
| committer | sbh (Open ERP) <sbh@tinyerp.com> | 2010-01-25 10:44:10 +0530 |
| commit | 40cb4beffd99e49c2c3abfcfdec322ddd1de8019 (patch) | |
| tree | db7d539853e35844b2f1518281aeedaa75597b69 /addons/document_change | |
| parent | ca052da705c17e8fd5a4dd88f997d8e134ed2561 (diff) | |
| parent | 4dd0244aff71a81ef29aed7906c3057addc2b923 (diff) | |
merge
bzr revid: sbh@tinyerp.com-20100125051410-akoeusvwbjbx0fm6
Diffstat (limited to 'addons/document_change')
| -rw-r--r-- | addons/document_change/__init__.py | 1 | ||||
| -rw-r--r-- | addons/document_change/document_change.py | 153 | ||||
| -rw-r--r-- | addons/document_change/document_change_mailgate.py | 99 | ||||
| -rw-r--r-- | addons/document_change/document_change_view.xml | 131 | ||||
| -rw-r--r-- | addons/document_change/document_change_workflow.xml | 96 | ||||
| -rw-r--r-- | addons/document_change/document_phase_workflow.xml | 42 | ||||
| -rw-r--r-- | addons/document_change/document_process_workflow.xml | 60 |
7 files changed, 367 insertions, 215 deletions
diff --git a/addons/document_change/__init__.py b/addons/document_change/__init__.py index 636a81b4e1b..2cf5916bbfe 100644 --- a/addons/document_change/__init__.py +++ b/addons/document_change/__init__.py @@ -20,5 +20,6 @@ ############################################################################## import document_change +import document_change_mailgate # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py index d23b64e1e9d..33aa7c73878 100644 --- a/addons/document_change/document_change.py +++ b/addons/document_change/document_change.py @@ -35,7 +35,7 @@ class document_change_type(osv.osv): _columns = { 'name': fields.char("Document Change Type", size=64,required=True), - 'phase_type_ids': fields.many2many('document.change.process.phase.type','document_process__rel','type_id','change_id','Phase Type'), + 'phase_type_ids': fields.many2many('document.change.process.phase.type','document_type_phase_type_rel','document_type_id','phase_type_id','Phase Type'), 'template_document_id':fields.many2one('ir.attachment','Document') } document_change_type() @@ -48,7 +48,7 @@ class doucment_change_process_phase_type(osv.osv): 'name': fields.char("Document Changed Process Type", size=64), 'sequence': fields.integer('Sequence'), 'active': fields.boolean('Active'), - 'document_type_ids': fields.many2many('document.change.type','document_phase_process__rel','phase_id','document_id','Document'), + 'document_type_ids': fields.many2many('document.change.type','phase_type_document_type_rel','phase_type_id','document_type_id','Document Type'), } doucment_change_process_phase_type() @@ -67,8 +67,8 @@ class doucment_change_process_phase(osv.osv): 'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Process')], 'Update Document', required=True), 'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type'), 'date_control': fields.date('Control Date', select=True), - 'phase_ids':fields.many2one('document.change.process.phase','Phase Type'), - 'state': fields.selection([('draft', 'Draft'),('in_process', 'Started'),('validate', 'To Validate'),('pending', 'Pending'), ('done', 'Done')], 'Status',readonly=True), + 'phase_type_id':fields.many2one('document.change.process.phase.type','Phase Type'), + 'state': fields.selection([('draft', 'Draft'),('in_process', 'Started'),('to_validate', 'To Validate'),('done', 'Done')], 'State',readonly=True), 'phase_document_ids':fields.many2many('ir.attachment','phase_document_rel','phase_id','document_id','Document'), } _defaults = { @@ -76,19 +76,19 @@ class doucment_change_process_phase(osv.osv): 'update_document': lambda *a:'at_endPhase', 'type':lambda *a: 'no_control', } - def state_draft_set(self, cr, uid, ids, *args): + def do_draft(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state':'draft'}) return True - def state_validate_set(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state':'validate'}) + + def do_confirm(self, cr, uid, ids, *args): + self.write(cr, uid, ids, {'state':'to_validate'}) return True - def state_started_set(self, cr, uid, ids, *args): + + def do_start(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state':'in_process'}) - return True - def state_pending_set(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state':'pending'}) - return True - def state_done_set(self, cr, uid, ids, *args): + return True + + def do_done(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state':'done'}) return True @@ -101,43 +101,10 @@ class document_change_process_model(osv.osv): _columns = { 'name': fields.char("Changed Process Model", size=64,required=True), 'sequence': fields.integer('Sequence'), - 'phase_type_ids':fields.many2many('document.change.process.phase.type','phase_type_rel','phase_id','phase_model_id','Process Type'), + 'phase_type_ids':fields.many2many('document.change.process.phase.type','process_model_phase_type_rel','process_model_id','phase_type_id','Phase Type'), } document_change_process_model() - -class document_file(osv.osv): - _inherit = 'ir.attachment' - - _columns = { - 'type_id':fields.many2one('document.change.type','Document Type'), - 'state': fields.selection([('change_request', 'Change Request'),('change_proposed', 'Change Proposed'), ('in_production', 'In Production'), ('to_update', 'To Update'), ('validate', 'To Validate'), ('cancel', 'Cancel')], 'Status'), - 'target_document_id': fields.many2one('document.directory', 'Target Document'), - 'target':fields.binary('Target'), - } - _defaults = { - 'state': lambda *a: 'change_request', - } - def state_set_request(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {'state':'change_request'},context=context) - return True - def state_set_proposed(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {'state':'change_proposed'},context=context) - return True - def state_set_in_production(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {'state':'in_production'}) - return True - def state_set_update(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {'state':'to_update'}) - return True - def state_set_validated(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {'state':'validate'},context=context) - return True - def state_set_cancel(self, cr, uid, ids, context={}): - return self.write(cr, uid, ids, {'state':'cancel'},context=context) - -document_file() - class document_change_process_type(osv.osv): _name = "document.change.process.type" _description = "Document Change Process Type" @@ -157,6 +124,7 @@ class document_change_process_email(osv.osv): 'process_id':fields.many2one('document.change.process','Process Change'), } document_change_process_email() + class doucment_change_process(osv.osv): _name = "document.change.process" @@ -178,15 +146,98 @@ class doucment_change_process(osv.osv): 'create_date':fields.datetime('Creation',readonly=True), 'latest_modified_date':fields.function(_latestmodification, method=True, type='date', string="Lastest Modification"), #TODO no year! 'date_expected':fields.datetime('Expected Production'), - 'state':fields.selection([('draft', 'Draft'),('progress', 'Progress'),('confirmed', 'To Validate'), ('done', 'Done'),('cancel','Cancelled')], 'Status', readonly=True), - 'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'), + 'state':fields.selection([('draft', 'Draft'),('in_progress', 'In Progress'),('to_validate', 'To Validate'), ('pending', 'Pending'), ('done', 'Done'),('cancel','Cancelled')], 'state', readonly=True), + 'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'), + 'pending_directory_id' :fields.many2one('document.directory','Pending Directory ID'), + 'date_control': fields.date('Control Date'), #TODO: make relate field with current_phase_id.date_control + 'progress': fields.float('Progress'), #TODO : functio field: calculate progress + 'current_phase_id': fields.many2one('document.change.process.phase','Current Phase'), # TODO: function field. find out in process phase 'process_document_ids': fields.many2many('ir.attachment','document_changed_process_rel','process_id','change_id','Document To Change'), - 'pending_directory_id' :fields.many2one('document.directory','Pending Directory ID'), - 'email_notification_ids':fields.one2many('document.change.process.mail','process_id','Notifications'), } _defaults = { 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'document.change.process'), 'state': lambda *a: 'draft', } + def do_start(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'in_progress'},context=context) + return True + + def do_pending(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'pending'},context=context) + return True + + def do_confirm(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'to_validate'},context=context) + return True + + def do_done(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'done'},context=context) + return True + + def do_cancel(self, cr, uid, ids, context={}): + return self.write(cr, uid, ids, {'state':'cancel'},context=context) + + def generate_phases(self, cr, uid, ids, *args): + phase_obj = self.pool.get('document.change.process.phase') + phase_type_obj = self.pool.get('document.change.process.phase.type') + document_type_obj = self.pool.get('document.change.type') + document_obj = self.pool.get('ir.attachment') + for process in self.browse(cr, uid, ids): + if process.process_model_id: + for phase_type_id in process.process_model_id.phase_type_ids: + phase_type = phase_type_obj.browse(cr, uid, phase_type_id) + phase_value = { + 'name' : '%s-%s' %(phase_type, process.name), + 'phase_type_id': phase_type_id, + 'process_id': process.id + } + phase_id = phase_obj.create(cr, uid, phase_value) + cr.execute('select document_type_id from document_type_phase_type_rel where phase_type_id = %s' ,phase_type_id) + document_type_ids = map(lambda x: x[0], cr.fetchall()) + document_ids = document_obj.search(cr, uid, [ + ('parent_id','=',process.structure_id and process.structure_id.id), + ('change_type_id','in',document_type_ids)]) + for document_id in document_ids: + vals = {'process_phase_id':phase_id} + if process.pending_directory_id: + vals.update({'parent_id':process.pending_directory_id.id}) + document_obj.copy(cr, uid, document_id, vals) + doucment_change_process() + +class document_file(osv.osv): + _inherit = 'ir.attachment' + + _columns = { + 'change_type_id':fields.many2one('document.change.type','Document Type'), + 'state': fields.selection([('in_production', 'In Production'), ('change_request', 'Change Request'),('change_propose', 'Change Proposed'), ('to_update', 'To Update'), ('cancel', 'Cancel')], 'State'), + 'target_directory_id': fields.many2one('document.directory', 'Target Document'), + 'target_document_id':fields.binary('Target'), + 'process_phase_id' :fields.many2one('document.change.process.phase','Process Phase'), + 'progress': fields.float('Progress'), #TODO : functio field: calculate progress + 'change_process_id': fields.related('process_phase_id', 'process_id', type='many2one', relation='document.change.process', string='Change Process'), + } + _defaults = { + 'state': lambda *a: 'in_production', + } + def do_change_request(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'change_request'},context=context) + return True + + def do_change_propose(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'change_propose'},context=context) + return True + + def do_to_update(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'to_update'},context=context) + return True + + def do_production(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'in_production'},context=context) + return True + + def do_cancel(self, cr, uid, ids, context={}): + return self.write(cr, uid, ids, {'state':'cancel'},context=context) + +document_file() diff --git a/addons/document_change/document_change_mailgate.py b/addons/document_change/document_change_mailgate.py new file mode 100644 index 00000000000..ecc6522004f --- /dev/null +++ b/addons/document_change/document_change_mailgate.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import time +import re +import os + +import mx.DateTime +import base64 + +from tools.translate import _ + +import tools +from osv import fields,osv,orm +from osv.orm import except_orm + +class document_file(osv.osv): + _inherit = "ir.attachment" + + _columns = { + 'email_notification_ids':fields.one2many('document.email.notes','document_id','Phase', readonly=True), + } + + def msg_new(self, cr, uid, msg): + raise Exception(_('Sorry, Not Allowed to create document')) + return False + + def msg_update(self, cr, uid, id, msg, data={}, default_act='pending'): + mailgate_obj = self.pool.get('mail.gateway') + msg_actions, body_data = mailgate_obj.msg_act_get(msg) + email_notify_data = { + 'name' : msg['Subject'], + 'description' : body_data, + 'email' : msg['From'], + } + data.update({ + 'email_notification_ids': [(0, 0, email_notify_data)], + }) + res = self.write(cr, uid, [id], data) + return res + + def emails_get(self, cr, uid, ids, context={}): + res = [] + if isinstance(ids, (str, int, long)): + select = [ids] + else: + select = ids + for document in self.browse(cr, uid, select): + user_email = (document.user_id and document.user_id.address_id and document.user_id.address_id.email) or False + res += [(user_email, False, False, False)] + if isinstance(ids, (str, int, long)): + return len(res) and res[0] or False + return res + + def msg_send(self, cr, uid, id, *args, **argv): + return True + +document_file() + + +class document_email_notes(osv.osv): + _name = "document.email.notes" + _description = "EMail Conversation Detail" + + def _note_get(self, cursor, user, ids, name, arg, context=None): + res = {} + for hist in self.browse(cursor, user, ids, context or {}): + res[hist.id] = (hist.email or '/') + ' (' + str(hist.create_date) + ')\n' + res[hist.id] += (hist.description or '') + return res + + _columns = { + 'name': fields.char("Name", size=64, required=True, select=True), + 'description': fields.text('Description'), + 'note': fields.function(_note_get, method=True, string="Description", type="text"), + 'email': fields.char('Email', size=84), + 'create_date': fields.datetime('Created Date'), + 'action': fields.char('Action', size=64), + 'document_id': fields.many2one('ir.attachment','Document', required=True), + } +document_email_notes() diff --git a/addons/document_change/document_change_view.xml b/addons/document_change/document_change_view.xml index 7e969556afe..9d66714035d 100644 --- a/addons/document_change/document_change_view.xml +++ b/addons/document_change/document_change_view.xml @@ -74,7 +74,8 @@ <field name="arch" type="xml"> <form string="Document Types"> <field name="name" select="1"/> - <field name="phase_type_ids" colspan="4"/> + <separator string="Associated Phase Types" colspan="4"/> + <field name="phase_type_ids" colspan="4" nolabel="1"/> </form> </field> </record> @@ -85,8 +86,7 @@ <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Document Types"> - <field name="name"/> - <field name="phase_type_ids"/> + <field name="name"/> </tree> </field> </record> @@ -189,7 +189,8 @@ <form string="Model of Changes"> <field name="name" select="1"/> <field name="sequence"/> - <field name="phase_type_ids" colspan="4"/> + <separator string="Phase Type" colspan="4"/> + <field name="phase_type_ids" colspan="4" nolabel="1"/> </form> </field> </record> @@ -199,10 +200,9 @@ <field name="model">document.change.process.model</field> <field name="type">tree</field> <field name="arch" type="xml"> - <tree string="Model of Changes"> - <field name="name"/> + <tree string="Model of Changes"> <field name="sequence"/> - <field name="phase_type_ids"/> + <field name="name"/> </tree> </field> </record> @@ -232,20 +232,20 @@ <newline/> <field name="datas_fname"/> <field name="datas" filename="datas_fname" string="Content"/> - <field name="type_id"/> + <field name="change_type_id"/> </group> <separator string="Change Control" colspan="4"/> <group col="7" colspan="4"> - <field name="state"/> - <button name="button_change_proposed" states="cancel,to_update" string="Request Change" icon="gtk-apply"/> - <button name="button_change_validated" states="change_request,validate,cancel" string="Propose Change" icon="gtk-apply"/> - <button name="button_update" states="change_proposed,in_production" string="To Update" icon="gtk-ok" /> - <button name="button_change_request" states="to_update" string="In Production" icon="gtk-media-play"/> - <button name="button_cancel" states="change_request,change_proposed" string="Cancel" icon="gtk-cancel"/> + <field name="state" readonly="1"/> + <button name="button_propose" states="change_request" string="Propose Change" icon="gtk-apply"/> + <button name="button_confirm" states="change_propose" string="To Validate" icon="gtk-apply"/> + <button name="button_validate" states="to_update" string="In Production" icon="gtk-apply"/> + <button name="button_request" states="cancel,in_production" string="Request Change" icon="gtk-media-play"/> + <button name="button_cancel" states="change_request,change_propose" string="Cancel" icon="gtk-cancel"/> </group> <newline/> - <field name="target_document_id"/> - <field name="target"/> + <field name="target_directory_id"/> + <field name="target_document_id"/> <newline/> <separator string="Change Note" colspan="4"/> <field colspan="4" name="description" nolabel="1"/> @@ -259,6 +259,21 @@ <field name="write_date" readonly="1"/> <field name="write_uid" readonly="1"/> </group> + + <field name="email_notification_ids" colspan="4" mode="tree, form" readonly="1" widget="one2many_list" nolabel="1"> + <tree string="Notifications"> + <field name="email"/> + <field name="create_date"/> + </tree> + <form string="Notifications"> + <field name="email"/> + <field name="create_date"/> + <field name="name" string="Subject" colspan="4"/> + <separator string="Description" colspan="4"/> + <field colspan="4" name="description" nolabel="1"/> + </form> + </field> + </form> </field> </record> @@ -269,12 +284,11 @@ <field name="priority" eval="1"/> <field name="arch" type="xml"> <tree string="Documents"> - <field name="name" string="Document Name"/> - <field name="partner_id"/> - <field name="datas_fname"/> - <field name="create_date"/> - <field name="write_date"/> + <field name="parent_id" string="Directory"/> + <field name="change_type_id" string="Type"/> <field name="state"/> + <field name="change_process_id" string="Proc Chg #"/> + <field name="user_id" string="Owner"/> </tree> </field> </record> @@ -284,7 +298,7 @@ <field name="type">graph</field> <field name="arch" type="xml"> <graph string="Documents by type" type="bar" orientation="vertical"> - <field name="type_id"/> + <field name="change_type_id"/> <field name="name" operator="+"/> </graph> </field> @@ -297,9 +311,9 @@ <field name="arch" type="xml"> <search string="Documents"> <group col="7" colspan="4"> - <filter domain="[('state','=','change_request')]" string="To Change" icon="gtk-apply" help="Documents in state Change Requested"/> - <filter domain="[('state','=','change_proposed')]" string="To Validate" icon="gtk-execute" help="Documents in state Change Proposed"/> - <field name="type_id" string="Type of Documents" select="1"/> + <filter domain="[('state','=','change_request')]" string="To Change" icon="gtk-apply"/> + <filter domain="[('state','=','to_update')]" string="To Validate" icon="gtk-execute"/> + <field name="change_type_id" string="Type of Documents" select="1"/> <field name="parent_id" select="1"/> <field name="create_uid" string="Owner" select="1"/> </group> @@ -359,7 +373,7 @@ <field name="view_type">form</field> <field name="view_mode">tree,form</field> <field name="view_id" ref="view_document_tree"/> - <field name="domain">[('state','=','change_proposed')]</field> + <field name="domain">[('state','=','to_update')]</field> </record> <menuitem action="action_document_to_update_form" id="menu_documents_to_update_form" parent="menu_change_control"/> @@ -380,7 +394,7 @@ <field name="update_document" string="Update documents"/> <field name="type" string="Type"/> <field name="date_control" string="Control date" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/> - <field name="phase_ids" string="Phase Type"/> + <field name="phase_type_id" string="Phase Type"/> </group> <separator colspan="4" string="Documents"/> <field name="phase_document_ids" colspan="4" nolabel="1"/> @@ -388,10 +402,8 @@ <group col="5" colspan="4"> <field name="state"/> <button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/> - <button name="button_validate" states="started" string="Validate" icon="gtk-execute"/> - <button name="button_pending" states="pending" string="Pending" icon="gtk-execute"/> - <button name="button_done" states="done" string="Done" icon="gtk-jump-to"/> - <button name="button_progress" states="validate" string="Done" icon="gtk-jump-to"/> + <button name="button_confirm" states="in_process" string="To Validate" icon="gtk-execute"/> + <button name="button_end" states="to_validate" string="Done" icon="gtk-jump-to"/> </group> </form> </field> @@ -449,7 +461,10 @@ <field name="structure_id" select="1"/> <newline/> <field name="description"/> - <field name="process_model_id" widget="selection"/> + <group colspan="2" col="3"> + <field name="process_model_id" widget="selection"/> + <button name="generate_phases" string="Generate Phases" type="object" icon="gtk-convert"/> + </group> <field name="pending_directory_id"/> </group> <notebook colspan="4"> @@ -470,10 +485,10 @@ <newline/> <group col="6" colspan="4"> <field name="state"/> - <button name="button_in_progress" states="draft" string="Start" icon="gtk-go-forward"/> - <button name="button_validate" states="progress" string="Validate" icon="gtk-execute"/> - <button name="button_pending" states="progress,confirmed" string="Pending" icon="gtk-media-pause"/> - <button name="button_done" states="confirmed" string="Done" icon="gtk-jump-to"/> + <button name="button_start" states="draft,pending" string="Start" icon="gtk-go-forward"/> + <button name="button_confirm" states="in_progress" string="Validate" icon="gtk-execute"/> + <button name="button_pending" states="in_progress" string="Pending" icon="gtk-media-pause"/> + <button name="button_done" states="to_validate" string="Done" icon="gtk-jump-to"/> </group> </page> <page string="Phases"> @@ -491,31 +506,12 @@ <field name="state"/> </form> </field> - </page> - <page string="Documents"> - <field name="process_document_ids" mode="tree,form" colspan="4" nolabel="1"> - <tree string="Documents"> - <field name="name" string="Document Name"/> - <field name="state"/> - </tree> - <form string="Documents"> - <field name="name" string="Document Name"/> - <field name="state"/> - </form> + </page> + <page string="Documents"> + <field name="process_document_ids"> </field> </page> - <page string="Notifications"> - <field name="email_notification_ids" mode="tree,form" widget="one2many_list" nolabel="1"> - <tree string="Notifications" editable="True"> - <field name="name"/> - <field name="type"/> - </tree> - <form string="Notifications"> - <field name="name"/> - <field name="type"/> - </form> - </field> - </page> + </notebook> </form> </field> @@ -527,12 +523,15 @@ <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Process Change"> - <field name="name"/> - <field name="process_type_id"/> <field name="structure_id"/> - <field name="description"/> + <field name="name" string="Proc Chg #"/> + <field name="description" string="Proc Chg Title"/> + <field name="user_id" string="Owner"/> + <field name="current_phase_id" string="Current Phase"/> + <field name="date_control" string="Date Control Point"/> <field name="process_model_id"/> - <field name="state"/> + <field name="progress" string="Progress"/> + <field name="process_document_ids" string="# Documents"/> </tree> </field> </record> @@ -546,7 +545,7 @@ <field name="process_document_ids" operator="+"/> </graph> </field> - </record> + </record> <record model="ir.ui.view" id="view_process_serach"> <field name="name">document.change.process.search</field> <field name="model">document.change.process</field> @@ -556,7 +555,7 @@ <search string="Process Changes"> <group col="8" colspan="4"> <filter domain="[('user_id','=',uid)]" string="My Process Changes" icon="gtk-execute" help="My Process Changes"/> - <filter domain="[('state','=','validate')]" string="To Validate" icon="gtk-apply" help="Process Changes to be validated"/> + <filter domain="[('state','=','to_validate')]" string="To Validate" icon="gtk-apply" help="Process Changes to be validated"/> <filter domain="[('state','=','in_progress')]" string="Late" icon="gtk-execute" help="Process changes having the next Phase to validate that is late"/> <field name="name" string="Process Change Title" select="1"/> <field name="process_type_id" select="1"/> @@ -604,4 +603,4 @@ src_model="document.change.process"/> </data> -</openerp>
\ No newline at end of file +</openerp> diff --git a/addons/document_change/document_change_workflow.xml b/addons/document_change/document_change_workflow.xml index 0c74d95d254..7a3793248c7 100644 --- a/addons/document_change/document_change_workflow.xml +++ b/addons/document_change/document_change_workflow.xml @@ -8,72 +8,74 @@ </record> <!-- States --> - <record id="act_request" model="workflow.activity"> + <record id="act_document_production" model="workflow.activity"> <field name="wkf_id" ref="wkf_attachment"/> <field name="flow_start">True</field> - <field name="name">state_set_request</field> + <field name="name">in_production</field> + <field name="action">do_production()</field> + <field name="kind">function</field> </record> - <record id="act_propose" model="workflow.activity"> - <field name="wkf_id" ref="wkf_attachment"/> - <field name="name">change_proposed</field> - <field name="action">state_set_proposed()</field> + <record id="act_document_request" model="workflow.activity"> + <field name="wkf_id" ref="wkf_attachment"/> + <field name="name">change_request</field> + <field name="action">do_change_request()</field> <field name="kind">function</field> </record> - <record id="act_update" model="workflow.activity"> + <record id="act_document_propose" model="workflow.activity"> <field name="wkf_id" ref="wkf_attachment"/> - <field name="name">to_update</field> - <field name="action">state_set_update()</field> + <field name="name">change_propose</field> + <field name="action">do_change_propose()</field> <field name="kind">function</field> </record> - <record id="act_production" model="workflow.activity"> + <record id="act_document_confirm" model="workflow.activity"> <field name="wkf_id" ref="wkf_attachment"/> - <field name="name">in_production</field> - <field name="action">state_set_in_production()</field> + <field name="name">to_update</field> + <field name="action">do_to_update()</field> <field name="kind">function</field> - </record> - <record id="act_cancel" model="workflow.activity"> + </record> + <record id="act_document_cancel" model="workflow.activity"> <field name="wkf_id" ref="wkf_attachment"/> - <field name="name">cancel</field> - <field name="action">state_set_cancel()</field> - <field name="kind">function</field> - </record> + <field name="name">cancel</field> + <field name="action">do_cancel()</field> + <field name="kind">function</field> + </record> <!-- Transitions --> - <record id="request_to_propose" model="workflow.transition"> - <field name="act_from" ref="act_request"/> - <field name="act_to" ref="act_propose"/> - <field name="signal">button_change_proposed</field> + <record id="tran_document_production_to_request" model="workflow.transition"> + <field name="act_from" ref="act_document_production"/> + <field name="act_to" ref="act_document_request"/> + <field name="signal">button_request</field> + </record> + <record id="tran_document_request_to_propose" model="workflow.transition"> + <field name="act_from" ref="act_document_request"/> + <field name="act_to" ref="act_document_propose"/> + <field name="signal">button_propose</field> <field name="condition">(target_document_id != False)</field> </record> - <record id="request_to_cancel" model="workflow.transition"> - <field name="act_from" ref="act_request"/> - <field name="act_to" ref="act_cancel"/> + <record id="tran_document_request_to_cancel" model="workflow.transition"> + <field name="act_from" ref="act_document_request"/> + <field name="act_to" ref="act_document_cancel"/> <field name="signal">button_cancel</field> </record> - <record id="propose_to_update" model="workflow.transition"> - <field name="act_from" ref="act_propose"/> - <field name="act_to" ref="act_update"/> - <field name="signal">button_change_validated</field> + <record id="tran_document_propose_to_confirm" model="workflow.transition"> + <field name="act_from" ref="act_document_propose"/> + <field name="act_to" ref="act_document_confirm"/> + <field name="signal">button_confirm</field> </record> - <record id="propose_to_cancel" model="workflow.transition"> - <field name="act_from" ref="act_propose"/> - <field name="act_to" ref="act_cancel"/> + <record id="tran_document_propose_to_cancel" model="workflow.transition"> + <field name="act_from" ref="act_document_propose"/> + <field name="act_to" ref="act_document_cancel"/> <field name="signal">button_cancel</field> </record> - <record id="cancel_to_request" model="workflow.transition"> - <field name="act_from" ref="act_cancel"/> - <field name="act_to" ref="act_request"/> - <field name="signal">button_change_request</field> - </record> - <record id="update_to_production" model="workflow.transition"> - <field name="act_from" ref="act_update"/> - <field name="act_to" ref="act_production"/> - <field name="signal">button_update</field> - </record> - <record id="production_to_request" model="workflow.transition"> - <field name="act_from" ref="act_production"/> - <field name="act_to" ref="act_request"/> - <field name="signal">button_change_request</field> + <record id="tran_document_cancel_to_request" model="workflow.transition"> + <field name="act_from" ref="act_document_cancel"/> + <field name="act_to" ref="act_document_request"/> + <field name="signal">button_request</field> </record> + <record id="tran_document_confirm_to_production" model="workflow.transition"> + <field name="act_from" ref="act_document_confirm"/> + <field name="act_to" ref="act_document_production"/> + <field name="signal">button_validate</field> + </record> </data> -</openerp>
\ No newline at end of file +</openerp> diff --git a/addons/document_change/document_phase_workflow.xml b/addons/document_change/document_phase_workflow.xml index 73244ee741e..4ce39670837 100644 --- a/addons/document_change/document_phase_workflow.xml +++ b/addons/document_change/document_phase_workflow.xml @@ -8,45 +8,45 @@ </record> <!-- States --> - <record id="act_draft" model="workflow.activity"> + <record id="act_phase_draft" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process_phase"/> <field name="flow_start">True</field> <field name="name">draft</field> </record> - <record id="act_start" model="workflow.activity"> + <record id="act_phase_start" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process_phase"/> - <field name="name">started</field> - <field name="action">state_started_set()</field> + <field name="name">in_process</field> + <field name="action">do_start()</field> <field name="kind">function</field> </record> - <record id="act_validate" model="workflow.activity"> + <record id="act_phase_confirm" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process_phase"/> - <field name="name">validate</field> - <field name="action">state_validate_set()</field> + <field name="name">to_validate</field> + <field name="action">do_confirm()</field> <field name="kind">function</field> </record> - <record id="act_end" model="workflow.activity"> + <record id="act_phase_end" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process_phase"/> - <field name="name">end</field> - <field name="action">state_done_set()</field> + <field name="name">done</field> + <field name="action">do_done()</field> <field name="kind">function</field> </record> <!-- Transitions --> - <record id="draft_to_start" model="workflow.transition"> - <field name="act_from" ref="act_draft"/> - <field name="act_to" ref="act_start"/> + <record id="tran_phase_draft_to_start" model="workflow.transition"> + <field name="act_from" ref="act_phase_draft"/> + <field name="act_to" ref="act_phase_start"/> <field name="signal">button_start</field> </record> - <record id="start_to_validate" model="workflow.transition"> - <field name="act_from" ref="act_start"/> - <field name="act_to" ref="act_validate"/> - <field name="signal">button_validate</field> + <record id="tran_phase_start_to_confirm" model="workflow.transition"> + <field name="act_from" ref="act_phase_start"/> + <field name="act_to" ref="act_phase_confirm"/> + <field name="signal">button_confirm</field> </record> - <record id="validate_to_end" model="workflow.transition"> - <field name="act_from" ref="act_validate"/> - <field name="act_to" ref="act_end"/> + <record id="tran_phase_confirm_to_end" model="workflow.transition"> + <field name="act_from" ref="act_phase_confirm"/> + <field name="act_to" ref="act_phase_end"/> <field name="signal">button_end</field> </record> </data> -</openerp>
\ No newline at end of file +</openerp> diff --git a/addons/document_change/document_process_workflow.xml b/addons/document_change/document_process_workflow.xml index 7d2e781a2c6..c59d96cd6f8 100644 --- a/addons/document_change/document_process_workflow.xml +++ b/addons/document_change/document_process_workflow.xml @@ -2,67 +2,67 @@ <openerp> <data> <record id="wkf_change_process" model="workflow"> - <field name="name">document.change.process.phase.basic</field> - <field name="osv">document.change.process.phase</field> + <field name="name">document.change.process.basic</field> + <field name="osv">document.change.process</field> <field name="on_create">True</field> </record> <!-- States --> - <record id="act_draft" model="workflow.activity"> + <record id="act_process_draft" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process"/> <field name="flow_start">True</field> <field name="name">draft</field> </record> - <record id="act_in_progress" model="workflow.activity"> + <record id="act_process_in_progress" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process"/> <field name="name">in_progress</field> - <field name="action">state_started_set()</field> + <field name="action">do_start()</field> <field name="kind">function</field> </record> - <record id="act_pending" model="workflow.activity"> + <record id="act_process_pending" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process"/> <field name="name">pending</field> - <field name="action">state_pending_set()</field> + <field name="action">do_pending()</field> <field name="kind">function</field> </record> - <record id="act_validate" model="workflow.activity"> + <record id="act_process_confirm" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process"/> - <field name="name">validate</field> - <field name="action">state_validate_set()</field> + <field name="name">to_validate</field> + <field name="action">do_confirm()</field> <field name="kind">function</field> </record> - <record id="act_done" model="workflow.activity"> + <record id="act_process_done" model="workflow.activity"> <field name="wkf_id" ref="wkf_change_process"/> <field name="name">done</field> - <field name="action">state_done_set()</field> + <field name="action">do_done()</field> <field name="kind">function</field> </record> <!-- Transitions --> - <record id="draft_to_progress" model="workflow.transition"> - <field name="act_from" ref="act_draft"/> - <field name="act_to" ref="act_in_progress"/> + <record id="tran_process_draft_to_progress" model="workflow.transition"> + <field name="act_from" ref="act_process_draft"/> + <field name="act_to" ref="act_process_in_progress"/> <field name="signal">button_start</field> </record> - <record id="progress_to_pending" model="workflow.transition"> - <field name="act_from" ref="act_in_progress"/> - <field name="act_to" ref="act_pending"/> + <record id="tran_process_progress_to_pending" model="workflow.transition"> + <field name="act_from" ref="act_process_in_progress"/> + <field name="act_to" ref="act_process_pending"/> <field name="signal">button_pending</field> </record> - <record id="pending_to_progress" model="workflow.transition"> - <field name="act_from" ref="act_pending"/> - <field name="act_to" ref="act_in_progress"/> - <field name="signal">button_progress</field> + <record id="tran_process_pending_to_progress" model="workflow.transition"> + <field name="act_from" ref="act_process_pending"/> + <field name="act_to" ref="act_process_in_progress"/> + <field name="signal">button_start</field> </record> - <record id="progress_to_validate" model="workflow.transition"> - <field name="act_from" ref="act_in_progress"/> - <field name="act_to" ref="act_validate"/> - <field name="signal">button_validate</field> + <record id="tran_process_progress_to_confirm" model="workflow.transition"> + <field name="act_from" ref="act_process_in_progress"/> + <field name="act_to" ref="act_process_confirm"/> + <field name="signal">button_confirm</field> </record> - <record id="validate_to_end" model="workflow.transition"> - <field name="act_from" ref="act_validate"/> - <field name="act_to" ref="act_end"/> + <record id="tran_process_confirm_to_end" model="workflow.transition"> + <field name="act_from" ref="act_process_confirm"/> + <field name="act_to" ref="act_process_done"/> <field name="signal">button_done</field> </record> </data> -</openerp>
\ No newline at end of file +</openerp> |
