[MERGE] Merged from the main trunk server branch.

bzr revid: ach@tinyerp.com-20100520050727-zdkp6mp65kmfm66o
This commit is contained in:
Anup (OpenERP) 2010-05-20 10:37:27 +05:30
commit 67277f6f3d
26 changed files with 305 additions and 153 deletions

View File

@ -644,16 +644,13 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
try:
_load_data(cr, module_name, id_map, mode, 'test')
except Exception, e:
if tools.config.options['test-continue']:
logger.notifyChannel('ERROR', netsvc.LOG_TEST, e)
pass
else:
raise
logger.notifyChannel('ERROR', netsvc.LOG_TEST, e)
pass
finally:
if tools.config.options['test-rollback']:
cr.rollback()
else:
if tools.config.options['test-commit']:
cr.commit()
else:
cr.rollback()
def _load_data(cr, module_name, id_map, mode, kind):
noupdate = (kind == 'demo')

View File

@ -49,6 +49,7 @@
'module/module_report.xml',
'res/res_request_view.xml',
'res/res_lang_view.xml',
'res/res_log_view.xml',
'res/res_company_view.xml',
'res/partner/partner_report.xml',
'res/partner/partner_view.xml',

View File

@ -118,7 +118,7 @@
<separator string="Signature" colspan="2"/>
<field colspan="2" name="signature" nolabel="1"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" expand="1">
<separator string="Access Rights (groups)" colspan="2"/>
<field colspan="2" nolabel="1" name="groups_id"/>
</group>

View File

@ -1,52 +1,52 @@
"country_id:id","name","code"
us,"Alabama","AL"
us,"Alaska","AK"
us,"Arizona","AZ"
us,"Arkansas","AR"
us,"California","CA"
us,"Colorado","CO"
us,"Connecticut","CT"
us,"Delaware","DE"
us,"District of Columbia","DC"
us,"Florida","FL"
us,"Georgia","GA"
us,"Hawaii","HI"
us,"Idaho","ID"
us,"Illinois","IL"
us,"Indiana","IN"
us,"Iowa","IA"
us,"Kansas","KS"
us,"Kentucky","KY"
us,"Louisiana","LA"
us,"Maine","ME"
us,"Montana","MT"
us,"Nebraska","NE"
us,"Nevada","NV"
us,"New Hampshire","NH"
us,"New Jersey","NJ"
us,"New Mexico","NM"
us,"New York","NY"
us,"North Carolina","NC"
us,"North Dakota","ND"
us,"Ohio","OH"
us,"Oklahoma","OK"
us,"Oregon","OR"
us,"Maryland","MD"
us,"Massachusetts","MA"
us,"Michigan","MI"
us,"Minnesota","MN"
us,"Mississippi","MS"
us,"Missouri","MO"
us,"Pennsylvania","PA"
us,"Rhode Island","RI"
us,"South Carolina","SC"
us,"South Dakota","SD"
us,"Tennessee","TN"
us,"Texas","TX"
us,"Utah","UT"
us,"Vermont","VT"
us,"Virginia","VA"
us,"Washington","WA"
us,"West Virginia","WV"
us,"Wisconsin","WI"
us,"Wyoming","WY"
"id","country_id:id","name","code"
state_us_1,us,"Alabama","AL"
state_us_2,us,"Alaska","AK"
state_us_3,us,"Arizona","AZ"
state_us_4,us,"Arkansas","AR"
state_us_5,us,"California","CA"
state_us_6,us,"Colorado","CO"
state_us_7,us,"Connecticut","CT"
state_us_8,us,"Delaware","DE"
state_us_9,us,"District of Columbia","DC"
state_us_10,us,"Florida","FL"
state_us_11,us,"Georgia","GA"
state_us_12,us,"Hawaii","HI"
state_us_13,us,"Idaho","ID"
state_us_14,us,"Illinois","IL"
state_us_15,us,"Indiana","IN"
state_us_16,us,"Iowa","IA"
state_us_17,us,"Kansas","KS"
state_us_18,us,"Kentucky","KY"
state_us_19,us,"Louisiana","LA"
state_us_20,us,"Maine","ME"
state_us_21,us,"Montana","MT"
state_us_22,us,"Nebraska","NE"
state_us_23,us,"Nevada","NV"
state_us_24,us,"New Hampshire","NH"
state_us_25,us,"New Jersey","NJ"
state_us_26,us,"New Mexico","NM"
state_us_27,us,"New York","NY"
state_us_28,us,"North Carolina","NC"
state_us_29,us,"North Dakota","ND"
state_us_30,us,"Ohio","OH"
state_us_31,us,"Oklahoma","OK"
state_us_32,us,"Oregon","OR"
state_us_33,us,"Maryland","MD"
state_us_34,us,"Massachusetts","MA"
state_us_35,us,"Michigan","MI"
state_us_36,us,"Minnesota","MN"
state_us_37,us,"Mississippi","MS"
state_us_38,us,"Missouri","MO"
state_us_39,us,"Pennsylvania","PA"
state_us_40,us,"Rhode Island","RI"
state_us_41,us,"South Carolina","SC"
state_us_42,us,"South Dakota","SD"
state_us_43,us,"Tennessee","TN"
state_us_44,us,"Texas","TX"
state_us_45,us,"Utah","UT"
state_us_46,us,"Vermont","VT"
state_us_47,us,"Virginia","VA"
state_us_48,us,"Washington","WA"
state_us_49,us,"West Virginia","WV"
state_us_50,us,"Wisconsin","WI"
state_us_51,us,"Wyoming","WY"

