moved document_change to addons-extra
bzr revid: fp@tinyerp.com-20100129010445-rxgxlg3dagoxvg30
This commit is contained in:
parent
02770c5409
commit
ff72442754
|
@ -1,25 +0,0 @@
|
|||
# -*- 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 document_change
|
||||
import document_change_report
|
||||
import document_change_mailgate
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'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. This module has been
|
||||
developed for Caterpillar Belgium.
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base', 'document_ftp','mail_gateway','board'],
|
||||
'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_change_report_view.xml',
|
||||
'document_phase_workflow.xml',
|
||||
'document_process_workflow.xml',
|
||||
'cat_demo.xml'
|
||||
],
|
||||
'demo_xml': [ ],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': None,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,10 +0,0 @@
|
|||
<?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>
|
|
@ -1,390 +0,0 @@
|
|||
#-*- 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 tools
|
||||
from osv import fields, osv
|
||||
import os
|
||||
import pooler
|
||||
import netsvc
|
||||
from tools.translate import _
|
||||
import time
|
||||
import datetime
|
||||
import base64
|
||||
|
||||
class document_directory(osv.osv):
|
||||
_inherit = 'document.directory'
|
||||
def _level_compute(self, cr, uid, ids, field_name, arg, context):
|
||||
result = {}
|
||||
for d in self.browse(cr, uid, ids, context=context):
|
||||
result[d.id] = 0
|
||||
d2 = d
|
||||
while d2:
|
||||
d2 = d2.parent_id
|
||||
result[d.id] += 1
|
||||
return result
|
||||
_columns = {
|
||||
'level': fields.function(_level_compute, method=True,
|
||||
string='level', type='integer', store=True),
|
||||
}
|
||||
document_directory()
|
||||
|
||||
class document_change_process_phase_type(osv.osv):
|
||||
_name = "document.change.process.phase.type"
|
||||
document_change_process_phase_type()
|
||||
|
||||
class document_change_type(osv.osv):
|
||||
_name = "document.change.type"
|
||||
_description = "Document Type"
|
||||
_columns = {
|
||||
'name': fields.char("Document 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','Historic Directory'),
|
||||
'filename' :fields.char('Filename', size=128),
|
||||
'template_document_id':fields.many2one('ir.attachment','Template Document')
|
||||
}
|
||||
document_change_type()
|
||||
|
||||
class document_change_process_phase_type(osv.osv):
|
||||
_name = "document.change.process.phase.type"
|
||||
_description = "Process Phase Type"
|
||||
_columns = {
|
||||
'name': fields.char("Process Type", required=True, 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,
|
||||
}
|
||||
document_change_process_phase_type()
|
||||
|
||||
class document_change_process(osv.osv):
|
||||
_name = "document.change.process"
|
||||
document_change_process()
|
||||
|
||||
class document_change_process_phase(osv.osv):
|
||||
_name = "document.change.process.phase"
|
||||
_description = "Process Phase"
|
||||
_columns = {
|
||||
'name': fields.char("Phase 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),
|
||||
'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type'),
|
||||
'date_control': fields.date('Control Date', select=True),
|
||||
'phase_type_id':fields.many2one('document.change.process.phase.type','Phase Type'),
|
||||
'directory_id': fields.related('process_id', 'structure_id', relation='document.directory', type="many2one", string='Directory'),
|
||||
'state': fields.selection([('draft', 'Draft'),('in_process', 'Started'),('to_validate', 'To Validate'),('done', 'Done')], 'State',readonly=True),
|
||||
'phase_document_ids':fields.many2many('ir.attachment','document_change_phase_document', 'phase_id','document_id', 'Documents'),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'update_document': lambda *a:'at_endPhase',
|
||||
'type':lambda *a: 'control_required',
|
||||
}
|
||||
def do_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
def do_confirm(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'to_validate'})
|
||||
return True
|
||||
|
||||
def do_start(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'in_process'})
|
||||
todo = []
|
||||
for phase in self.browse(cr, uid, ids):
|
||||
for doc in phase.phase_document_ids:
|
||||
if doc.state in ('draft','in_production'):
|
||||
todo.append(doc.id)
|
||||
self.pool.get('ir.attachment').button_request(cr, uid, todo)
|
||||
return True
|
||||
|
||||
def do_done(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'done'})
|
||||
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))
|
||||
|
||||
def test_nocontrol_request(self, cr, uid, ids, context=None):
|
||||
return all(bool(process.type) =='no_control' for process in self.browse(cr, uid, ids, context=context))
|
||||
|
||||
document_change_process_phase()
|
||||
|
||||
class document_change_process_model(osv.osv):
|
||||
_name = "document.change.process.model"
|
||||
_description = "Process model"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Model of Process", size=64,required=True),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'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_change_process_type(osv.osv):
|
||||
_name = "document.change.process.type"
|
||||
_description = "Process Type"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Changed Process Type", size=64),
|
||||
}
|
||||
document_change_process_type()
|
||||
|
||||
class document_change_process_email(osv.osv):
|
||||
_name = "document.change.process.mail"
|
||||
_description = "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'),
|
||||
}
|
||||
document_change_process_email()
|
||||
|
||||
class document_change_process(osv.osv):
|
||||
_name = "document.change.process"
|
||||
_description = "Process"
|
||||
|
||||
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}):
|
||||
res = {}
|
||||
#TODOto calculate latest modified date from all related documents
|
||||
return res
|
||||
|
||||
def _get_document(self, cr, uid, ids, context={}, *arg):
|
||||
if not ids:
|
||||
return {}
|
||||
res = {}
|
||||
attach = self.pool.get('ir.attachment')
|
||||
directory_obj = self.pool.get('document.directory')
|
||||
for process_change in self.browse(cr, uid, ids):
|
||||
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
|
||||
return res
|
||||
|
||||
def _get_progress(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
progress = 0.0
|
||||
for proc_change in self.browse(cr, uid, ids):
|
||||
update_docs = []
|
||||
result[proc_change.id] = 0.0
|
||||
for doc in proc_change.process_document_ids:
|
||||
if doc.state in ('to_update', 'change_propose'):
|
||||
update_docs.append(doc)
|
||||
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):
|
||||
result[proc.id] = False
|
||||
for phase in proc.process_phase_ids:
|
||||
if phase.state in ('in_process','to_validate'):
|
||||
result[proc.id] = phase.id
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Process ID", size=64, required=True, select=True),
|
||||
'process_type_id' :fields.many2one('document.change.process.type','Type of Change'),
|
||||
'description': fields.char("Title", size=64, required=True),
|
||||
'change_description':fields.text('Changed Description'),
|
||||
'structure_id' :fields.many2one('document.directory','Directory', required=True),
|
||||
'process_model_id':fields.many2one('document.change.process.model','Process Model'),
|
||||
'user_id':fields.many2one('res.users','Owner',required=True),
|
||||
'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'),
|
||||
'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'),
|
||||
'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'),
|
||||
'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'),
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'document.change.process'),
|
||||
'state': lambda *a: 'draft',
|
||||
'user_id': lambda laurence,henrion,est,cool: est
|
||||
}
|
||||
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')
|
||||
directory_obj = self.pool.get('document.directory')
|
||||
document_obj = self.pool.get('ir.attachment')
|
||||
new_doc_ids = []
|
||||
for process in self.browse(cr, uid, ids):
|
||||
if not process.process_model_id:
|
||||
raise osv.except_osv(_('Error !'), _('You must select a process model !'))
|
||||
directory_ids = directory_obj.search(cr, uid, [('parent_id','child_of',process.structure_id and process.structure_id.id)])
|
||||
for phase_type_id in process.process_model_id.phase_type_ids:
|
||||
new_doc_ids = []
|
||||
for document_type_id in phase_type_id.document_type_ids:
|
||||
document_ids = document_obj.search(cr, uid, [
|
||||
('parent_id','in',directory_ids),
|
||||
('change_type_id','=',document_type_id.id)
|
||||
])
|
||||
for document_id in document_ids:
|
||||
vals = {}
|
||||
new_doc_ids.append(document_obj.copy(cr, uid, document_id, vals))
|
||||
if not document_ids:
|
||||
if document_type_id.template_document_id:
|
||||
new_doc_ids.append(document_obj.copy(cr, uid, document_type_id.template_document_id.id, {
|
||||
'name': document_type_id.template_document_id.name,
|
||||
'datas_fname': document_type_id.template_document_id.datas_fname,
|
||||
'parent_id': process.structure_id.id,
|
||||
'change_type_id': document_type_id.id
|
||||
}))
|
||||
else:
|
||||
new_doc_ids.append(document_obj.create(cr, uid, {
|
||||
'name': document_type_id.filename,
|
||||
'datas_fname': document_type_id.filename,
|
||||
'parent_id': process.structure_id.id,
|
||||
'change_type_id': document_type_id.id
|
||||
}))
|
||||
|
||||
phase_value = {
|
||||
'name' : '%s-%s' %(phase_type_id.name, process.name),
|
||||
'sequence': phase_type_id.sequence,
|
||||
'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)
|
||||
|
||||
return True
|
||||
|
||||
document_change_process()
|
||||
|
||||
class document_file(osv.osv):
|
||||
_inherit = 'ir.attachment'
|
||||
_columns = {
|
||||
'change_type_id':fields.many2one('document.change.type','Document Type'),
|
||||
'state': fields.selection([('draft','To Create'),('in_production', 'In Production'), ('change_request', 'Change Requested'),('change_propose', 'Change Proposed'), ('to_update', 'To Update'), ('cancel', 'Cancel')], 'State'),
|
||||
'style': fields.selection([('run','Run'),('setup','Setup'),('pma','PMA'),('pmp','PMP')],'Document Style'),
|
||||
'target':fields.binary('New Document'),
|
||||
'process_phase_id':fields.many2many('document.change.process.phase','document_change_phase_document', 'document_id','phase_id', 'Phases'),
|
||||
'progress': fields.float('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 _check_duplication(self, cr, uid, vals, ids=[], op='create'):
|
||||
name=vals.get('name',False)
|
||||
parent_id=vals.get('parent_id',False)
|
||||
res_model=vals.get('res_model',False)
|
||||
res_id=vals.get('res_id',0)
|
||||
type_id=vals.get('change_type_id',False)
|
||||
if op=='write':
|
||||
for file in self.browse(cr,uid,ids):
|
||||
if not name:
|
||||
name=file.name
|
||||
if not parent_id:
|
||||
parent_id=file.parent_id and file.parent_id.id or False
|
||||
if not res_model:
|
||||
res_model=file.res_model and file.res_model or False
|
||||
if not res_id:
|
||||
res_id=file.res_id and file.res_id or 0
|
||||
res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id),('change_type_id','=',type_id)])
|
||||
if len(res):
|
||||
return False
|
||||
if op=='create':
|
||||
res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model),('change_type_id','=',type_id)])
|
||||
if len(res):
|
||||
return False
|
||||
return True
|
||||
|
||||
def button_request(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'change_request'},context=context)
|
||||
return True
|
||||
|
||||
def button_propose(self, cr, uid, ids, context={}):
|
||||
for attach in self.browse(cr, uid, ids, context=context):
|
||||
if not attach.target:
|
||||
raise osv.except_osv(_('Error !'), _('You must provide a target content'))
|
||||
self.write(cr, uid, ids, {'state':'change_propose'},context=context)
|
||||
return True
|
||||
|
||||
def button_validate(self, cr, uid, ids, context={}):
|
||||
for attach in self.browse(cr, uid, ids, context=context):
|
||||
if not attach.target:
|
||||
raise osv.except_osv(_('Error !'), _('You must provide a target content'))
|
||||
if (not attach.change_type_id) or not (attach.change_type_id.directory_id.id):
|
||||
raise osv.except_osv(_('Configuration Error !'), _('No history directory associated to the document type.'))
|
||||
self.copy(cr, uid, [attach.id], {
|
||||
'target': False,
|
||||
'parent_id': attach.change_type_id.directory_id.id,
|
||||
'name': time.strftime('%Y%m%d-%H%M-')+attach.name,
|
||||
'datas_fname': time.strftime('%Y%m%d-%H%M-')+attach.datas_fname,
|
||||
'state': 'in_production'
|
||||
},
|
||||
context=context)
|
||||
file('/tmp/debug.png','wb+').write(base64.decodestring(attach.target))
|
||||
self.write(cr, uid, [attach.id], {
|
||||
#'target': False,
|
||||
'datas': attach.target,
|
||||
'state': 'in_production'
|
||||
})
|
||||
return True
|
||||
|
||||
def do_production(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'in_production'},context=context)
|
||||
|
||||
def write(self, cr, uid, ids, data, context={}):
|
||||
result = super(document_file,self).write(cr,uid,ids,data,context=context)
|
||||
for d in self.browse(cr, uid, ids, context=context):
|
||||
if d.state=='draft' and d.datas:
|
||||
super(document_file,self).write(cr,uid,[d.id],
|
||||
{'state':'in_production'},context=context)
|
||||
if (not d.datas) and (d.state=='in_production'):
|
||||
super(document_file,self).write(cr,uid,[d.id],
|
||||
{'state':'draft'},context=context)
|
||||
return True
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'draft'},context=context)
|
||||
|
||||
def button_draft(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'draft'},context=context)
|
||||
|
||||
document_file()
|
|
@ -1,187 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Structure Data -->
|
||||
<record model="document.directory" id="dir_root">
|
||||
<field name="name">Bat E</field>
|
||||
<field name="parent_id" eval="False"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_bat_e">
|
||||
<field name="name">Commodity A</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_bat_z">
|
||||
<field name="name">Commodity B</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_mq_section">
|
||||
<field name="name">MQ Section</field>
|
||||
<field name="parent_id" ref="dir_bat_e"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_section_x">
|
||||
<field name="name">Section X</field>
|
||||
<field name="parent_id" ref="dir_mq_section"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_section_y">
|
||||
<field name="name">Section Y</field>
|
||||
<field name="parent_id" ref="dir_mq_section"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_ws_1bc">
|
||||
<field name="name">Work Station 1BC</field>
|
||||
<field name="parent_id" ref="dir_section_x"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_ws_2bc">
|
||||
<field name="name">Work Station 2BC</field>
|
||||
<field name="parent_id" ref="dir_section_x"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_ws_3bc">
|
||||
<field name="name">Work Station 3BC</field>
|
||||
<field name="parent_id" ref="dir_section_y"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_family1">
|
||||
<field name="name">Family 1</field>
|
||||
<field name="parent_id" ref="dir_ws_1bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family2">
|
||||
<field name="name">Family 2</field>
|
||||
<field name="parent_id" ref="dir_ws_1bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family3">
|
||||
<field name="name">Family 3</field>
|
||||
<field name="parent_id" ref="dir_ws_2bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family4">
|
||||
<field name="name">Family 4</field>
|
||||
<field name="parent_id" ref="dir_ws_3bc"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_vsm">
|
||||
<field name="name">MQ Section 2</field>
|
||||
<field name="parent_id" ref="dir_bat_z"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_takt_time">
|
||||
<field name="name">MQ Section 3</field>
|
||||
<field name="parent_id" ref="dir_bat_z"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_template">
|
||||
<field name="name">Templates</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
|
||||
<!-- 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_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_template">
|
||||
<field name="name">SFMEA_template</field>
|
||||
<field name="datas_fname">SFMEA_template.xls</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_ProjectCharter_Template">
|
||||
<field name="name">ProjectCharter_Template</field>
|
||||
<field name="datas_fname">ProjectCharter_Template.ppt</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_TaktTime_template">
|
||||
<field name="name">TaktTime_template</field>
|
||||
<field name="datas_fname">TaktTime_template.xls</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
|
||||
<!-- 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">
|
||||
<field name="name">Takt Time</field>
|
||||
<field name="template_document_id" ref="doc_TaktTime_template"/>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_FIE">
|
||||
<field name="name">FIE</field>
|
||||
<field name="template_document_id" ref="doc_FIE_template"/>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_SFMEA">
|
||||
<field name="name">SFMEA</field>
|
||||
<field name="template_document_id" ref="doc_SFMEA_template"/>
|
||||
</record>
|
||||
|
||||
<!-- 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"/>
|
||||
<field name="change_type_id" ref="type_FIE"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_0581_001">
|
||||
<field name="name">SFMEA_0581_001</field>
|
||||
<field name="datas_fname">SFMEA_0581_001.xls</field>
|
||||
<field name="parent_id" ref="dir_family1"/>
|
||||
<field name="change_type_id" ref="type_SFMEA"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_0581_002">
|
||||
<field name="name">SFMEA_0581_002</field>
|
||||
<field name="datas_fname">SFMEA_0581_002.xls</field>
|
||||
<field name="parent_id" ref="dir_family2"/>
|
||||
<field name="change_type_id" ref="type_SFMEA"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_TaktTime_0549">
|
||||
<field name="name">TaktTime_0549</field>
|
||||
<field name="datas_fname">TaktTime_0549.xls</field>
|
||||
<field name="parent_id" ref="dir_takt_time"/>
|
||||
<field name="change_type_id" ref="type_takt_time"/>
|
||||
</record>
|
||||
|
||||
<!-- 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"/>
|
||||
</record>
|
||||
<record model="document.change.process.phase.type" id="phase_type_development">
|
||||
<field name="name">Development</field>
|
||||
<field name="sequence">2</field>
|
||||
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
|
||||
</record>
|
||||
<record model="document.change.process.phase.type" id="phase_type_validation">
|
||||
<field name="name">Validation</field>
|
||||
<field name="sequence">3</field>
|
||||
<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">
|
||||
<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>
|
||||
<record model="document.change.process.model" id="model_minor_change">
|
||||
<field name="name">Minor_change</field>
|
||||
<field eval="[(6, 0, [ref('phase_type_development')])]" name="phase_type_ids"/>
|
||||
</record>
|
||||
|
||||
<!-- Process Types -->
|
||||
<record model="document.change.process.type" id="process_quality_alert">
|
||||
<field name="name">Quality Alert</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_new_product">
|
||||
<field name="name">New Product</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_red_risk">
|
||||
<field name="name">Red Risk</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_ci_card">
|
||||
<field name="name">CI Card</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,99 +0,0 @@
|
|||
# -*- 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()
|
|
@ -1,73 +0,0 @@
|
|||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
|
||||
class document_change_report(osv.osv):
|
||||
_name = "document.change.report"
|
||||
_description = "Process Changes Report"
|
||||
_auto = False
|
||||
def _amount_all(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
for id in ids:
|
||||
dir, type = id.split(' ')
|
||||
att = self.pool.get('ir.attachment')
|
||||
fids = att.search(cr, uid, [('parent_id','child_of',[int(dir)]),('change_type_id','=',int(type))], context=context)
|
||||
res[id] = {
|
||||
'amount_required': 0,
|
||||
'amount_exist': 0,
|
||||
'amount_percent': 0.0
|
||||
}
|
||||
for f in att.browse(cr, uid, fids, context=context):
|
||||
res[id] = {
|
||||
'amount_required': res[id]['amount_required'] + 1,
|
||||
'amount_exist': res[id]['amount_exist'] + (f.state<>'draft') and 1 or 0,
|
||||
}
|
||||
if res[id]['amount_required']:
|
||||
res[id]['amount_percent'] = float(res[id]['amount_exist']*100) / res[id]['amount_required']
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'directory_id': fields.many2one('document.directory', 'Directory', readonly=True),
|
||||
'change_type_id': fields.many2one('document.change.type', 'Document Type', readonly=True),
|
||||
'level': fields.integer('Level', readonly=True),
|
||||
'amount_required': fields.function(_amount_all, method=True,
|
||||
string='Required', multi='sums', type='integer'),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'amount_exist': fields.function(_amount_all, method=True,
|
||||
string='Existing', multi='sums', type='integer'),
|
||||
'amount_percent': fields.function(_amount_all, method=True,
|
||||
string='% Coverage', multi='sums', type='float', digits=(16,2)),
|
||||
}
|
||||
def init(self, cr):
|
||||
cr.execute("""
|
||||
create or replace view document_change_report as (
|
||||
select
|
||||
d.id || ' ' || t.id as id,
|
||||
d.id as directory_id,
|
||||
d.level as level,
|
||||
t.id as change_type_id
|
||||
from
|
||||
document_directory d,
|
||||
document_change_type t
|
||||
)""")
|
||||
document_change_report()
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes" sequence="10"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_change_report_search">
|
||||
<field name="name">document.change.report.search</field>
|
||||
<field name="model">document.change.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Coverage Analysis" col="20">
|
||||
<group col="20">
|
||||
<filter
|
||||
string="Level 1"
|
||||
domain="[('level','=',2)]"
|
||||
icon="terp-hr"/>
|
||||
<filter
|
||||
string="Level 2"
|
||||
domain="[('level','=',3)]"
|
||||
icon="terp-hr"/>
|
||||
<filter
|
||||
string="Level 3"
|
||||
domain="[('level','=',4)]"
|
||||
icon="terp-hr"/>
|
||||
<filter
|
||||
string="Level 4"
|
||||
domain="[('level','=',5)]"
|
||||
default="1"
|
||||
icon="terp-hr"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter
|
||||
string="By Directory"
|
||||
icon="terp-hr"
|
||||
context="{'group_by':'directory_id'}"/>
|
||||
<filter
|
||||
string="By Type"
|
||||
icon="terp-hr"
|
||||
default="1"
|
||||
context="{'group_by':'change_type_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="change_type_id" select="1" widget="selection"/>
|
||||
<field name="directory_id" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Forecasts">
|
||||
<field name="date" widget="date" select="1"
|
||||
string="Expected Date"
|
||||
domain="[]"
|
||||
context="{'date':self}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_change_report">
|
||||
<field name="name">document.change.report.tree</field>
|
||||
<field name="model">document.change.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Coverage Analysis">
|
||||
<field name="directory_id"/>
|
||||
<field name="change_type_id"/>
|
||||
<field name="amount_required" sum="Total Required"/>
|
||||
<field name="amount_exist" sum="Total Exist"/>
|
||||
<field name="amount_percent" widget="progressbar"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_change_report_graph">
|
||||
<field name="name">document.change.report.tree</field>
|
||||
<field name="model">document.change.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Coverage Analysis" type="bar">
|
||||
<field name="change_type_id"/>
|
||||
<field name="amount_exist"/>
|
||||
<field name="amount_required"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_document_change_report">
|
||||
<field name="name">Coverage Analysis</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.report</field>
|
||||
<field name="name">Coverage Analysis</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="search_view_id" ref="view_document_change_report_search"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_document_change_report_config"
|
||||
action="action_document_change_report"
|
||||
parent="menu_reporting"/>
|
||||
|
||||
<act_window
|
||||
domain="[('directory_id', '=', active_id)]"
|
||||
id="act_action_document_change_report"
|
||||
name="Coverage Analysis"
|
||||
res_model="document.change.report"
|
||||
src_model="document.directory"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="seq_type_document_change_process" model="ir.sequence.type">
|
||||
<field name="name">Document Change Process</field>
|
||||
<field name="code">document.change.process</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="seq_document_change_process">
|
||||
<field name="name">Document Change Process</field>
|
||||
<field name="code">document.change.process</field>
|
||||
<field name="prefix">PC</field>
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -1,789 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<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"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
id="menu_documents"
|
||||
name="Documents"
|
||||
sequence="3"
|
||||
parent="menu_process_changes"/>
|
||||
<menuitem name="Change Control" id="menu_change_control" parent="menu_process_changes" sequence="5"/>
|
||||
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes" sequence="10"/>
|
||||
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes" sequence="15"/>
|
||||
|
||||
<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="priority">1</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Structure">
|
||||
<field name="parent_id" string="Work Station" select="1"/>
|
||||
<field name="name" string="Family" select="1"/>
|
||||
</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="parent_id" string="Work Station"/>
|
||||
<field name="name" string="Family"/>
|
||||
</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>
|
||||
<field name="name">Directory Structure</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
<field name="view_id" eval="document.view_document_directory_tree"/>
|
||||
</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">
|
||||
<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 ="filename" attrs="{'invisible':[('template_document_id','<>',False)]}"/>
|
||||
<separator string="Associated Phase Types" colspan="4"/>
|
||||
<field name="phase_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_type_tree">
|
||||
<field name="name">document.change.type.tree</field>
|
||||
<field name="model">document.change.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Document Types">
|
||||
<field name="name"/>
|
||||
<field name ="template_document_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.type</field>
|
||||
<field name="name">Document Types</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</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"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_phase_type_form">
|
||||
<field name="name">document.change.process.phase.type.form</field>
|
||||
<field name="model">document.change.process.phase.type</field>
|
||||
<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>
|
||||
<separator string="Associated Document Types" colspan="4"/>
|
||||
<field name="document_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_phase_type_tree">
|
||||
<field name="name">document.change.process.phase.type.tree</field>
|
||||
<field name="model">document.change.process.phase.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phase Types">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="name" string="Phase Type"/>
|
||||
<field name="document_type_ids"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase.type</field>
|
||||
<field name="name">Types of Phases</field>
|
||||
<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"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
action="action_process_phase_type_form"
|
||||
id="menu_phase_type_form"
|
||||
parent="menu_process_changes_config"
|
||||
sequence="4"/>
|
||||
|
||||
<!-- Document Change Process Type -->
|
||||
<record model="ir.ui.view" id="view_change_process_type_form">
|
||||
<field name="name">document.change.process.type.form</field>
|
||||
<field name="model">document.change.process.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phase Types">
|
||||
<field name="name" select="1" string="Phase Type"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_change_processe_type_tree">
|
||||
<field name="name">document.change.process.type.tree</field>
|
||||
<field name="model">document.change.process.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phase Types">
|
||||
<field name="name" string="Phase Type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_change_process_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.type</field>
|
||||
<field name="name">Process Type</field>
|
||||
<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
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_model_change_form">
|
||||
<field name="name">document.change.process.model.form</field>
|
||||
<field name="model">document.change.process.model</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Model of Changes">
|
||||
<field name="name" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<separator string="Phase Type" colspan="4"/>
|
||||
<field name="phase_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_model_change_tree">
|
||||
<field name="name">document.change.process.model.tree</field>
|
||||
<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" invisible="1"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_model_change_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.model</field>
|
||||
<field name="name">Model of Process</field>
|
||||
<field name="view_type">form</field>
|
||||
<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
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_document_form">
|
||||
<field name="name">ir.attachment.form</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="priority" eval="-1"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Documents">
|
||||
<field name="name" select="1"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="datas" filename="datas_fname" string="Content"/>
|
||||
<field name="change_type_id" widget="selection"/>
|
||||
<field name="datas_fname"/>
|
||||
<field name="style"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Information">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Creation" colspan="2"/>
|
||||
<field name="create_uid" readonly="1"/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Latest Modification" colspan="2"/>
|
||||
<field name="write_uid" readonly="1"/>
|
||||
<field name="write_date" readonly="1"/>
|
||||
</group>
|
||||
</page><page string="Change Request">
|
||||
<separator string="Change Control" colspan="4"/>
|
||||
<group col="11" colspan="2">
|
||||
<field name="state" readonly="1"/>
|
||||
<group attrs="{'invisible':[('state','in', ('in_production','draft'))]}">
|
||||
<field name="target" filename="target_fname"/>
|
||||
</group>
|
||||
<button type="object" name="button_request" states="draft,in_production" string="Request Change" icon="gtk-media-play"/>
|
||||
<button type="object" name="button_propose" states="change_request" string="Propose Change" icon="gtk-apply"/>
|
||||
<button type="object" name="button_validate" states="change_propose" string="Update Production" icon="gtk-apply"/>
|
||||
<button type="object" name="button_cancel" states="change_request,change_propose,to_update" string="Cancel" icon="gtk-cancel"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string="Change Note" colspan="4"/>
|
||||
<field colspan="4" name="description" nolabel="1"/>
|
||||
</page><page string="Email Notifications">
|
||||
<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>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_tree">
|
||||
<field name="name">ir.attachment.tree</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="-1"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Documents">
|
||||
<field name="name" string="Document"/>
|
||||
<field name="parent_id" string="Directory"/>
|
||||
<field name="change_type_id"/>
|
||||
<field name="style"/>
|
||||
<field name="state"/>
|
||||
<field name="change_process_id"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
<button type="object" name="button_request" states="draft,in_production" string="Request Change" icon="gtk-media-play"/>
|
||||
</tree>
|
||||
</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>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_search">
|
||||
<field name="name">ir.attachment.search</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Documents">
|
||||
<group col="13" colspan="4">
|
||||
<filter domain="[('user_id','=',uid)]" string="My Docs" icon="gtk-apply"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter domain="[('state','=','in_production')]" string="In Production" icon="gtk-apply"/>
|
||||
<filter domain="[('state','=','change_request')]" string="Change Req." icon="gtk-apply"/>
|
||||
<filter domain="[('state','=','change_propose')]" string="Change Proposed" icon="gtk-execute"/>
|
||||
<filter domain="[('state','=','to_update')]" string="To Update" icon="gtk-execute"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="change_type_id" widget="selection" select="1"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="create_uid" 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" icon="terp-hr" context="{'group_by':'change_type_id'}" help="Documents by type"/>
|
||||
<filter domain="[]" string="By State" icon="terp-hr" context="{'group_by':'state'}" help="Documents by type"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_document_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="name">Search a Document</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</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>
|
||||
<field name="view_id" ref="view_document_tree"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<record id="action_document_form_view" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_document_form"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<record id="action_document_graph_view" model="ir.actions.act_window.view">
|
||||
<field eval="3" name="sequence"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_document_graph"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_document_form"
|
||||
id="menu_documents_form"
|
||||
parent="menu_documents"
|
||||
sequence="20"/>
|
||||
<menuitem
|
||||
name="Documents by Directories"
|
||||
action="document.action_document_directory_tree"
|
||||
sequence="1"
|
||||
id="menu_document_directories"
|
||||
parent="menu_documents"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="document.action_document_file_directory_form">
|
||||
<field name="search_view_id" ref="view_document_search"/>
|
||||
</record>
|
||||
|
||||
<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>
|
||||
<field name="name">Documents Without Type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_document_search"/>
|
||||
<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>
|
||||
<field name="name">Documents to Update</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_document_search"/>
|
||||
<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">
|
||||
<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" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/>
|
||||
<field name="phase_type_id"/>
|
||||
<field name="directory_id" readonly="1" colspan="4"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Documents"/>
|
||||
<field name="phase_document_ids" colspan="4" nolabel="1" context="{'default_parent_id': directory_id}"/>
|
||||
<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>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_process_phase_search">
|
||||
<field name="name">document.change.process.phase.search</field>
|
||||
<field name="model">document.change.process.phase</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Phases" col="20">
|
||||
<filter domain="[('state','=','draft')]" string="To Start" icon="gtk-execute"
|
||||
help="To Start"/>
|
||||
<filter domain="[('state','=','in_process')]" string="In Progress" icon="gtk-execute"
|
||||
help="In Progress"/>
|
||||
<filter domain="[('state','=','to_validate')]" string="To Validate" icon="gtk-execute"
|
||||
help="To Validate"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="process_id" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="phase_type_id" select="1"/>
|
||||
<field name="date_control" select="1"/>
|
||||
<newline/>
|
||||
<group string="Group By..." expand="1" colspan="10">
|
||||
<filter domain="[]" string="By Process" icon="terp-hr" context="{'group_by':'process_id'}" help="Process Changes by owner"/>
|
||||
<filter domain="[]" string="By Type" icon="terp-hr" context="{'group_by':'phase_type_id'}" help="Process Changes by owner"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_process_phase_calendar" model="ir.ui.view">
|
||||
<field name="name">document.change.process.phase.calendar</field>
|
||||
<field name="model">document.change.process.phase</field>
|
||||
<field name="type">calendar</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar color="state" date_start="date_control" string="Phases Deadlines">
|
||||
<field name="name"/>
|
||||
<field name="process_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_process_phase_tree">
|
||||
<field name="name">document.change.process.phase.tree</field>
|
||||
<field name="model">document.change.process.phase</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phases">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="process_id"/>
|
||||
<field name="name"/>
|
||||
<field name="phase_type_id"/>
|
||||
<field name="date_control"/>
|
||||
<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"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase</field>
|
||||
<field name="name">Phases</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="search_view_id" ref="view_process_phase_search"/>
|
||||
</record>
|
||||
<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">
|
||||
<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>
|
||||
<field name="search_view_id" ref="view_process_phase_search"/>
|
||||
</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"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_documents_phases">
|
||||
<field name="search_view_id" ref="view_process_phase_search"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
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">
|
||||
<group colspan="4" col="8">
|
||||
<field name="description" colspan="4"/>
|
||||
<field name="process_type_id" widget="selection"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<newline/>
|
||||
<!-- Big Hack For Demo Purpose Caterpillar -->
|
||||
<field name="structure_id" colspan="4" domain="[('name','ilike','fam')]"/>
|
||||
<field name="process_model_id" widget="selection"/>
|
||||
<button name="generate_phases"
|
||||
string="Generate Phases" type="object"
|
||||
icon="gtk-convert" colspan="2"/>
|
||||
</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" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="date_control" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/>
|
||||
<field name="phase_document_ids"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
<form string="Process Phases">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="type"/>
|
||||
<field name="date_control" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/>
|
||||
<field name="phase_document_ids" colspan="4"/>
|
||||
<field name="state"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_tree">
|
||||
<field name="name">document.change.process.tree</field>
|
||||
<field name="model">document.change.process</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Process Change">
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="structure_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="current_phase_id"/>
|
||||
<field name="date_control"/>
|
||||
<field name="process_model_id"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="process_document_ids" string="# Documents"/>
|
||||
<field name="state"/>
|
||||
</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.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="14" colspan="4">
|
||||
<filter domain="[('user_id','=',uid)]" string="My Process" icon="gtk-execute" help="My Process Changes"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter domain="[('state','in',('in_progress','draft','to_validate'))]"
|
||||
string="In Progress" icon="gtk-execute"
|
||||
default="1"
|
||||
help="Process changes having the next Phase to validate that is late"/>
|
||||
<filter domain="[('state','=','to_validate')]"
|
||||
string="To Validate"
|
||||
icon="gtk-apply"
|
||||
help="Process Changes to be validated"/>
|
||||
<filter domain="[('state','=','pending')]"
|
||||
string="Pending" icon="gtk-execute"
|
||||
help="Process changes having the next Phase to validate that is late"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<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"/>
|
||||
<filter domain="[]" string="By State" icon="terp-hr" context="{'group_by':'state'}" 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>
|
||||
<field name="name">Process Changes</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<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>
|
||||
<field name="name">Process Changes 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_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"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_phase_change_process">
|
||||
<field name="search_view_id" ref="view_process_phase_search"/>
|
||||
</record>
|
||||
|
||||
<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 model="ir.actions.act_window" id="act_documents_change_process">
|
||||
<field name="search_view_id" ref="view_document_search"/>
|
||||
</record>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<record model="ir.ui.view" id="view_document_change_report_graph">
|
||||
<field name="name">document.change.report.graph</field>
|
||||
<field name="model">document.change.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Coverage Analysis" type="bar">
|
||||
<field name="change_type_id"/>
|
||||
<field name="amount_exist"/>
|
||||
<field name="amount_required"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_document_change_report">
|
||||
<field name="name">Coverage Analysis</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_document_change_report_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="board_document_change_form" model="ir.ui.view">
|
||||
<field name="name">board.document.change.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process Change Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(action_document_to_update_form)d" string="Documents to Update" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(action_document_change_report)d" string="Coverage Analysis" width="510"/>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_board_document_change" model="ir.actions.act_window">
|
||||
<field name="name">Process Change Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_document_change_form"/>
|
||||
</record>
|
||||
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
|
||||
<menuitem
|
||||
id="menu_document_change_dashboard"
|
||||
name="Process Change"
|
||||
parent="base.dashboard"/>
|
||||
<menuitem
|
||||
action="open_board_document_change"
|
||||
icon="terp-graph"
|
||||
id="menu_board_document_change"
|
||||
parent="menu_document_change_dashboard"
|
||||
sequence="1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_cal">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase</field>
|
||||
<field name="name">Calendar of Phases</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">calendar,tree,form</field>
|
||||
<field name="search_view_id" ref="view_process_phase_search"/>
|
||||
</record>
|
||||
<menuitem action="action_process_phase_cal" id="menu_phases_cal" parent="menu_change_control"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wkf_change_process_phase" model="workflow">
|
||||
<field name="name">document.change.process.phase.basic</field>
|
||||
<field name="osv">document.change.process.phase</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
<!-- States -->
|
||||
<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_phase_start" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">in_process</field>
|
||||
<field name="action">do_start()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_phase_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">to_validate</field>
|
||||
<field name="action">do_confirm()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_phase_end" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">done</field>
|
||||
<field name="action">do_done()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<!-- Transitions -->
|
||||
<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="tran_phase_start_to_confirm_control" model="workflow.transition">
|
||||
<field name="act_from" ref="act_phase_start"/>
|
||||
<field name="act_to" ref="act_phase_confirm"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">button_confirm</field>
|
||||
</record>
|
||||
<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="role_id" ref="role_NPPI" />
|
||||
<field name="signal">button_end</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,68 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wkf_change_process" model="workflow">
|
||||
<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_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_process_in_progress" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">in_progress</field>
|
||||
<field name="action">do_start()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_pending" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">pending</field>
|
||||
<field name="action">do_pending()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">to_validate</field>
|
||||
<field name="action">do_confirm()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_done" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">done</field>
|
||||
<field name="action">do_done()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<!-- Transitions -->
|
||||
<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="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="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="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="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>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
<record model="res.roles" id="role_NPPI">
|
||||
<field name="name">Document Change/ Phase Manager</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue