bzr revid: fp@tinyerp.com-20100126194440-qngp7q3ve058jowl
This commit is contained in:
Fabien Pinckaers 2010-01-26 20:44:40 +01:00
parent 54caf2f187
commit f09a07529d
6 changed files with 356 additions and 353 deletions

View File

@ -32,6 +32,7 @@ from tools.translate import _
class document_directory(osv.osv):
_name = 'document.directory'
_description = 'Document directory'
_order = 'name desc'
_columns = {
'name': fields.char('Name', size=64, required=True, select=1),
'write_date': fields.datetime('Date Modified', readonly=True),
@ -98,6 +99,15 @@ class document_directory(osv.osv):
('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !'),
('no_selfparent', 'check(parent_id <> id)', 'Directory cannot be parent of itself!')
]
def name_get(self, cr, uid, ids, context={}):
res = {}
for d in self.browse(cr, uid, ids, context=context):
s = d.name
while d:
s = d.name + (s and ('/' + s) or '')
d = d.parent_id
res[d] = s
return res
def ol_get_resource_path(self,cr,uid,dir_id,res_model,res_id):
# this method will be used in process module

View File

@ -24,22 +24,24 @@
'name': 'Integrated Document Management System',
'version': '1.99',
'category': 'Generic Modules/Others',
'description': """The document_change module allows to track and manage process changes to
update documents in directories, and keep track of these updates. You
can define control points, phase of changes.
'description': """
The document_change module allows to track and manage process changes to
update documents in directories, and keep track of these updates. You
can define control points, phase of changes. This module has been
developed for Caterpilar Belgium.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base', 'document_ftp','mail_gateway'],
'init_xml': ['document_change_data.xml'],
'update_xml': [
'security/document_process_security.xml',
'document_change_view.xml',
'document_change_sequence.xml',
'document_change_workflow.xml',
'document_phase_workflow.xml',
'document_process_workflow.xml',
'update_xml': [
'security/document_process_security.xml',
'document_change_view.xml',
'document_change_sequence.xml',
'document_change_workflow.xml',
'document_phase_workflow.xml',
'document_process_workflow.xml',
'cat_demo.xml'
],
'demo_xml': [ ],
'installable': True,

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.menu" id="base.menu_base_partner">
<field name="groups_id" eval="[(6,0,[ref('base.group_no_one')])]"/>
</record>
</data>
</openerp>

View File

@ -26,6 +26,7 @@ import netsvc
from tools.translate import _
import time
import datetime
class doucment_change_process_phase_type(osv.osv):
_name = "document.change.process.phase.type"
doucment_change_process_phase_type()
@ -33,11 +34,10 @@ doucment_change_process_phase_type()
class document_change_type(osv.osv):
_name = "document.change.type"
_description = "Document Change Type"
_columns = {
'name': fields.char("Document Change Type", size=64,required=True),
'phase_type_ids': fields.many2many('document.change.process.phase.type','document_type_phase_type_rel','document_type_id','phase_type_id','Phase Type'),
'directory_id' :fields.many2one('document.directory','Pending Directory'),
'directory_id' :fields.many2one('document.directory','Pending Directory'),
'template_document_id':fields.many2one('ir.attachment','Document')
}
document_change_type()
@ -45,38 +45,36 @@ document_change_type()
class doucment_change_process_phase_type(osv.osv):
_name = "document.change.process.phase.type"
_description = "Document Change Process Phase Type"
_columns = {
'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_type_phase_type_rel','phase_type_id','document_type_id','Document Type'),
}
_defaults = {
'active': lambda *a:1,
_defaults = {
'active': lambda *a:1,
}
doucment_change_process_phase_type()
class doucment_change_process(osv.osv):
class doucment_change_process(osv.osv):
_name = "document.change.process"
doucment_change_process()
class doucment_change_process_phase(osv.osv):
_name = "document.change.process.phase"
_description = "Document Change Process Phase"
_columns = {
'name': fields.char("Name", size=64, required=True),
'process_id':fields.many2one('document.change.process','Process Change'),
'sequence': fields.integer('Sequence'),
'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Process')], 'Update Document', required=True),
'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),
'date_control': fields.date('Control Date', select=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.one2many('ir.attachment','process_phase_id','Documents'),
}
_defaults = {
_defaults = {
'state': lambda *a: 'draft',
'update_document': lambda *a:'at_endPhase',
'type':lambda *a: 'no_control',
@ -91,11 +89,11 @@ class doucment_change_process_phase(osv.osv):
def do_start(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'in_process'})
return True
return True
def do_done(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'done'})
return True
return True
def test_control_request(self, cr, uid, ids, context=None):
return all(bool(process.type) =='control_required' for process in self.browse(cr, uid, ids, context=context))
@ -107,7 +105,7 @@ doucment_change_process_phase()
class document_change_process_model(osv.osv):
_name = "document.change.process.model"
_description = "Document Change Process model"
_columns = {
'name': fields.char("Changed Process Model", size=64,required=True),
'sequence': fields.integer('Sequence'),
@ -117,8 +115,8 @@ document_change_process_model()
class document_change_process_type(osv.osv):
_name = "document.change.process.type"
_description = "Document Change Process Type"
_description = "Document Change Process Type"
_columns = {
'name': fields.char("Changed Process Type", size=64),
}
@ -126,20 +124,20 @@ document_change_process_type()
class document_change_process_email(osv.osv):
_name = "document.change.process.mail"
_description = "Document Change Process Email Notification"
_description = "Document Change Process Email Notification"
_columns = {
'name': fields.char("Email", size=64),
'type':fields.selection([('start_end', 'Start/End Process '),('change_all', 'Change in All Document')], 'Notification Type'),
'process_id':fields.many2one('document.change.process','Process Change'),
'process_id':fields.many2one('document.change.process','Process Change'),
}
document_change_process_email()
class doucment_change_process(osv.osv):
_name = "document.change.process"
_description = "Document Change Process"
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}):
res = {}
#TODOto calculate latest modified date from all related documents
@ -148,16 +146,16 @@ class doucment_change_process(osv.osv):
if not ids:
return {}
res = {}
attach = self.pool.get('ir.attachment')
directory_obj = self.pool.get('document.directory')
attach = self.pool.get('ir.attachment')
directory_obj = self.pool.get('document.directory')
for process_change in self.browse(cr, uid, ids):
res1 = []
res1 = []
for phase_id in process_change.process_phase_ids:
res1 += map(lambda x:x.id, phase_id.phase_document_ids or [])
res[process_change.id] = res1
res1 += map(lambda x:x.id, phase_id.phase_document_ids or [])
res[process_change.id] = res1
return res
def _get_progress(self, cr, uid, ids, field_name, arg, context={}):
result = {}
progress = 0.0
@ -170,7 +168,7 @@ class doucment_change_process(osv.osv):
progress = (float(len(update_docs))/float(len(proc_change.process_document_ids)))*100
result[proc_change.id] = progress
return result
def _get_current_phase(self, cr, uid, ids, field_name, arg, context={}):
result = {}
for proc in self.browse(cr, uid, ids):
@ -178,8 +176,8 @@ class doucment_change_process(osv.osv):
for phase in proc.process_phase_ids:
if phase.state in ('in_process','to_validate'):
result[proc.id] = phase.id
return result
return result
_columns = {
'name': fields.char("Process Change", size=64, required=True, select=True),
'process_type_id' :fields.many2one('document.change.process.type','Type Change'),
@ -190,43 +188,43 @@ class doucment_change_process(osv.osv):
'user_id':fields.many2one('res.users','Change Owner'),
'create_date':fields.datetime('Creation',readonly=True),
'latest_modified_date':fields.function(_latestmodification, method=True, type='datetime', string="Lastest Modification"), #TODO no year!
'date_expected':fields.datetime('Expected Production'),
'date_expected':fields.datetime('Expected Production'),
'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'),
'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'),
'current_phase_id': fields.function(_get_current_phase, method=True, type='many2one', relation='document.change.process.phase', string='Current Phase'),
'date_control': fields.related('current_phase_id','date_control', type='date', string='Control Date'),
'date_control': fields.related('current_phase_id','date_control', type='date', string='Control Date'),
'progress': fields.function(_get_progress, method=True, type='float', string='Progress'),
'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'),
}
_defaults = {
_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)
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
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
return True
def do_done(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done'},context=context)
return True
return True
def do_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'},context=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')
directory_obj = self.pool.get('document.directory')
directory_obj = self.pool.get('document.directory')
document_obj = self.pool.get('ir.attachment')
new_doc_ids = []
new_doc_ids = []
for process in self.browse(cr, uid, ids):
if process.process_model_id:
directory_ids = directory_obj.search(cr, uid, [('parent_id','child_of',process.structure_id and process.structure_id.id)])
@ -235,27 +233,27 @@ class doucment_change_process(osv.osv):
document_ids = document_obj.search(cr, uid, [
('parent_id','in',directory_ids),
('change_type_id','=',document_type_id.id)])
new_doc_ids = []
for document_id in document_ids:
vals = {}
new_doc_ids = []
for document_id in document_ids:
vals = {}
if process.pending_directory_id:
vals.update({'parent_id':process.pending_directory_id.id})
new_doc_ids.append(document_obj.copy(cr, uid, document_id, vals))
new_doc_ids.append(document_obj.copy(cr, uid, document_id, vals))
phase_value = {
'name' : '%s-%s' %(phase_type_id.name, process.name),
'phase_type_id': phase_type_id.id,
'process_id': process.id,
'phase_document_ids': [(6,0,new_doc_ids)]
}
phase_obj.create(cr, uid, phase_value)
'phase_document_ids': [(6,0,new_doc_ids)]
}
phase_obj.create(cr, uid, phase_value)
return True
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'),
@ -265,10 +263,10 @@ class document_file(osv.osv):
'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 = {
_defaults = {
'state': lambda *a: 'in_production',
}
}
def _check_duplication(self, cr, uid, vals, ids=[], op='create'):
name=vals.get('name',False)
parent_id=vals.get('parent_id',False)
@ -293,15 +291,15 @@ class document_file(osv.osv):
if len(res):
return False
return True
def do_change_request(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'change_request'},context=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
self.write(cr, uid, ids, {'state':'change_propose'},context=context)
return True
def do_to_update(self, cr, uid, ids, context={}):
for attach in self.browse(cr, uid, ids, context=context):
if attach.change_type_id.directory_id.id:
@ -314,21 +312,21 @@ class document_file(osv.osv):
file_name=data['datas_fname'].split('.')
new_name=str(file_name[0]+'.old'+time.strftime("%y%m%d")+'.'+file_name[1])
res['name']=attach.name
res['datas']=data['datas']
res['datas']=data['datas']
res['datas_fname']=new_name
res['parent_id']=attach.change_type_id.directory_id.id
old_id = self.create(cr, uid, res)
self.write(cr, uid, ids, {'state':'to_update'},context=context)
return True
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
return True
def do_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
def test_change_request(self, cr, uid, ids, context=None):
return all(bool(attch.target_document_id) != False for attch in self.browse(cr, uid, ids, context=context))
document_file()