1 id country_id:id name code
2 state_us_1 us Alabama AL
3 state_us_2 us Alaska AK
4 state_us_3 us Arizona AZ
5 state_us_4 us Arkansas AR
6 state_us_5 us California CA
7 state_us_6 us Colorado CO
8 state_us_7 us Connecticut CT
9 state_us_8 us Delaware DE
10 state_us_9 us District of Columbia DC
11 state_us_10 us Florida FL
12 state_us_11 us Georgia GA
13 state_us_12 us Hawaii HI
14 state_us_13 us Idaho ID
15 state_us_14 us Illinois IL
16 state_us_15 us Indiana IN
17 state_us_16 us Iowa IA
18 state_us_17 us Kansas KS
19 state_us_18 us Kentucky KY
20 state_us_19 us Louisiana LA
21 state_us_20 us Maine ME
22 state_us_21 us Montana MT
23 state_us_22 us Nebraska NE
24 state_us_23 us Nevada NV
25 state_us_24 us New Hampshire NH
26 state_us_25 us New Jersey NJ
27 state_us_26 us New Mexico NM
28 state_us_27 us New York NY
29 state_us_28 us North Carolina NC
30 state_us_29 us North Dakota ND
31 state_us_30 us Ohio OH
32 state_us_31 us Oklahoma OK
33 state_us_32 us Oregon OR
34 state_us_33 us Maryland MD
35 state_us_34 us Massachusetts MA
36 state_us_35 us Michigan MI
37 state_us_36 us Minnesota MN
38 state_us_37 us Mississippi MS
39 state_us_38 us Missouri MO
40 state_us_39 us Pennsylvania PA
41 state_us_40 us Rhode Island RI
42 state_us_41 us South Carolina SC
43 state_us_42 us South Dakota SD
44 state_us_43 us Tennessee TN
45 state_us_44 us Texas TX
46 state_us_45 us Utah UT
47 state_us_46 us Vermont VT
48 state_us_47 us Virginia VA
49 state_us_48 us Washington WA
50 state_us_49 us West Virginia WV
51 state_us_50 us Wisconsin WI
52 state_us_51 us Wyoming WY

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-05-17 05:29+0000\n"
"PO-Revision-Date: 2010-05-18 08:05+0000\n"
"Last-Translator: goranc <goranc@gmail.com>\n"
"Language-Team: openerp-translators\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-18 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-server\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-05-17 05:28+0000\n"
"PO-Revision-Date: 2010-05-18 08:03+0000\n"
"Last-Translator: Harry (Open ERP) <hmo@tinyerp.com>\n"
"Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-18 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:10+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-01-04 06:03+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-18 09:58+0000\n"
"Last-Translator: sraps (KN dati) <Unknown>\n"
"Language-Team: Latvian <lv@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 03:51+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base
@ -176,7 +176,7 @@ msgstr "ir.report.custom.fields"
#. module: base
#: view:res.partner:0
msgid "Search Partner"
msgstr ""
msgstr "Meklēt Partneri"
#. module: base
#: code:addons/base/module/wizard/wizard_export_lang.py:0
@ -419,7 +419,7 @@ msgstr "Kolumbija"
#. module: base
#: view:ir.module.module:0
msgid "Schedule Upgrade"
msgstr ""
msgstr "Ieplānot Jauninājumus"
#. module: base
#: field:ir.actions.report.custom,report_id:0
@ -593,7 +593,7 @@ msgstr ","
#. module: base
#: view:res.partner:0
msgid "My Partners"
msgstr ""
msgstr "Mani Partneri"
#. module: base
#: model:res.country,name:base.es
@ -745,7 +745,7 @@ msgstr "Irāna"
#: model:ir.actions.act_window,name:base.res_request-act
#: model:ir.ui.menu,name:base.menu_res_request_act
msgid "My Requests"
msgstr ""
msgstr "Mani Pieprasījumi"
#. module: base
#: field:ir.sequence,name:0
@ -1009,7 +1009,7 @@ msgstr "STOCK_COPY"
#: code:addons/base/ir/ir_model.py:0
#, python-format
msgid "Model %s Does not Exist !"
msgstr ""
msgstr "Modelis %s neeksistē !"
#. module: base
#: code:addons/base/module/module.py:0
@ -1137,7 +1137,7 @@ msgstr "Lietotāja Atskaite"
#: code:addons/base/res/res_user.py:0
#, python-format
msgid " (copy)"
msgstr ""
msgstr " (kopija)"
#. module: base
#: view:ir.sequence:0
@ -1303,7 +1303,7 @@ msgstr "Copy text \t STOCK_PROPERTIES"
#. module: base
#: view:res.partner.address:0
msgid "Search Contact"
msgstr ""
msgstr "Meklēt Kontaktu"
#. module: base
#: view:ir.module.module:0
@ -1484,7 +1484,7 @@ msgstr "Esošā Likme"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "Greek / Ελληνικά"
msgstr ""
msgstr "Grieķu / Ελληνικά"
#. module: base
#: view:ir.values:0
@ -1565,7 +1565,7 @@ msgstr "Epasta Adrese"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "French (BE) / Français (BE)"
msgstr ""
msgstr "Franču (BE) / Français (BE)"
#. module: base
#: code:addons/base/ir/ir_model.py:0
@ -1603,7 +1603,7 @@ msgstr "Lauka Sasaistes"
#: model:ir.actions.act_window,name:base.res_request-closed
#: model:ir.ui.menu,name:base.next_id_12_close
msgid "My Closed Requests"
msgstr ""
msgstr "Mani Slēgie Pieprasījumi"
#. module: base
#: model:ir.ui.menu,name:base.menu_custom
@ -1861,7 +1861,7 @@ msgstr "Pieejas Kontrole"
#: view:ir.module.module:0
#: field:ir.module.module,dependencies_id:0
msgid "Dependencies"
msgstr "Atkarīgie objekti"
msgstr "Atkarīgs no"
#. module: base
#: field:ir.report.custom.fields,bgcolor:0
@ -1988,7 +1988,7 @@ msgstr "Modulis"
#: model:ir.actions.act_window,name:base.action_res_bank_form
#: model:ir.ui.menu,name:base.menu_action_res_bank_form
msgid "Bank List"
msgstr ""
msgstr "Banku Saraksts"
#. module: base
#: field:ir.attachment,description:0
@ -2401,7 +2401,7 @@ msgstr ""
#: model:ir.actions.act_window,name:base.action_partner_customer_form
#: view:res.partner:0
msgid "Customers"
msgstr ""
msgstr "Klienti"
#. module: base
#: model:res.country,name:base.au
@ -2603,7 +2603,7 @@ msgstr "STOCK_SAVE_AS"
#. module: base
#: selection:ir.translation,type:0
msgid "SQL Constraint"
msgstr ""
msgstr "SQL Ierobežojums"
#. module: base
#: field:ir.actions.server,srcmodel_id:0
@ -2669,7 +2669,7 @@ msgstr "%c - Atbilstošais datuma un laika attēlojums."
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "Finland / Suomi"
msgstr ""
msgstr "Somu / Suomi"
#. module: base
#: model:res.country,name:base.bo
@ -2931,7 +2931,7 @@ msgstr "Likmes"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "Albanian / Shqipëri"
msgstr ""
msgstr "Albāņu / Shqipëri"
#. module: base
#: model:res.country,name:base.sy
@ -3192,7 +3192,7 @@ msgstr "Demo dati"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "English (UK)"
msgstr ""
msgstr "Angļu (UK)"
#. module: base
#: model:res.country,name:base.aq
@ -3217,7 +3217,7 @@ msgstr "Tīmeklis"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "English (CA)"
msgstr ""
msgstr "Angļu (CA)"
#. module: base
#: field:res.partner.event,planned_revenue:0
@ -3460,7 +3460,7 @@ msgstr "Partnera Adreses"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "Indonesian / Bahasa Indonesia"
msgstr ""
msgstr "Indonēziešu / Bahasa Indonesia"
#. module: base
#: model:res.country,name:base.cv
@ -3625,7 +3625,7 @@ msgstr "Izveidot darbību"
#. module: base
#: selection:ir.actions.report.xml,report_type:0
msgid "HTML from HTML"
msgstr ""
msgstr "HTML no HTML"
#. module: base
#: selection:ir.actions.report.xml,report_type:0
@ -4086,7 +4086,7 @@ msgstr "Faila Formāts"
#. module: base
#: field:res.lang,iso_code:0
msgid "ISO code"
msgstr ""
msgstr "ISO kods"
#. module: base
#: model:ir.model,name:base.model_res_config_view
@ -4222,7 +4222,7 @@ msgstr "Izmainīt manus Uzstādījumus"
#. module: base
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Procesa definīcijā nepareizs modeļa nosaukums."
#. module: base
#: wizard_field:res.partner.sms_send,init,text:0
@ -4344,7 +4344,7 @@ msgstr "Objekta Lauks"
#. module: base
#: selection:module.lang.install,init,lang:0
msgid "French (CH) / Français (CH)"
msgstr ""
msgstr "Franču (CH) / Français (CH)"
#. module: base
#: selection:ir.ui.menu,icon:0
@ -4418,7 +4418,7 @@ msgstr "Atcelt atinstalāciju"
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Communication"
msgstr ""
msgstr "Saziņa"
#. module: base
#: model:ir.model,name:base.model_ir_server_object_lines
@ -6981,7 +6981,7 @@ msgstr "(year)="
#. module: base
#: rml:ir.module.reference:0
msgid "Dependencies :"
msgstr "Atkarīgie objekti:"
msgstr "Atkarīgs no:"
#. module: base
#: selection:ir.ui.menu,icon:0

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-05-17 05:27+0000\n"
"PO-Revision-Date: 2010-05-18 08:01+0000\n"
"Last-Translator: Anders Wallenquist <anders.wallenquist@vertel.se>\n"
"Language-Team: <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-18 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-05-17 05:31+0000\n"
"PO-Revision-Date: 2010-05-18 08:07+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-18 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
"PO-Revision-Date: 2010-05-17 05:28+0000\n"
"PO-Revision-Date: 2010-05-18 08:05+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-18 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base

