forked from gisce/openobject-addons-extra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
f51d7b1
commit 0438583
Showing
14 changed files
with
1,332 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- 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_config | ||
import document_change | ||
#import document_change_report | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- 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','board'], | ||
'init_xml': [ | ||
'data/document_change_data.xml' | ||
], | ||
'update_xml': [ | ||
#'security/document_process_security.xml', | ||
'view/document_change.xml', | ||
'view/document_change_config.xml', | ||
'data/document_change_sequence.xml', | ||
'data/document_process_workflow.xml', | ||
'data/directory_types.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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<openerp> | ||
<data> | ||
|
||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" ?> | ||
<openerp> | ||
<data> | ||
<record id="document_directory_type_history0" model="document.directory.type"> | ||
<field name="name">History</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_building0" model="document.directory.type"> | ||
<field name="name">Building</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_factory0" model="document.directory.type"> | ||
<field name="name">Factory</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_sectionmq0" model="document.directory.type"> | ||
<field name="name">Section MQ</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_section0" model="document.directory.type"> | ||
<field name="name">Section</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_workstation0" model="document.directory.type"> | ||
<field name="name">Work Station</field> | ||
</record> | ||
</data> | ||
<data> | ||
<record id="document_directory_type_familly0" model="document.directory.type"> | ||
<field name="name">Familly</field> | ||
</record> | ||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<?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> | ||
|
||
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
#-*- 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' | ||
_columns = { | ||
'type_id': fields.many2one('document.directory.type', 'Type'), | ||
'version' : fields.integer('Version') | ||
} | ||
|
||
|
||
|
||
|
||
|
||
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'), | ||
'directory_ids' :fields.many2many('document.directory','directory_process_rel','directory_id','process_id','Directory involved'), | ||
'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'), | ||
'date_production':fields.datetime('Real Production'), | ||
'black_belt': fields.boolean("Black Belt Lead"), | ||
'need_validation': fields.boolean("Validation Needed"), | ||
'state':fields.selection([('draft', 'Draft'),('in_progress', 'In Progress'),('to_validate', 'To Validate'), ('pending', 'Pending'), ('done', 'Released'),('cancel','Cancelled')], 'State'), | ||
'progress': fields.function(_get_progress, method=True, type='float', string='Progress'), | ||
'process_document_ids': fields.one2many('ir.attachment', 'process_id','Documents To Change'), | ||
} | ||
_defaults = { | ||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'document.change.process'), | ||
'state': '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) | ||
|
||
|
||
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 Requested'),('change_propose', 'Change Proposed'), ('to_update', 'To Update'), ('cancel', 'Cancel')], 'State'), | ||
'target':fields.binary('New Document'), | ||
'version' : fields.integer('Version'), | ||
'process_id' : fields.many2one('document.change.process', 'Process change'), | ||
'date_production':fields.datetime('Real Production'), | ||
} | ||
_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) | ||
return True | ||
|
||
def button_cancel(self, cr, uid, ids, context={}): | ||
print "cancel" | ||
return self.write(cr, uid, ids, {'state':'in_production'},context=context) | ||
|
||
def button_draft(self, cr, uid, ids, context={}): | ||
return self.write(cr, uid, ids, {'state':'in_production'},context=context) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#-*- coding: utf-8 -*- | ||
''' | ||
Created on 19 déc. 2011 | ||
@author: openerp | ||
''' | ||
from osv import fields, osv | ||
|
||
class document_directory_type(osv.osv): | ||
_name = 'document.directory.type' | ||
|
||
_columns = { | ||
'name': fields.char('Directory Type', size=64) | ||
} | ||
|
||
class document_change_type(osv.osv): | ||
_name = "document.change.type" | ||
_description = "Document Type" | ||
_columns = { | ||
'name': fields.char("Document Type", size=64,required=True), | ||
'code' : fields.char("ISO Code", size=64), | ||
'directory_type_id' :fields.many2one('document.directory.type','Directory Type', help='This link allow to define on wich kind of directory this type of document is attached with'), | ||
'template_document_id':fields.many2one('ir.attachment','Template Document'), | ||
'sequence' : fields.integer('Sequence Number', help="Allow to define order for documents"), | ||
} | ||
|
||
_order = "sequence asc" | ||
|
||
class document_change_process_type(osv.osv): | ||
_name = "document.change.process.type" | ||
_description = "Process Type" | ||
_columns = { | ||
'name': fields.char("Process Type", size=64), | ||
'document_type_ids' : fields.many2many('document.change.type','document_type_process_type_rel','process_change_type_id','document_type_id','Document Type') | ||
} | ||
|
||
|
||
class process_change_stage(osv.osv): | ||
_name = "cat.process_change.stage" | ||
|
||
_columns = { | ||
'name' : fields.char("Name", size=128), | ||
'sequence' : fields.integer('Sequence Number', help="Allow to define order for stages"), | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# -*- 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_id': 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_id as level_id, | ||
t.id as change_type_id | ||
from | ||
document_directory d, | ||
document_change_type t | ||
)""") | ||
document_change_report() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?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="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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,318 @@ | ||
<?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="2"/> | ||
<menuitem | ||
id="menu_documents" | ||
name="Documents" | ||
sequence="1" | ||
parent="menu_process_changes"/> | ||
|
||
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes" sequence="10"/> | ||
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes" sequence="15"/> | ||
|
||
|
||
<act_window domain="[('structure_id', '=', active_id)]" | ||
id="act_structure_process_changes" | ||
name="Process Changes" | ||
res_model="document.change.process" | ||
src_model="document.directory"/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<!-- | ||
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="version"/> | ||
<field name="process_id" /> | ||
<field name="date_production" /> | ||
<notebook colspan="4"> | ||
<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',))]}"> | ||
<field name="target" filename="target_fname"/> | ||
</group> | ||
<button type="object" name="button_request" states="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="Release" 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="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> | ||
</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="state"/> | ||
<field name="user_id" string="Owner"/> | ||
<button type="object" name="button_request" states="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"> | ||
<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="name" /> | ||
<field name="description" /> | ||
<field name="change_type_id" widget="selection" select="1"/> | ||
<field name="parent_id" select="1"/> | ||
<field name="create_uid" select="1"> | ||
<filter domain="[('user_id','=',uid)]" string="My Docs" icon="terp-personal"/> | ||
</field> | ||
<newline/> | ||
<group expand="1" string="Group By..."> | ||
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" 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"/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<!-- | ||
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="4"> | ||
<field name="description" /> | ||
<field name="name" readonly="1"/> | ||
<newline/> | ||
<field name="process_type_id" widget="selection"/> | ||
<field name="user_id" string="Responsible"/> | ||
</group> | ||
|
||
<notebook colspan="4"> | ||
<page string="Process Definition"> | ||
<group col="2" colspan="2"> | ||
<separator string="Directory needed" colspan="2"/> | ||
<field name="directory_ids" nolabel="1" colspan="2" domain="[('type_id','!=', False), ('type_id.name', '!=', 'History')]"/> | ||
</group> | ||
<group col="2" colspan="2"> | ||
<separator string="Document to modify" colspan="2"/> | ||
<field name="process_document_ids" nolabel="1" colspan="2" /> | ||
</group> | ||
</page> | ||
<page string="Extra Information"> | ||
<field name="black_belt" /> | ||
<field name="need_validation"/> | ||
|
||
<field name="create_date" string="Start date"/> | ||
<field name="latest_modified_date"/> | ||
<field name="date_expected"/> | ||
<field name="date_production"/> | ||
<separator colspan="4" string="Change Description"/> | ||
<field name="change_description" colspan="4" nolabel="1"/> | ||
</page> | ||
|
||
|
||
</notebook> | ||
<group col="8" 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="Done" icon="gtk-execute"/> | ||
<button name="button_pending" states="in_progress" string="Pending" icon="gtk-media-pause"/> | ||
<button name="button_done" states="to_validate" string="Validate" icon="gtk-jump-to"/> | ||
<button name="button_cancel" states="pending,in_progress,to_validate" string="Done" icon="gtk-jump-to"/> | ||
</group> | ||
</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="user_id"/> | ||
<field name="progress" widget="progressbar"/> | ||
<field name="process_document_ids" string="# Documents"/> | ||
<field name="state"/> | ||
<field name="date_expected" /> | ||
<field name="date_production" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
|
||
<record model="ir.ui.view" id="view_process_search"> | ||
<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"> | ||
<separator orientation="vertical"/> | ||
<filter domain="[('state','in',('in_progress','to_validate'))]" | ||
string="In Progress" icon="gtk-execute" | ||
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="description" string="Title" select="1"/> | ||
<field name="name" string="Process ID" /> | ||
<field name="process_type_id" select="1"/> | ||
<field name="directory_ids" select="1"/> | ||
<field name="user_id" string="Owner" select="1"> | ||
<filter icon="terp-personal" | ||
domain="[('user_id','=', uid)]" | ||
help="My process change" /> | ||
</field> | ||
<field name="change_description" string="Description" /> | ||
<newline/> | ||
<group expand="1" string="Group By..."> | ||
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" help="Process Changes by owner"/> | ||
<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</field> | ||
<field name="search_view_id" ref="view_process_search"/> | ||
</record> | ||
|
||
<menuitem | ||
id="menu_process_changes_form" | ||
action="action_process_form" | ||
parent="menu_document_process_changes"/> | ||
|
||
|
||
|
||
|
||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
<?xml version="1.0"?> | ||
<openerp> | ||
<data> | ||
<!-- | ||
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"> | ||
<group col="6" colspan="4"> | ||
<field name="name" /> | ||
<field name="code" /> | ||
<field name="sequence" /> | ||
<field name="directory_type_id"/> | ||
<field name ="template_document_id"/> | ||
</group> | ||
</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="sequence" /> | ||
<field name="name"/> | ||
<field name="code" /> | ||
<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"/> | ||
|
||
<!-- | ||
Directory | ||
--> | ||
|
||
<record model="ir.ui.view" id="view_document_directory_form"> | ||
<field name="name">document.directory.form</field> | ||
<field name="model">document.directory</field> | ||
<field name="type">form</field> | ||
<field name="priority">5</field> | ||
<field name="arch" type="xml"> | ||
<form string="Directory"> | ||
<group col="6" colspan="4"> | ||
<field name="name" /> | ||
<field name="type_id" /> | ||
<field name="user_id" /> | ||
<field name="parent_id" /> | ||
<field name="version" readonly="1" /> | ||
</group> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="action_document_directory_form"> | ||
<field name="type">ir.actions.act_window</field> | ||
<field name="res_model">document.directory</field> | ||
<field name="name">Directory</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">tree,form</field> | ||
<!-- <field name="domain">[('type_id','!=',False)]</field> --> | ||
</record> | ||
|
||
<menuitem | ||
name="Directory" | ||
id="menu_directory_config" | ||
parent="menu_configuration"/> | ||
<menuitem | ||
name="Directory" | ||
id="menu_directory_form" | ||
action="action_document_directory_form" | ||
parent="menu_directory_config"/> | ||
|
||
<!-- | ||
Directories Structure | ||
--> | ||
|
||
<record model="ir.ui.view" id="view_document_directory_tree"> | ||
<field name="name">document.directory</field> | ||
<field name="model">document.directory</field> | ||
<field name="type">tree</field> | ||
<field name="field_parent">child_ids</field> | ||
<field name="arch" type="xml"> | ||
<tree string="Directories" toolbar="1"> | ||
<field name="name"/> | ||
<field name="type_id"/> | ||
<field name="user_id"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="action_document_directory_tree"> | ||
<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> | ||
</record> | ||
|
||
<menuitem id="menu_structure_form" | ||
action="action_document_directory_tree" | ||
parent="menu_directory_config"/> | ||
<!-- | ||
Directory Types | ||
--> | ||
<record model="ir.ui.view" id="view_directory_type_form"> | ||
<field name="name">document.directory.type.form</field> | ||
<field name="model">document.directory.type</field> | ||
<field name="type">form</field> | ||
<field name="arch" type="xml"> | ||
<form string="Directory Types"> | ||
<group col="6" colspan="4"> | ||
<field name="name" /> | ||
</group> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="view_directory_type_tree"> | ||
<field name="name">document.directory.type.tree</field> | ||
<field name="model">document.directory.type</field> | ||
<field name="type">tree</field> | ||
<field name="arch" type="xml"> | ||
<tree string="Directory Types"> | ||
<field name="name"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="action_directory_type"> | ||
<field name="type">ir.actions.act_window</field> | ||
<field name="res_model">document.directory.type</field> | ||
<field name="name">Directory Types</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">tree,form</field> | ||
</record> | ||
|
||
|
||
<menuitem | ||
action="action_directory_type" | ||
id="menu_directory_type_form" | ||
parent="menu_directory_config"/> | ||
|
||
<!-- | ||
Process change Types | ||
--> | ||
<record model="ir.ui.view" id="view_process_change_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="Process Change Types"> | ||
<group col="2" colspan="4"> | ||
<field name="name" /> | ||
</group> | ||
<separator colspan="4" name="Document Types Needed" /> | ||
<field name="document_type_ids" nolabel="1" colspan="4"/> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="view_process_change_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="Process Change Types"> | ||
<field name="name"/> | ||
</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 name="Process Changes" | ||
id="menu_process_changes_config" | ||
parent="menu_configuration" | ||
sequence="1"/> | ||
|
||
<menuitem action="action_change_process_type_form" | ||
id="menu_change_process_type_form" | ||
parent="menu_process_changes_config"/> | ||
|
||
</data> | ||
</openerp> |