View File

@ -1,18 +1,19 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!-- Structure Data -->
<record model="document.directory" id="dir_root">
<!-- Structure Data -->
<record model="document.directory" id="dir_root">
<field name="name">Gosselies</field>
<field name="parent_id" eval="False"/>
</record>
<record model="document.directory" id="dir_bat_e">
<field name="name">Bat E</field>
<field name="parent_id" ref="dir_root"/>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="document.directory" id="dir_bat_z">
<field name="name">Bat Z</field>
<field name="parent_id" ref="dir_root"/>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="document.directory" id="dir_mq_section">
@ -68,8 +69,8 @@
<field name="parent_id" ref="dir_bat_z"/>
</record>
<!-- Document Templates -->
<record model="ir.attachment" id="doc_FIE_template">
<!-- Document Templates -->
<record model="ir.attachment" id="doc_FIE_template">
<field name="name">FIE_template</field>
<field name="datas_fname">FIE_template.xls</field>
<field name="parent_id" ref="dir_root"/>
@ -89,16 +90,16 @@
<field name="datas_fname">TaktTime_template.xls</field>
<field name="parent_id" ref="dir_takt_time"/>
</record>
<!-- Document Change Types -->
<record model="document.change.type" id="type_project_charter">
<!-- Document Change Types -->
<record model="document.change.type" id="type_project_charter">
<field name="name">Project Charter</field>
<field name="template_document_id" ref="doc_ProjectCharter_Template"/>
</record>
<record model="document.change.type" id="type_vsm">
<field name="name">VSM</field>
</record>
<record model="document.change.type" id="type_takt_time">
<record model="document.change.type" id="type_takt_time">
<field name="name">Takt Time</field>
<field name="template_document_id" ref="doc_TaktTime_template"/>
</record>
@ -111,8 +112,8 @@
<field name="template_document_id" ref="doc_SFMEA_template"/>
</record>
<!-- Documents -->
<record model="ir.attachment" id="doc_FIE_05466_001">
<!-- Documents -->
<record model="ir.attachment" id="doc_FIE_05466_001">
<field name="name">FIE_05466_001</field>
<field name="datas_fname">FIE_05466_001.xls</field>
<field name="parent_id" ref="dir_family1"/>
@ -137,8 +138,8 @@
<field name="change_type_id" ref="type_takt_time"/>
</record>
<!-- Phase Types -->
<record model="document.change.process.phase.type" id="phase_type_concept">
<!-- Phase Types -->
<record model="document.change.process.phase.type" id="phase_type_concept">
<field name="name">Concept</field>
<field name="sequence">1</field>
<field eval="[(6, 0, [ref('type_project_charter'),ref('type_vsm'),ref('type_takt_time')])]" name="document_type_ids"/>
@ -154,8 +155,8 @@
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
</record>
<!-- Change of Models Data -->
<record model="document.change.process.model" id="model_NPI">
<!-- Change of Models Data -->
<record model="document.change.process.model" id="model_NPI">
<field name="name">NPI</field>
<field eval="[(6, 0, [ref('phase_type_concept'),ref('phase_type_development'),ref('phase_type_validation')])]" name="phase_type_ids"/>
</record>
@ -164,18 +165,18 @@
<field eval="[(6, 0, [ref('phase_type_development')])]" name="phase_type_ids"/>
</record>
<!-- Process Types -->
<!-- Process Types -->
<record model="document.change.process.type" id="process_quality_alert">
<field name="name">Quality Alert</field>
<field name="name">Quality Alert</field>
</record>
<record model="document.change.process.type" id="process_new_product">
<field name="name">New Product</field>
<field name="name">New Product</field>
</record>
<record model="document.change.process.type" id="process_red_risk">
<field name="name">Red Risk</field>
<field name="name">Red Risk</field>
</record>
<record model="document.change.process.type" id="process_ci_card">
<field name="name">CI Card</field>
<field name="name">CI Card</field>
</record>
</data>
</openerp>