View File

@ -31,8 +31,6 @@ import res_company
import res_user
import res_request
import res_lang
import res_log
import ir_property
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -377,7 +377,7 @@
<record id="res_partner_asustek_request" model="res.request">
<field name="name">ASUSTEK-Subject</field>
<field name="act_to" ref="user_demo"/>
<field name="ref_doc1">res.partner,2</field>
<field name="ref_doc1" ref="res_partner_asus"/>
</record>
</data>
</openerp>

View File

@ -347,24 +347,27 @@
<field name="arch" type="xml">
<search string="Search Partner">
<group col='10' colspan='4'>
<filter string="My Partners" icon="terp-partner" domain="[('user_id','=',uid)]"/>
<separator orientation="vertical"/>
<filter string="Customers" icon="terp-partner" domain="[('customer','=',1)]" help="Customer Partners"/>
<filter string="Suppliers" icon="terp-partner" domain="[('supplier','=',1)]" help="Supplier Partners"/>
<filter string="Employees" icon="terp-partner" domain="[('employee','=',1)]" help="Employee Partners"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="address" select="1"/>
<field name="country" select="1"/>
<field name="category_id" select="1"/>
<field name="user_id" select="1"/>
<field name="user_id" select="1">
<filter string="My Partners" icon="terp-partner" domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline />
<group expand="0" string="Group By..." colspan="16">
<filter string="Salesman" icon="terp-crm" domain="[]" context="{'group_by' : 'user_id'}" />
</group>
</search>
</field>
</record>
<record id="action_partner_form" model="ir.actions.act_window">
<field name="name">Partners</field>
<field name="name">Customers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
@ -639,7 +642,7 @@
/>
<record id="ir_ui_view_sc_partner0" model="ir.ui.view_sc">
<field name="name">Partner</field>
<field name="name">Address Book</field>
<field name="resource">ir.ui.menu</field>
<field name="user_id" ref="base.user_root"/>
<field name="res_id" ref="menu_partner_form"/>

