New trunk

bzr revid: pinky-3f10ee12cea3c4c75cef44ab04ad33ef47432907
This commit is contained in:
pinky 2006-12-07 13:41:40 +00:00
commit 004a0b996f
444 changed files with 136485 additions and 0 deletions

3
MANIFEST.in Normal file
View File

@ -0,0 +1,3 @@
recursive-include doc *
recursive-include man *
recursive-include bin *xml *xsl *sql

18
bin/PKG-INFO Normal file
View File

@ -0,0 +1,18 @@
Metadata-Version: 1.1
Name: Tiny ERP
Version: 3.2.0
Author: Tiny.be
Author-email: fp at tiny be
Maintainer: Tiny.be
Maintainer-email: fp at tiny be
Home-page: http://tiny.be
Download-url: http://tinyerp.org/download.php
Summary: TinyERP is an Enterprise Resource Management written entirely in python.
License: GPL
Description: Tiny ERP is a complete ERP and CRM. The main features are accounting (analytic
and financial), stock management, sales and purchases management, tasks
automation, marketing campaigns, help desk, POS, etc. Technical features include
a distributed server, flexible workflows, an object database, a dynamic GUI,
customizable reports, and SOAP and XML-RPC interfaces.
Keywords: ERP, Accounting, Stock, CRM, Enterprise, Logistics, Management, Sales, Purchases
Platform: Linux, Win32

0
bin/__init__.py Normal file
View File

249
bin/addons/__init__.py Normal file
View File