View File

@ -2,40 +2,37 @@
<openerp>
<data>
<menuitem name="Process Changes" icon="terp-stock" id="menu_process_changes"/>
<menuitem name="Process Changes" id="menu_document_process_changes" parent="menu_process_changes"/>
<menuitem name="Change Control" id="menu_change_control" parent="menu_process_changes"/>
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes"/>
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes"/>
<!--
Structure
-->
<menuitem name="Process Changes" icon="terp-stock" id="menu_process_changes"/>
<menuitem name="Process Changes" id="menu_document_process_changes" parent="menu_process_changes"/>
<menuitem name="Change Control" id="menu_change_control" parent="menu_process_changes"/>
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes"/>
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes"/>
<record model="ir.ui.view" id="view_document_structure_form">
<field name="name">document.directory</field>
<field name="model">document.directory</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Structure">
<field name="name"/>
<field name="parent_id"/>
</form>
<form string="Structure">
<field name="name"/>
<field name="parent_id"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_structure_tree">
<field name="name">document.directory</field>
<field name="model">document.directory</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Structure">
<field name="name"/>
<field name="parent_id"/>
</tree>
<tree string="Structure">
<field name="name"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_document_structure_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.directory</field>
@ -57,27 +54,27 @@
</record>
<menuitem name="Structure" id="menu_document_structure_config" parent="menu_configuration"/>
<menuitem action="action_document_structure_form" id="menu_structure_form" parent="menu_document_structure_config"/>
<act_window domain="[('structure_id', '=', active_id)]"
id="act_structure_process_changes"
name="Process Changes"
res_model="document.change.process"
src_model="document.directory"/>
<!--
Document Types
-->
<record model="ir.ui.view" id="view_document_type_form">
<act_window domain="[('structure_id', '=', active_id)]"
id="act_structure_process_changes"
name="Process Changes"
res_model="document.change.process"
src_model="document.directory"/>
<!--
Document Types
-->
<record model="ir.ui.view" id="view_document_type_form">
<field name="name">document.change.type.form</field>
<field name="model">document.change.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Document Types">
<field name="name" select="1"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
<separator string="Associated Phase Types" colspan="4"/>
<field name="phase_type_ids" colspan="4" nolabel="1"/>
<field name="phase_type_ids" colspan="4" nolabel="1"/>
</form>
</field>
</record>
@ -88,9 +85,9 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Document Types">
<field name="name"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
<field name="name"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
</tree>
</field>
</record>
@ -104,9 +101,9 @@
</record>
<menuitem name="Documents" id="menu_document_type_config" parent="menu_configuration"/>
<menuitem action="action_document_type_form" id="menu_document_type_form" parent="menu_document_type_config"/>
<!--
Phase Types
<!--
Phase Types
-->
<record model="ir.ui.view" id="view_process_phase_type_form">
<field name="name">document.change.process.phase.type.form</field>
@ -114,11 +111,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phase Types">
<group colspan="4" col="6">
<field name="name" select="1" string="Phase Type"/>
<field name="sequence"/>
<field name="active"/>
</group>
<group colspan="4" col="6">
<field name="name" select="1" string="Phase Type"/>
<field name="sequence"/>
<field name="active"/>
</group>
<separator string="Associated Document Types" colspan="4"/>
<field name="document_type_ids" colspan="4" nolabel="1"/>
</form>
@ -131,7 +128,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phase Types">
<field name="sequence"/>
<field name="sequence" invisible="1"/>
<field name="name" string="Phase Type"/>
<field name="document_type_ids"/>
</tree>
@ -145,10 +142,10 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Process Changes" id="menu_process_changes_config" parent="menu_configuration"/>
<menuitem action="action_process_phase_type_form" id="menu_phase_type_form" parent="menu_process_changes_config"/>
<!-- Document Change Process Type -->
<record model="ir.ui.view" id="view_change_process_type_form">
<field name="name">document.change.process.type.form</field>
@ -156,7 +153,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phase Types">
<field name="name" select="1" string="Phase Type"/>
<field name="name" select="1" string="Phase Type"/>
</form>
</field>
</record>
@ -179,11 +176,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_change_process_type_form" id="menu_change_process_type_form" parent="menu_process_changes_config"/>
<!--
Model of Changes
<!--
Model of Changes
-->
<record model="ir.ui.view" id="view_model_change_form">
<field name="name">document.change.process.model.form</field>
@ -193,7 +190,7 @@
<form string="Model of Changes">
<field name="name" select="1"/>
<field name="sequence"/>
<separator string="Phase Type" colspan="4"/>
<separator string="Phase Type" colspan="4"/>
<field name="phase_type_ids" colspan="4" nolabel="1"/>
</form>
</field>
@ -204,9 +201,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="sequence"/>
<field name="name"/>
<tree string="Model of Changes">
<field name="sequence" invisible="1"/>
<field name="name"/>
</tree>
</field>
</record>
@ -219,10 +216,10 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_model_change_form" id="menu_model_change_form" parent="menu_process_changes_config"/>
<!--
Documents
-->
<!--
Documents
-->
<record model="ir.ui.view" id="view_document_form">
<field name="name">ir.attachment.form</field>
<field name="model">ir.attachment</field>
@ -240,16 +237,16 @@
</group>
<separator string="Change Control" colspan="4"/>
<group col="7" colspan="4">
<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"/>
<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"/>
<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_document_id"/>
<field name="target"/>
<newline/>
<separator string="Change Note" colspan="4"/>
<field colspan="4" name="description" nolabel="1"/>
@ -263,21 +260,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 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>
</form>
</field>
</record>
@ -298,15 +295,15 @@
</field>
</record>
<record model="ir.ui.view" id="view_document_graph">
<field name="name">ir.attachment.graph</field>
<field name="model">ir.attachment</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Documents by type" type="bar" orientation="vertical">
<field name="change_type_id"/>
<field name="name" operator="+"/>
</graph>
</field>
<field name="name">ir.attachment.graph</field>
<field name="model">ir.attachment</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Documents by type" type="bar" orientation="vertical">
<field name="change_type_id"/>
<field name="name" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_document_search">
<field name="name">ir.attachment.search</field>
@ -315,18 +312,18 @@
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<search string="Documents">
<group col="7" colspan="4">
<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>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'create_uid'}" help="Documents by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'parent_id'}" help="Documents by directory"/>
<filter domain="[]" string="By Type of Documents" icon="terp-hr" context="{'group_by':'change_type_id'}" help="Documents by type"/>
</group>
<group col="7" colspan="4">
<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>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'create_uid'}" help="Documents by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'parent_id'}" help="Documents by directory"/>
<filter domain="[]" string="By Type of Documents" icon="terp-hr" context="{'group_by':'change_type_id'}" help="Documents by type"/>
</group>
</search>
</field>
</record>
@ -339,7 +336,7 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_document_search"/>
</record>
<record id="action_document_tree_view" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
@ -359,7 +356,7 @@
<field name="act_window_id" ref="action_document_form"/>
</record>
<menuitem action="action_document_form" id="menu_documents_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_document_without_type_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
@ -370,7 +367,7 @@
<field name="domain">[('change_type_id','=',False)]</field>
</record>
<menuitem action="action_document_without_type_form" id="menu_documents_without_type_form" parent="menu_change_control"/>
<record model="ir.actions.act_window" id="action_document_to_update_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
@ -378,38 +375,38 @@
<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','=','to_update')]</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"/>
<!--
Phases
-->
<record model="ir.ui.view" id="view_process_phase_form">
<!--
Phases
-->
<record model="ir.ui.view" id="view_process_phase_form">
<field name="name">document.change.process.phase.form</field>
<field name="model">document.change.process.phase</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phases">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="process_id" string="Process Change"/>
<field name="sequence"/>
<newline/>
<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_type_id" string="Phase Type"/>
</group>
<separator colspan="4" string="Documents"/>
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="process_id" string="Process Change"/>
<field name="sequence"/>
<newline/>
<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_type_id" string="Phase Type"/>
</group>
<separator colspan="4" string="Documents"/>
<field name="phase_document_ids" colspan="4" nolabel="1"/>
<newline/>
<group col="5" colspan="4">
<field name="state"/>
<button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/>
<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>
<field name="state"/>
<button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/>
<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>
</record>
@ -420,7 +417,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phases">
<field name="sequence"/>
<field name="sequence" invisible="1"/>
<field name="name"/>
</tree>
</field>
@ -433,104 +430,89 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_process_phase_form" id="menu_phases_form" parent="menu_document_process_changes"/>
<menuitem action="action_process_phase_form" id="menu_phases_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_process_phase_form_validate">
<record model="ir.actions.act_window" id="action_process_phase_form_validate">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.phase</field>
<field name="name">Phases to Validate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','to_validate')]</field>
</record>
<menuitem action="action_process_phase_form_validate" id="menu_phases_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('process_phase_id', '=', active_id)]"
id="act_documents_phases"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process.phase"/>
<!--
Process Change
-->
<record model="ir.ui.view" id="view_process_form">
</record>
<menuitem action="action_process_phase_form_validate" id="menu_phases_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('process_phase_id', '=', active_id)]"
id="act_documents_phases"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process.phase"/>
<!--
Process Change
-->
<record model="ir.ui.view" id="view_process_form">
<field name="name">document.change.process.form</field>
<field name="model">document.change.process</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process Change">
<form string="Process Change">
<group colspan="4" col="6">
<field name="name"/>
<field name="structure_id"/>
<field name="pending_directory_id"/>
</group>
<group colspan="4" col="5">
<field name="process_type_id" widget="selection"/>
<field name="process_model_id" widget="selection"/>
<button name="generate_phases" string="Generate Phases" type="object" icon="gtk-convert" />
<field name="name"/>
<field name="structure_id"/>
<field name="pending_directory_id"/>
</group>
<group colspan="4">
<group colspan="4" col="5">
<field name="process_type_id" widget="selection"/>
<field name="process_model_id" widget="selection"/>
<button name="generate_phases" string="Generate Phases" type="object" icon="gtk-convert" />
</group>
<group colspan="4">
<field name="description" colspan="4"/>
</group>
<notebook colspan="4">
<page string="Process Definition">
<group col="2" colspan="2">
<separator string="Responsibles" colspan="2"/>
<field name="user_id"/>
</group>
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="latest_modified_date"/>
<field name="date_expected"/>
</group>
<newline />
<separator colspan="4" string="Change Description"/>
<field name="change_description" colspan="4" nolabel="1"/>
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<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">
<field name="process_phase_ids" mode="tree,form" widget="one2many_list" nolabel="1">
<tree string="Process Phases" editable="True">
<field name="sequence"/>
<field name="name"/>
<field name="type"/>
<field name="phase_document_ids"/>
<field name="state"/>
</tree>
<form string="Process Phases">
<field name="name"/>
<field name="sequence"/>
<field name="type"/>
<field name="phase_document_ids" colspan="4"/>
<field name="state"/>
</form>
</field>
</page>
<page string="Documents">
<field name="process_document_ids" mode="tree,form" widget="one2many_list" nolabel="1">
<tree string="Documents">
<field name="process_phase_id"/>
<field name="name" string="Document"/>
<field name="state"/>
</tree>
<form string="Documents">
<field name="process_phase_id"/>
<field name="name" string="Document"/>
<field name="state"/>
</form>
</field>
</page>
<page string="Process Definition">
<group col="2" colspan="2">
<separator string="Responsibles" colspan="2"/>
<field name="user_id"/>
</group>
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="latest_modified_date"/>
<field name="date_expected"/>
</group>
<newline />
<separator colspan="4" string="Change Description"/>
<field name="change_description" colspan="4" nolabel="1"/>
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<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">
<field name="process_phase_ids" mode="tree,form" widget="one2many_list" nolabel="1">
<tree string="Process Phases" editable="True">
<field name="sequence" invisible="1"/>
<field name="name"/>
<field name="type"/>
<field name="phase_document_ids"/>
<field name="state"/>
</tree>
<form string="Process Phases">
<field name="name"/>
<field name="sequence"/>
<field name="type"/>
<field name="phase_document_ids" colspan="4"/>
<field name="state"/>
</form>
</field>
</page>
</notebook>
</form>
</field>
@ -549,46 +531,46 @@
<field name="current_phase_id" string="Current Phase"/>
<field name="date_control" string="Date Control Point"/>
<field name="process_model_id"/>
<field name="progress" string="Progress"/>
<field name="progress" string="Progress"/>
<field name="process_document_ids" string="# Documents"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_process_graph">
<field name="name">document.change.process.graph</field>
<field name="model">document.change.process</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Process changes by month" type="bar" orientation="vertical">
<field name="create_date"/>
<field name="process_document_ids" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_process_serach">
<field name="name">document.change.process.graph</field>
<field name="model">document.change.process</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Process changes by month" type="bar" orientation="vertical">
<field name="create_date"/>
<field name="process_document_ids" operator="+"/>
</graph>
</field>
</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>
<field name="type">search</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<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','=','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"/>
<field name="structure_id" select="1"/>
<field name="user_id" string="Owner" select="1"/>
</group>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" help="Process Changes by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'structure_id'}" help="Process Changes by directory"/>
</group>
<group col="8" colspan="4">
<filter domain="[('user_id','=',uid)]" string="My Process Changes" icon="gtk-execute" help="My Process Changes"/>
<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"/>
<field name="structure_id" select="1"/>
<field name="user_id" string="Owner" select="1"/>
</group>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" help="Process Changes by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'structure_id'}" help="Process Changes by directory"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process</field>
@ -598,7 +580,7 @@
<field name="search_view_id" ref="view_process_serach"/>
</record>
<menuitem action="action_process_form" id="menu_process_changes_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_process_change_form_validate">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process</field>
@ -606,20 +588,20 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','to_validate')]</field>
</record>
<menuitem action="action_process_change_form_validate" id="menu_process_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('process_id', '=', active_id)]"
id="act_phase_change_process"
name="Phases"
res_model="document.change.process.phase"
src_model="document.change.process"/>
<act_window domain="[('change_process_id', '=', active_id)]"
id="act_documents_change_process"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process"/>
</record>
<menuitem action="action_process_change_form_validate" id="menu_process_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('process_id', '=', active_id)]"
id="act_phase_change_process"
name="Phases"
res_model="document.change.process.phase"
src_model="document.change.process"/>
<act_window domain="[('change_process_id', '=', active_id)]"
id="act_documents_change_process"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process"/>
</data>
</openerp>