View File

@ -24,7 +24,6 @@ from osv import fields
import os
import tools
from tools.translate import _
import base64
class multi_company_default(osv.osv):
"""
@ -181,8 +180,9 @@ class res_company(osv.osv):
return True
def _get_logo(self, cr, uid, ids):
file_data = open('../pixmaps/openerp-header.png','rb').read()
return base64.encodestring(file_data)
return open(os.path.join(
tools.config['root_path'], '..', 'pixmaps', 'openerp-header.png'),
'rb') .read().encode('base64')
def _get_header2(self,cr,uid,ids):

View File

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 res_log(osv.osv_memory):
_name = 'res.log'
_columns = {
'name': fields.char('Message', size=128, help='The logging message.', required=True),
'user_id': fields.many2one('res.users','User', required=True),
'res_model': fields.char('Object', size=128),
'res_id': fields.integer('Object ID'),
'secondary': fields.boolean('Secondary Log', help='Do not display this log if it belongs to the same object the user is working on')
}
_defaults = {
'user_id': lambda self,cr,uid,ctx: uid
}
_order='id desc'
# TODO: do not return secondary log if same object than in the model (but unlink it)
def get(self, cr, uid, context={}):
ids = self.search(cr, uid, [('user_id','=',uid)], context=context)
result = self.read(cr, uid, ids, ['name','res_model','res_id'], context=context)
self.unlink(cr, uid, ids, context=context)
return result
res_log()

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="res_log_search" model="ir.ui.view">
<field name="name">res.log.search</field>
<field name="model">res.log</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Logs">
<filter icon="terp-sale" string="My Logs" domain="[('user_id','=',uid)]" name="my"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id"/>
<field name="res_model"/>
</search>
</field>
</record>
<record id="res_log_tree" model="ir.ui.view">
<field name="name">res.log.tree</field>
<field name="model">res.log</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Logs">
<field name="name"/>
<field name="user_id"/>
</tree>
</field>
</record>
<record id="res_log_form" model="ir.ui.view">
<field name="name">res.log.form</field>
<field name="model">res.log</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Logs">
<group colspan="4" col="6">
<field name="name" colspan="4"/>
<field name="user_id" />
<field name="res_model"/>
<field name="res_id"/>
</group>
</form>
</field>
</record>
<record id="res_log_act_window" model="ir.actions.act_window">
<field name="name">Logs</field>
<field name="res_model">res.log</field>
<field name="view_type">form</field>
<field name="context">{'search_default_my': 1}</field>
</record>
<menuitem
action="res_log_act_window"
id="menu_res_log_act_window"
parent="base.next_id_4"/>
</data>
</openerp>

View File

@ -24,9 +24,11 @@
#
##############################################################################
import errno
import logging
import logging.handlers
import os
import socket
import sys
import threading
import time
@ -358,6 +360,21 @@ class Server:
res.extend(srv.stats() for srv in cls.__servers)
return '\n'.join(res)
def _close_socket(self):
if os.name != 'nt':
try:
self.socket.shutdown(getattr(socket, 'SHUT_RDWR', 2))
except socket.error, e:
if e.errno != errno.ENOTCONN: raise
# OSX, socket shutdowns both sides if any side closes it
# causing an error 57 'Socket is not connected' on shutdown
# of the other side (or something), see
# http://bugs.python.org/issue4397
self.__logger.debug(
'"%s" when shutting down server socket, '
'this is normal under OS X', e)
self.socket.close()
class OpenERPDispatcherException(Exception):
def __init__(self, exception, traceback):
self.exception = exception

View File

@ -399,8 +399,17 @@ class orm_template(object):
_inherits = {}
_table = None
_invalids = set()
_log_create = False
CONCURRENCY_CHECK_FIELD = '__last_update'
def log(self, cr, uid, id, message, secondary=False, context=None):
return self.pool.get('res.log').create(cr, uid, {
'name': message,
'res_model': self._name,
'secondary': secondary,
'res_id': id},
context=context
)
def view_init(self, cr , uid , fields_list, context=None):
"""Override this method to do specific things when a view on the object is opened."""
@ -1031,7 +1040,14 @@ class orm_template(object):
for constraint in self._constraints:
fun, msg, fields = constraint
if not fun(self, cr, uid, ids):
translated_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, source=msg) or msg
# Check presence of __call__ directly instead of using
# callable() because it will be deprecated as of Python 3.0
if hasattr(msg, '__call__'):
txt_msg, params = msg(self, cr, uid, ids)
tmp_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, source=txt_msg) or txt_msg
translated_msg = tmp_msg % params
else:
translated_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, source=msg) or msg
error_msgs.append(
_("Error occurred while validating the field(s) %s: %s") % (','.join(fields), translated_msg)
)
@ -1832,6 +1848,12 @@ class orm_memory(orm_template):
for field in upd_todo:
self._columns[field].set_memory(cr, self, id_new, field, vals[field], user, context)
self._validate(cr, user, [id_new], context)
if self._log_create and not (context and context.get('no_store_function', False)):
message = self._description + \
" '" + \
self.name_get(cr, user, [id_new], context=context)[0][1] + \
"' "+ _("created.")
self.log(cr, user, id_new, message, True, context=context)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_create(user, self._name, id_new, cr)
return id_new
@ -1919,7 +1941,6 @@ class orm_memory(orm_template):
res=e.__dict__['_expression__exp']
return res or []
def search(self, cr, user, args, offset=0, limit=None, order=None,
context=None, count=False):
if not context:
@ -3478,6 +3499,12 @@ class orm(orm_template):
self.pool.get(object)._store_set_values(cr, user, ids, fields2, context)
done.append((object, ids, fields2))
if self._log_create and not (context and context.get('no_store_function', False)):
message = self._description + \
" '" + \
self.name_get(cr, user, [id_new], context=context)[0][1] + \
"' "+ _("created.")
self.log(cr, user, id_new, message, True, context=context)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_create(user, self._name, id_new, cr)
return id_new

View File

@ -31,9 +31,11 @@
"""
from websrv_lib import *
import netsvc
import errno
import threading
import tools
import os
import select
import socket
import xmlrpclib
@ -128,31 +130,25 @@ class BaseHttpDaemon(threading.Thread, netsvc.Server):
"Error occur when starting the server daemon: %s" % (e,))
raise
@property
def socket(self):
return self.server.socket
def attach(self, path, gw):
pass
def stop(self):
self.running = False
if os.name != 'nt':
try:
self.server.socket.shutdown(
getattr(socket, 'SHUT_RDWR', 2))
except socket.error, e:
if e.errno != 57: raise
# OSX, socket shutdowns both sides if any side closes it
# causing an error 57 'Socket is not connected' on shutdown
# of the other side (or something), see
# http://bugs.python.org/issue4397
netsvc.Logger().notifyChannel(
'server', netsvc.LOG_DEBUG,
'"%s" when shutting down server socket, '
'this is normal under OS X'%e)
self.server.socket.close()
self._close_socket()
def run(self):
self.running = True
while self.running:
self.server.handle_request()
try:
self.server.handle_request()
except (socket.error, select.error), e:
if self.running or e.args[0] != errno.EBADF:
raise
return True
class HttpDaemon(BaseHttpDaemon):