@ -0,0 +1,249 @@
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be)
#
# $Id: __init__.py 1308 2005-09-08 18:02:01Z pinky $
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contact a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os, sys, imp
import itertools
from sets import Set
import osv
import tools
import pooler
import netsvc
from osv import fields
logger = netsvc.Logger()
opj = os.path.join
ad = tools.config['addons_path']
sys.path.insert(1,ad)
class Graph(dict):
def addNode(self, name, deps):
max_depth, father = 0, None
for n in [Node(x, self) for x in deps]:
if n.depth >= max_depth:
father = n
max_depth = n.depth
if father:
father.addChild(name)
else:
Node(name, self)
def __iter__(self):
level = 0
done = Set(self.keys())
while done:
level_modules = [(name, module) for name, module in self.items() if module.depth==level]
for name, module in level_modules:
done.remove(name)
yield module
level += 1
class Singleton(object):
def __new__(cls, name, graph):
if name in graph:
inst = graph[name]
else:
inst = object.__new__(cls)
inst.name = name
graph[name] = inst
return inst
class Node(Singleton):
def __init__(self, name, graph):
self.graph = graph
if not hasattr(self, 'childs'):
self.childs = []
if not hasattr(self, 'depth'):
self.depth = 0
def addChild(self, name):
node = Node(name, self.graph)
node.depth = self.depth + 1
if node not in self.childs:
self.childs.append(node)
for attr in ('init', 'update', 'demo'):
if hasattr(self, attr):
setattr(node, attr, True)
self.childs.sort(lambda x,y: cmp(x.name, y.name))
def hasChild(self, name):
return Node(name, self.graph) in self.childs or \
bool([c for c in self.childs if c.hasChild(name)])
def __setattr__(self, name, value):
super(Singleton, self).__setattr__(name, value)
if name in ('init', 'update', 'demo'):
tools.config[name][self.name] = 1
for child in self.childs:
setattr(child, name, value)
if name == 'depth':
for child in self.childs:
setattr(child, name, value + 1)
def __iter__(self):
return itertools.chain(iter(self.childs), *map(iter, self.childs))
def __str__(self):
return self._pprint()
def _pprint(self, depth=0):
s = '%s\n' % self.name
for c in self.childs:
s += '%s`-> %s' % (' ' * depth, c._pprint(depth+1))
return s
def create_graph(module_list, force=[]):
graph = Graph()
packages = []
for module in module_list:
terp_file = opj(ad, module, '__terp__.py')
if os.path.isfile(terp_file):
info = eval(file(terp_file).read())
if info.get('installable', True):
packages.append((module, info.get('depends', []), info))
current,later = Set([p for p, dep, data in packages]), Set()
while packages and current > later:
package, deps, datas = packages[0]
# if all dependencies of 'package' are already in the graph, add 'package' in the graph
if reduce(lambda x,y: x and y in graph, deps, True):
later.clear()
current.remove(package)
graph.addNode(package, deps)
node = Node(package, graph)
node.datas = datas
for kind in ('init', 'demo', 'update'):
if package in tools.config[kind] or 'all' in tools.config[kind] or kind in force:
setattr(node, kind, True)
else:
later.add(package)
packages.append((package, deps, datas))
packages = packages[1:]
for package in later:
logger.notifyChannel('init', netsvc.LOG_ERROR, 'addon:%s:Unmet dependency' % package)
return graph
def init_module_objects(cr, module_name, obj_list):
pool = pooler.get_pool(cr.dbname)
logger.notifyChannel('init', netsvc.LOG_INFO, 'addon:%s:creating or updating database tables' % module_name)
for obj in obj_list:
#CHECKME: is this test useful? all objects are supposed to have an _auto_init method, right?
#if hasattr(obj, '_auto_init'):
if hasattr(obj, 'init'):
obj.init(cr)
obj._auto_init(cr)
cr.commit()
def load_module_graph(cr, graph, status={}):
package_todo = []
statusi = 0
for package in graph:
status['progress'] = (float(statusi)+0.1)/len(graph)
m = package.name
logger.notifyChannel('init', netsvc.LOG_INFO, 'addon:%s' % m)
sys.stdout.flush()
pool = pooler.get_pool(cr.dbname)
modules = pool.instanciate(m)
cr.execute('select state, demo from ir_module_module where name=%s', (m,))
(package_state, package_demo) = (cr.rowcount and cr.fetchone()) or ('uninstalled', False)
idref = {}
status['progress'] = (float(statusi)+0.4)/len(graph)
if hasattr(package, 'init') or hasattr(package, 'update') or package_state in ('to install', 'to upgrade'):
init_module_objects(cr, m, modules)
for kind in ('init', 'update'):
for filename in package.datas.get('%s_xml' % kind, []):
mode = 'update'
if hasattr(package, 'init') or package_state=='to install':
mode = 'init'
logger.notifyChannel('init', netsvc.LOG_INFO, 'addon:%s:loading %s' % (m, filename))
name, ext = os.path.splitext(filename)
if ext == '.csv':
tools.convert_csv_import(cr, m, filename, tools.file_open(opj(m, filename)).read(), idref, mode=mode)
elif ext == '.sql':
queries = tools.file_open(opj(m, filename)).read().split(';')
for query in queries:
new_query = ' '.join(query.split())
if new_query:
cr.execute(new_query)
cr.commit()
else:
tools.convert_xml_import(cr, m, tools.file_open(opj(m, filename)).read(), idref, mode=mode)
if hasattr(package, 'demo') or (package_demo and package_state != 'installed'):
status['progress'] = (float(statusi)+0.75)/len(graph)
for xml in package.datas.get('demo_xml', []):
name, ext = os.path.splitext(xml)
logger.notifyChannel('init', netsvc.LOG_INFO, 'addon:%s:loading %s' % (m, xml))
if ext == '.csv':
tools.convert_csv_import(cr, m, os.path.basename(xml), tools.file_open(opj(m, xml)).read(), idref)
else:
tools.convert_xml_import(cr, m, tools.file_open(opj(m, xml)).read(), idref)
package_todo.append(package.name)
cr.execute("update ir_module_module set state='installed', demo=%s where state in ('to upgrade', 'to install') and name=%s", (str(hasattr(package, 'demo')) or package_demo, package.name))
cr.commit()
statusi+=1
cr.commit()
# pool = osv.osv.FakePool('base')
# pool = pooler.get_pool(cr.dbname)
# pool.get('ir.model.data')._process_end(cr, 1, package_todo)
# cr.commit()
def register_classes():
module_list = os.listdir(ad)
for package in create_graph(module_list):
m = package.name
logger.notifyChannel('init', netsvc.LOG_INFO, 'addon:%s:registering classes' % m)
sys.stdout.flush()
imp.load_module(m, *imp.find_module(m))
def load_modules(db, force_demo=False, status={}, update_module=False):
force = []
if force_demo:
force.append('demo')
cr = db.cursor()
if update_module:
cr.execute("select name from ir_module_module where state in ('installed', 'to install', 'to upgrade')")
else:
cr.execute("select name from ir_module_module where state = 'installed'")
module_list = [name for (name,) in cr.fetchall()]
graph = create_graph(module_list, force)
load_module_graph(cr, graph, status)
cr.commit()
cr.close()