View File

@ -27,6 +27,7 @@ import netsvc
import threading
import tools
import os
import select
import socket
import tiny_socket
@ -50,7 +51,6 @@ class TinySocketClientThread(threading.Thread, netsvc.OpenERPDispatcher):
self.sock = None
def run(self):
# import select
self.running = True
try:
ts = tiny_socket.mysocket(self.sock)
@ -103,10 +103,13 @@ class TinySocketServerThread(threading.Thread,netsvc.Server):
"starting NET-RPC service at %s port %d" % (interface or '0.0.0.0', port,))
def run(self):
# import select
try:
self.running = True
while self.running:
timeout = self.socket.gettimeout()
fd_sets = select.select([self.socket], [], [], timeout)
if not fd_sets[0]:
continue
(clientsocket, address) = self.socket.accept()
ct = TinySocketClientThread(clientsocket, self.threads)
clientsocket = None
@ -129,12 +132,7 @@ class TinySocketServerThread(threading.Thread,netsvc.Server):
self.running = False
for t in self.threads:
t.stop()
try:
self.socket.shutdown(
getattr(socket, 'SHUT_RDWR', 2))
self.socket.close()
except:
return False
self._close_socket()
def stats(self):
res = "Net-RPC: " + ( (self.running and "running") or "stopped")

View File

@ -83,8 +83,7 @@ class configmanager(object):
'list_db' : True,
'timezone' : False, # to override the default TZ
'test-disable' : False,
'test-rollback' : True,
'test-continue' : False
'test-commit' : False,
}
self.misc = {}
@ -141,10 +140,8 @@ class configmanager(object):
group = optparse.OptionGroup(parser, "Testing Configuration")
group.add_option("--test-disable", action="store_true", dest="test_disable",
default=False, help="Disable loading test files.")
group.add_option("--test-no-rollback", action="store_false", dest="test_rollback",
default=True, help="Don't rollback after running test.")
group.add_option("--test-continue", action="store_true", dest="test_continue",
default=False, help="Display exception but then test should continue.")
group.add_option("--test-commit", action="store_true", dest="test_commit",
default=False, help="Commit database changes performed by tests.")
parser.add_option_group(group)
# Logging Group
@ -294,8 +291,7 @@ class configmanager(object):
self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {}
self.options["demo"] = not opt.without_demo and self.options['init'] or {}
self.options["test-disable"] = opt.test_disable
self.options["test-rollback"] = opt.test_rollback
self.options["test-continue"] = opt.test_continue
self.options["test-commit"] = opt.test_commit
self.options['update'] = opt.update and dict.fromkeys(opt.update.split(','), 1) or {}
self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all']