View File

@ -0,0 +1,32 @@
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import ir
import module
import res

View File

@ -0,0 +1,36 @@
{
"name" : "Base",
"version" : "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com",
"category" : "Generic Modules/Base",
"description": "The kernel of Tiny ERP, needed for all installation.",
"depends" : [],
"init_xml" : [
"base_data.xml",
"base_menu.xml"
],
"demo_xml" : [
"base_demo.xml",
"res/partner/partner_demo.xml",
"res/partner/crm_demo.xml",
],
"update_xml" : [
"base_update.xml",
"ir/ir.xml",
"ir/workflow/workflow_view.xml",
"module/module_data.xml",
"module/module_wizard.xml",
"module/module_view.xml",
"module/module_report.xml",
"res/res_request_view.xml",
"res/partner/partner_report.xml",
"res/partner/partner_view.xml",
"res/partner/partner_wizard.xml",
"res/res_currency_view.xml",
"res/partner/crm_view.xml",
"res/partner/partner_data.xml",
"res/ir_property_view.xml",
],
"installable": True
}

335
bin/addons/base/base.sql Normal file
View File

@ -0,0 +1,335 @@
-------------------------------------------------------------------------
-- Pure SQL
-------------------------------------------------------------------------
CREATE TABLE perm (
id serial NOT NULL,
level smallint DEFAULT 4 NOT NULL,
uid int default null,
gid int default null,
primary key(id)
);
insert into perm (id,uid,gid) values (1,1,1);
CREATE TABLE inherit (
obj_type varchar(128) not null,
obj_id int not null,
inst_type varchar(128) not null,
inst_id int not null
);
-------------------------------------------------------------------------
-- IR dictionary
-------------------------------------------------------------------------
create table ir_values
(
id serial,
perm_id int references perm on delete set null,
name varchar(128) not null,
key varchar(128) not null,
key2 varchar(128) not null,
model varchar(128) not null,
value text,
meta text default NULL,
res_id integer default null,
primary key (id)
);
-------------------------------------------------------------------------
-- Modules Description
-------------------------------------------------------------------------
CREATE TABLE ir_model (
id serial,
model varchar(64) DEFAULT ''::varchar NOT NULL,
name varchar(64),
info text,
primary key(id)
);
CREATE TABLE ir_model_fields (
id serial,
model varchar(64) DEFAULT ''::varchar NOT NULL,
model_id int references ir_model,
name varchar(64) DEFAULT ''::varchar NOT NULL,
relation varchar(64),
field_description varchar(256),
ttype varchar(64),
group_name varchar(64),
view_load boolean,
relate boolean default False,
primary key(id)
);
-------------------------------------------------------------------------
-- Actions
-------------------------------------------------------------------------
CREATE TABLE ir_actions (
id serial NOT NULL,
perm_id int references perm on delete set null,
name varchar(64) DEFAULT ''::varchar NOT NULL,
"type" varchar(64) DEFAULT 'window'::varchar NOT NULL,
usage varchar(32) DEFAULT null,
primary key(id)
);
CREATE TABLE ir_act_window (
view_id integer,
res_model varchar(64),
view_type varchar(16),
"domain" varchar(127),
primary key(id)
)
INHERITS (ir_actions);
CREATE TABLE ir_act_report_xml (
model varchar(64) NOT NULL,
report_name varchar(64) NOT NULL,
report_xsl varchar(64),
report_xml varchar(64),
auto boolean default true
)
INHERITS (ir_actions);
create table ir_act_report_custom (
report_id int
-- report_id int references ir_report_custom
)
INHERITS (ir_actions);
CREATE TABLE ir_act_group (
exec_type varchar(64) DEFAULT 'serial'::varchar NOT NULL
)
INHERITS (ir_actions);
CREATE TABLE ir_act_group_link (
aid integer NOT NULL,
gid integer NOT NULL
);
CREATE TABLE ir_act_execute (
func_name varchar(64) NOT NULL,
func_arg varchar(64)
)
INHERITS (ir_actions);
CREATE TABLE ir_act_wizard (
wiz_name varchar(64) NOT NULL
)
INHERITS (ir_actions);
CREATE TABLE ir_ui_view (
id serial NOT NULL,
perm_id int references perm on delete set null,
name varchar(64) DEFAULT ''::varchar NOT NULL,
model varchar(64) DEFAULT ''::varchar NOT NULL,
"type" varchar(64) DEFAULT 'form'::varchar NOT NULL,
arch text NOT NULL,
field_parent varchar(64),
priority integer DEFAULT 5 NOT NULL,
primary key(id),
CONSTRAINT ir_ui_view_type CHECK (((("type")::text = ('form'::varchar)::text) OR (("type")::text = ('tree'::varchar)::text)))
);
CREATE TABLE ir_ui_menu (
id serial NOT NULL,
perm_id int references perm on delete set null,
parent_id int references ir_ui_menu on delete set null,
name varchar(64) DEFAULT ''::varchar NOT NULL,
icon varchar(64) DEFAULT ''::varchar,
primary key (id)
);
select setval('ir_ui_menu_id_seq', 2);
---------------------------------
-- Res users
---------------------------------
-- level:
-- 0 RESTRICT TO USER
-- 1 RESTRICT TO GROUP
-- 2 PUBLIC
CREATE TABLE res_users (
id serial NOT NULL,
perm_id int references perm on delete set null,
name varchar(64) not null,
active boolean default True,
login varchar(64) NOT NULL UNIQUE,
password varchar(32) default null,
perm_default int references perm on delete set null,
-- action_id int references ir_act_window on delete set null,
action_id int,
primary key(id)
);
alter table res_users add constraint res_users_login_uniq unique (login);
insert into res_users (id,login,password,name,action_id,perm_id,active) values (1,'root',NULL,'Administrator',NULL,1,False);
select setval('res_users_id_seq', 2);
CREATE TABLE res_groups (
id serial NOT NULL,
perm_id int references perm on delete set null,
name varchar(32) NOT NULL,
primary key(id)
);
create table res_roles (
id serial NOT NULL,
perm_id int references perm on delete set null,
parent_id int references res_roles on delete set null,
name varchar(32) NOT NULL,
primary key(id)
);
CREATE TABLE res_roles_users_rel (
uid integer NOT NULL references res_users on delete cascade,
rid integer NOT NULL references res_roles on delete cascade
);
CREATE TABLE res_groups_users_rel (
uid integer NOT NULL references res_users on delete cascade,
gid integer NOT NULL references res_groups on delete cascade
);
---------------------------------
-- Workflows
---------------------------------
create table wkf
(
id serial,
perm_id int references perm on delete set null,
name varchar(64),
osv varchar(64),
on_create bool default False,
primary key(id)
);
create table wkf_activity
(
id serial,
perm_id int references perm on delete set null,
wkf_id int references wkf on delete cascade,
subflow_id int references wkf on delete set null,
split_mode varchar(3) default 'XOR',
join_mode varchar(3) default 'XOR',
kind varchar(16) not null default 'dummy',
name varchar(64),
signal_send varchar(32) default null,
flow_start boolean default False,
flow_stop boolean default False,
action varchar(64) default null,
primary key(id)
);
create table wkf_transition
(
id serial,
perm_id int references perm on delete set null,
act_from int references wkf_activity on delete cascade,
act_to int references wkf_activity on delete cascade,
condition varchar(128) default NULL,
trigger_type varchar(128) default NULL,
trigger_expr_id varchar(128) default NULL,
signal varchar(64) default null,
role_id int references res_roles on delete set null,
primary key(id)
);
create table wkf_instance
(
id serial,
wkf_id int references wkf on delete set null,
uid int default null,
res_id int not null,
res_type varchar(64) not null,
state varchar(32) not null default 'active',
primary key(id)
);
create table wkf_workitem
(
id serial,
act_id int not null references wkf_activity on delete cascade,
inst_id int not null references wkf_instance on delete cascade,
subflow_id int references wkf_instance on delete cascade,
state varchar(64) default 'blocked',
primary key(id)
);
create table wkf_witm_trans
(
trans_id int not null references wkf_transition on delete cascade,
inst_id int not null references wkf_instance on delete cascade
);
create table wkf_logs
(
id serial,
res_type varchar(128) not null,
res_id int not null,
uid int references res_users on delete set null,
act_id int references wkf_activity on delete set null,
time time not null,
info varchar(128) default NULL,
primary key(id)
);
---------------------------------
-- Modules
---------------------------------
CREATE TABLE ir_module_category (
id serial NOT NULL,
perm_id integer,
create_uid integer references res_users on delete set null,
create_date timestamp without time zone,
write_date timestamp without time zone,
write_uid integer references res_users on delete set null,
parent_id integer REFERENCES ir_module_category ON DELETE SET NULL,
name character varying(128) NOT NULL,
primary key(id)
);
CREATE TABLE ir_module_module (
id serial NOT NULL,
perm_id integer,
create_uid integer references res_users on delete set null,
create_date timestamp without time zone,
write_date timestamp without time zone,
write_uid integer references res_users on delete set null,
website character varying(256),
name character varying(128) NOT NULL,
author character varying(128),
url character varying(128),
state character varying(16),
latest_version character varying(64),
shortdesc character varying(256),
category_id integer REFERENCES ir_module_category ON DELETE SET NULL,
description text,
demo boolean default False,
primary key(id)
);
CREATE TABLE ir_module_module_dependency (
id serial NOT NULL,
perm_id integer,
create_uid integer references res_users on delete set null,
create_date timestamp without time zone,
write_date timestamp without time zone,
write_uid integer references res_users on delete set null,
name character varying(128),
version_pattern character varying(128) default NULL,
module_id integer REFERENCES ir_module_module ON DELETE cascade,
primary key(id)
);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,274 @@
<?xml version="1.0"?>
<terp>
<data noupdate="1">
<record model="res.users" id="user_demo">
<field name="login">demo</field>
<field name="password">demo</field>
<field name="name">Demo User</field>
<field name="signature">Fabien Pinckaers</field>
<field name="action_id" ref="action_menu_admin"/>
<field name="address_id" ref="main_address"/>
<field name="company_id" ref="main_company"/>
</record>
<record model="res.currency" id="USD">
<field name="name">USD</field>
<field name="rate">0.8400</field>
<field name="rounding">2</field>
<field name="accuracy">4</field>
</record>
<!-- USA States -->
<record model="res.country.state" id="us-al">
<field name="name">Alabama</field>
<field name="code">al</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ak">
<field name="name">Alaska</field>
<field name="code">ak</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-az">
<field name="name">Arizona</field>
<field name="code">az</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ar">
<field name="name">Arkansas</field>
<field name="code">ar</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ca">
<field name="name">California</field>
<field name="code">ca</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-co">
<field name="name">Colorado</field>
<field name="code">co</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ct">
<field name="name">Connecticut</field>
<field name="code">ct</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-de">
<field name="name">Delaware</field>
<field name="code">de</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-fl">
<field name="name">Florida</field>
<field name="code">fl</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ga">
<field name="name">Georgia</field>
<field name="code">ga</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-hi">
<field name="name">Hawaii</field>
<field name="code">hi</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-id">
<field name="name">Idaho</field>
<field name="code">id</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-il">
<field name="name">Illinois</field>
<field name="code">il</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-in">
<field name="name">Indiana</field>
<field name="code">in</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ia">
<field name="name">Iowa</field>
<field name="code">ia</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ks">
<field name="name">Kansas</field>
<field name="code">ks</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ky">
<field name="name">Kentuky</field>
<field name="code">ky</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-la">
<field name="name">Louisiana</field>
<field name="code">la</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-me">
<field name="name">Maine</field>
<field name="code">me</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-md">
<field name="name">Maryland</field>
<field name="code">md</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ma">
<field name="name">Massachusetts</field>
<field name="code">ma</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-mi">
<field name="name">Michigan</field>
<field name="code">mi</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-mn">
<field name="name">Minnesota</field>
<field name="code">mn</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ms">
<field name="name">Mississippi</field>
<field name="code">ms</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-mo">
<field name="name">Missouri</field>
<field name="code">mo</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-mt">
<field name="name">Montana</field>
<field name="code">mt</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ne">
<field name="name">Nebraska</field>
<field name="code">ne</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nv">
<field name="name">Nevada</field>
<field name="code">nv</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nh">
<field name="name">New Hampshire</field>
<field name="code">nh</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nj">
<field name="name">New Jersey</field>
<field name="code">nj</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nm">
<field name="name">New Mexico</field>
<field name="code">nm</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ny">
<field name="name">New York</field>
<field name="code">ny</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nc">
<field name="name">North Carolina</field>
<field name="code">nc</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-nd">
<field name="name">New Dakota</field>
<field name="code">nd</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-oh">
<field name="name">Ohio</field>
<field name="code">oh</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ok">
<field name="name">Oklahoma</field>
<field name="code">ok</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-or">
<field name="name">Oregon</field>
<field name="code">or</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-pa">
<field name="name">Pennsylviania</field>
<field name="code">pa</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ri">
<field name="name">Rhode Island</field>
<field name="code">ri</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-sc">
<field name="name">South Carolina</field>
<field name="code">sc</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-sd">
<field name="name">South Dakota</field>
<field name="code">sd</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-tn">
<field name="name">Tennessee</field>
<field name="code">tn</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-tx">
<field name="name">Texas</field>
<field name="code">tx</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-ut">
<field name="name">Utah</field>
<field name="code">ut</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-vt">
<field name="name">Vermont</field>
<field name="code">vt</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-va">
<field name="name">Virgnia</field>
<field name="code">va</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-wa">
<field name="name">Washington</field>
<field name="code">wa</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-wv">
<field name="name">West Virgnia</field>
<field name="code">wv</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-wi">
<field name="name">Wisconsin</field>
<field name="code">wi</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
<record model="res.country.state" id="us-wy">
<field name="name">Wyoming</field>
<field name="code">wy</field>
<field name="country_id" model="res.country" ref="us"/>
</record>
</data>
</terp>

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<terp>
<data>
<!-- <menuitem name="Tools" sequence="15" groups="admin" icon="terp-tools"/> -->
<menuitem name="Administration" sequence="20" groups="admin" icon="terp-administration"/>
# Admin config
<menuitem name="Administration/Configuration/Base" sequence="1"/>
<record model="ir.actions.act_window" id="open_module_tree_company">
<field name="name">res.company</field>
<field name="res_model">res.company</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Administration/Configuration/Base/Define Main Company" action="open_module_tree_company" sequence="2" id="menu_company_def"/>
</data>
</terp>