View File

@ -741,7 +741,12 @@ form: module.record_id""" % (xml_id,)
if f_ref=="null":
f_val = False
else:
f_val = self.id_get(cr, f_model, f_ref)
if f_name in model._columns \
and model._columns[f_name]._type == 'reference':
val = self.model_id_get(cr, f_model, f_ref)
f_val = val[0] + ',' + str(val[1])
else:
f_val = self.id_get(cr, f_model, f_ref)
else:
f_val = _eval_xml(self,field, self.pool, cr, self.uid, self.idref)
if model._columns.has_key(f_name):
@ -759,13 +764,17 @@ form: module.record_id""" % (xml_id,)
def id_get(self, cr, model, id_str):
if id_str in self.idref:
return self.idref[id_str]
return self.model_id_get(cr, model, id_str)[1]
def model_id_get(self, cr, model, id_str):
model_data_obj = self.pool.get('ir.model.data')
mod = self.module
if '.' in id_str:
mod,id_str = id_str.split('.')
result = self.pool.get('ir.model.data')._get_id(cr, self.uid, mod, id_str)
res = self.pool.get('ir.model.data').read(cr, self.uid, [result], ['res_id'])
result = model_data_obj._get_id(cr, self.uid, mod, id_str)
res = model_data_obj.read(cr, self.uid, [result], ['model', 'res_id'])
if res and res[0] and res[0]['res_id']:
return int(res[0]['res_id'])
return res[0]['model'], int(res[0]['res_id'])
return False
def parse(self, de):

View File

@ -101,7 +101,7 @@ def init_db(cr):
values (%s, %s, %s, %s, %s, %s, %s, %s, %s)', (
id, info.get('author', ''),
info.get('website', ''), i, info.get('name', False),
info.get('description', ''), p_id, state, info.get('certificate')))
info.get('description', ''), p_id, state, info.get('certificate') or None))
cr.execute('insert into ir_model_data \
(name,model,module, res_id, noupdate) values (%s,%s,%s,%s,%s)', (
'module_meta_information', 'ir.module.module', i, id, True))

View File

@ -682,7 +682,7 @@ class YamlInterpreter(object):
self.logger.exception(e)
except Exception, e:
self.logger.exception(e)
raise e
raise
def _process_node(self, node):
if is_comment(node):

9
doc/Changelog-6.x Normal file
View File

@ -0,0 +1,9 @@
2010-07-XX: 6.0.0
=================
Improvements (server)
---------------------
* support of 'ref' attribute for importing 'reference' field values, as for many2one fields.

View File

@ -60,6 +60,7 @@ required_modules = [
('pytz', 'Timezone handling library for Python'),
('reportlab', 'reportlab module'),
('yaml', 'YAML parser and emitter for Python'),
('pywebdav', 'PyWebDAV is a standards compliant WebDAV server and library written in Python'),
]
def check_modules():
@ -182,7 +183,7 @@ options = {
"encodings", "dateutil", "wizard", "pychart", "PIL", "pyparsing",
"pydot", "asyncore","asynchat", "reportlab", "vobject",
"HTMLParser", "select", "mako", "poplib",
"imaplib", "smtplib", "email", "yaml",
"imaplib", "smtplib", "email", "yaml","pywebdav",
],
"excludes" : ["Tkconstants","Tkinter","tcl"],
}