View File

@ -0,0 +1,169 @@
<?xml version="1.0"?>
<terp>
<data>
<!--
======================
Languages
======================
-->
<record model="ir.ui.view" id="view_lang">
<field name="name">Languages</field>
<field name="model">res.lang</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Language">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="translatable"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_lang">
<field name="name">res.lang</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.lang</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Interface/Languages" action="action_lang"/>
<ir_set>
<field name="key" eval="'meta'"/>
<field name="key2" eval="'lang'"/>
<field name="models" eval="['res.users']"/>
<field name="name">lang</field>
<field name="value" eval="False"/>
<field name="meta" eval="{'type':'selection', 'string':'Language', 'selection':[(False,'en')]}"/>
<field name="replace" eval="True"/>
</ir_set>
<!--
======================
Groups
======================
-->
<record model="ir.ui.view" id="view_groups_form">
<field name="name">res.groups.form</field>
<field name="model">res.groups</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Groups">
<field name="name" colspan="3" select="1"/>
</form>
</field>
</record>
<!--
======================
Users
======================
-->
<record model="ir.ui.view" id="view_users_form_simple_modif">
<field name="name">res.users.form.modif</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<form string="Users">
<field name="name" colspan="3" select="1"/>
<field name="login" readonly="1" select="1"/>
<field name="password"/>
<label string="Please note that you will have to logout and relog if you change your password." colspan="4"/>
<newline/>
<field name="signature" colspan="3"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_users_form_simple">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Users">
<field name="name" readonly="1" colspan="3" select="1"/>
<field name="login" readonly="1" select="1"/>
<newline/>
<field name="signature" readonly="1" colspan="3"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_users_form">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Users">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="login" select="1"/>
<field name="password"/>
<field name="signature"/>
<field name="address_id"/>
<field name="company_id" required="1"/>
<field name="action_id" domain="[('usage','=','menu')]" required="True"/>
<newline/>
<field name="groups_id"/>
<field name="roles_id"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_users_tree">
<field name="name">res.users.tree</field>
<field name="model">res.users</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Users">
<field name="name"/>
<field name="login"/>
</tree>
</field>
</record>
<!--
======================
Company
======================
-->
<record model="ir.ui.view" id="view_company_form">
<field name="name">res.company.form</field>
<field name="model">res.company</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Company">
<field name="name" colspan="3" select="1"/>
<field name="partner_id" select="1"/>
<field name="parent_id" select="1"/>
<field name="rml_header1"/>
<field name="rml_footer1"/>
<field name="rml_footer2"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_company_tree">
<field name="name">res.company.tree</field>
<field name="model">res.company</field>
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree string="Companies">
<field name="name"/>
<field name="partner_id"/>
</tree>
</field>
</record>
# Admin config
<menuitem name="Administration/Configuration/User" sequence="4"/>
<record model="ir.actions.act_window" id="open_module_users_list">
<field name="name">res.users.list</field>
<field name="res_model">res.users</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="base.view_users_tree"/>
</record>
<menuitem name="Administration/Configuration/User/Define Users" action="open_module_users_list" sequence="1" id="menu_users_list"/>
</data>
</terp>

View File

@ -0,0 +1,41 @@
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import ir_sequence
import ir_ui_menu
import ir_ui_view
import ir_actions
import ir_default
import ir_model
import ir_report_custom
import ir_attachment
import ir_cron
import ir_values
import ir_translation
import ir_exports
import workflow

654
bin/addons/base/ir/ir.xml Normal file
View File

@ -0,0 +1,654 @@
<?xml version="1.0"?>
<terp>
<data>
==========================================================
Sequences
==========================================================
<record model="ir.ui.view" id="sequence_view">
<field name="name">ir.sequence.form</field>
<field name="model">ir.sequence</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sequences">
<separator string="Configuration" colspan="4"/>
<field name="name" colspan="3" select="1"/>
<field name="code" select="1"/>
<field name="active" select="1"/>
<field name="prefix"/>
<field name="suffix"/>
<field name="padding" />
<field name="number_increment"/>
<field name="number_next"/>
<separator string="Legend (for prefix, suffix)" colspan="4"/>
<label string="Year: %%(year)s" colspan="4"/>
<label string="Month: %%(month)s" colspan="4"/>
<label string="Day: %%(day)s" colspan="4"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="ir_sequence_form">
<field name="name">ir.sequence</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.sequence</field>
<field name="view_type">form</field>
<field name="view_id" ref="sequence_view"/>
</record>
<menuitem name="Administration/Custom/Sequences/Sequences" action="ir_sequence_form"/>
==========================================================
Sequences Types
==========================================================
<record model="ir.ui.view" id="sequence_type_form_view">
<field name="name">ir.sequence.type.form</field>
<field name="model">ir.sequence.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sequence Type">
<field name="name" select="1"/>
<field name="code" readonly="1"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="ir_sequence_type">
<field name="name">ir.sequence.type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.sequence.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
</record>
<menuitem name="Administration/Custom/Sequences/Sequence Types" action="ir_sequence_type"/>
==========================================================
Actions
==========================================================
<record model="ir.actions.act_window" id="ir_sequence_actions">
<field name="name">ir.actions.actions</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.actions</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Actions" action="ir_sequence_actions"/>
<record model="ir.actions.act_window" id="ir_action_execute">
<field name="name">ir.actions.execute</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.execute</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Execute" action="ir_action_execute"/>
<record model="ir.actions.act_window" id="ir_action_group">
<field name="name">ir.actions.group</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.group</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Group" action="ir_action_group"/>
<record model="ir.actions.act_window" id="ir_action_report_custom">
<field name="name">ir.actions.report.custom</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.report.custom</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Report Custom" action="ir_action_report_custom"/>
<record model="ir.actions.act_window" id="ir_action_report_xml">
<field name="name">ir.actions.report.xml</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.report.xml</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Report Xml" action="ir_action_report_xml"/>
<record model="ir.ui.view" id="view_window_action_tree">
<field name="name">ir.actions.windows.tree</field>
<field name="model">ir.actions.act_window</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Window Action">
<field name="name"/>
<field name="res_model"/>
<field name="view_type"/>
<field name="view_id"/>
<field name="domain"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_window_action_form">
<field name="name">ir.actions.windows.form</field>
<field name="model">ir.actions.act_window</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Open a Window">
<field name="name" colspan="3" select="1"/>
<field name="type" readonly="1"/>
<field name="view_id"/>
<field name="res_model"/>
<field name="view_type"/>
<field name="domain" colspan="3"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="ir_action_window">
<field name="name">ir.actions.act_window</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_window_action_form"/>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Open Window" action="ir_action_window"/>
<record model="ir.actions.act_window" id="ir_action_wizard">
<field name="name">ir.actions.wizard</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.wizard</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Wizard" action="ir_action_wizard"/>
==========================================================
Companies
==========================================================
<record model="ir.actions.act_window" id="action_res_company_tree">
<field name="name">res.company</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_type">tree</field>
</record>
<menuitem name="Administration/Users/Company Structure" action="action_res_company_tree"/>
<record model="ir.actions.act_window" id="action_res_company_form">
<field name="name">res.groups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Users/Company Structure/Define Companies" action="action_res_company_form"/>
==========================================================
User Roles
==========================================================
<record model="ir.actions.act_window" id="action_res_users">
<field name="name">res.users</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_users_form"/>
</record>
<menuitem name="Administration/Users/Users" action="action_res_users"/>
<record model="ir.actions.act_window" id="action_res_users_my">
<field name="name">res.users</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('id','=',uid)]</field>
<field name="view_id" ref="view_users_form_simple_modif"/>
</record>
<menuitem name="Administration/Users/Users/My password" action="action_res_users_my"/>
<record model="ir.actions.act_window" id="action_res_groups">
<field name="name">res.groups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.groups</field>
<field name="view_type">form</field>
</record>
<menuitem name="Administration/Users/Groups" action="action_res_groups"/>
<record model="ir.ui.view" id="view_roles_form">
<field name="name">res.roles.form</field>
<field name="model">res.roles</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Role">
<field name="name" colspan="3" select="1"/>
<field name="parent_id" colspan="3"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_roles_tree">
<field name="name">res.roles.tree</field>
<field