[MERGE] from trunk

bzr revid: chm@openerp.com-20130320133155-qn27q8aek7zp1ls4
This commit is contained in:
Christophe Matthieu 2013-03-20 14:31:55 +01:00
commit 45cc77dbcb
8 changed files with 127 additions and 105 deletions

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-03-12 17:34+0000\n"
"PO-Revision-Date: 2013-03-14 10:08+0000\n"
"Last-Translator: krnkris <Unknown>\n"
"Language-Team: Hungarian <openerp-hungarian-team@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-03-13 04:37+0000\n"
"X-Launchpad-Export-Date: 2013-03-15 04:56+0000\n"
"X-Generator: Launchpad (build 16532)\n"
#. module: base
@ -448,7 +448,7 @@ msgstr ""
#: code:addons/orm.py:2649
#, python-format
msgid "Invalid group_by"
msgstr ""
msgstr "Hibás csoportosítás"
#. module: base
#: field:ir.module.category,child_ids:0
@ -1121,7 +1121,7 @@ msgstr "Megosztott tárterület (WebDAV)"
#. module: base
#: view:res.users:0
msgid "Email Preferences"
msgstr ""
msgstr "Email kiválasztás"
#. module: base
#: code:addons/base/ir/ir_fields.py:195
@ -3000,14 +3000,14 @@ msgid ""
" "
msgstr ""
"\n"
"Hibabejelentés kezelése.\n"
"Ügyfélszolgálat kezelése.\n"
"====================\n"
"\n"
"Mint a követelések felvitele és feldolgozása, Hibabejelentés és támogatás jó "
"eszközök a\n"
"Mint a reklamációk felvitele és feldolgozása, Ügyfélszolgálat és támogatás "
"eszközök a\n"
"beavatkozás nyomon követésére. Ez a menü legjobban a szóbeli kommunikációhoz "
"alkalmazkodik,\n"
"ami nem szükségszerűen kapcsolódik egy követeléshez. Válasszon ki egy "
"ami nem szükségszerűen kapcsolódik egy jótálláshoz. Válasszon ki egy "
"ügyfelet, adjon hozzá megjegyzést\n"
"és kategorizálja a beavatkozást egy csatornával és egy prioritási szinttel.\n"
" "
@ -9642,7 +9642,7 @@ msgstr ""
"-----------------------------------------------------------------------------"
"-----------------------------\n"
" * CRM Érdeklődések/Lehetőségek\n"
" * CRM garanciális és egyéb igények\n"
" * CRM reklamációs és egyéb igények\n"
" * Projekt ügy\n"
" * Projekt feladatok\n"
" * Emberi erőforrás igények (Pályázók/jelentkezők)\n"
@ -12675,10 +12675,10 @@ msgid ""
"Adds a Claim link to the delivery order.\n"
msgstr ""
"\n"
"Készítsen jótállási ügyet egy szállítási kézbesítési bizonylatból.\n"
"Készítsen reklamációs ügyet egy szállítási kézbesítési bizonylatból.\n"
"=====================================\n"
"\n"
"Egy jótálási linket ad a kézbesítési bizonylathoz.\n"
"Egy Reklamációs elérési utat ad a kézbesítési bizonylathoz.\n"
#. module: base
#: view:ir.model:0
@ -16025,13 +16025,13 @@ msgid ""
msgstr ""
"\n"
"\n"
"Vevői jótállások kezelése.\n"
"Vevői reklamációk kezelése.\n"
"=======================\n"
"Ez az alkalmazás lehetővé teszi a vevők/beszállítók jótállásainak és "
"Ez az alkalmazás lehetővé teszi a vevők/beszállítók reklamációinak és "
"garanciáinak nyomon követését.\n"
"\n"
"Ez teljesen integrált az e-mail átjáróval, így automatikusan új jótállást "
"generálhat a beérkező emailek alapján.\n"
"Ez teljesen integrált az e-mail átjáróval, így automatikusan új reklamációt "
"generálhat a beérkező e-mailek alapján.\n"
" "
#. module: base

View File

@ -1060,6 +1060,14 @@ class ir_model_data(osv.osv):
if set(external_ids)-ids_set:
# if other modules have defined this record, we must not delete it
continue
if model == 'ir.model.fields':
# Don't remove the LOG_ACCESS_COLUMNS unless _log_access
# has been turned off on the model.
field = self.pool.get(model).browse(cr, uid, [res_id], context=context)[0]
if field.name in openerp.osv.orm.LOG_ACCESS_COLUMNS and self.pool[field.model]._log_access:
continue
if field.name == 'id':
continue
_logger.info('Deleting %s@%s', res_id, model)
try:
cr.execute('SAVEPOINT record_unlink_save')

View File

@ -269,7 +269,8 @@
<page string="Sales &amp; Purchases">
<group>
<group>
<field name="user_id"/>
<field name="user_id"
context="{'default_groups_ref': ['base.group_partner_manager']}"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<group>

View File

@ -744,6 +744,7 @@ class users_view(osv.osv):
def create(self, cr, uid, values, context=None):
self._set_reified_groups(values)
return super(users_view, self).create(cr, uid, values, context)
def write(self, cr, uid, ids, values, context=None):
@ -782,6 +783,21 @@ class users_view(osv.osv):
fields1 = (fields + ['groups_id']) if group_fields else fields
values = super(users_view, self).default_get(cr, uid, fields1, context)
self._get_reified_groups(group_fields, values)
# add "default_groups_ref" inside the context to set default value for group_id with xml values
if 'groups_id' in fields and isinstance(context.get("default_groups_ref"), list):
groups = []
ir_model_data = self.pool.get('ir.model.data')
for group_xml_id in context["default_groups_ref"]:
group_split = group_xml_id.split('.')
if len(group_split) != 2:
raise osv.except_osv(_('Invalid context value'), _('Invalid context default_groups_ref value (model.name_id) : "%s"') % group_xml_id)
try:
temp, group_id = ir_model_data.get_object_reference(cr, uid, group_split[0], group_split[1])
except ValueError:
group_id = False
groups += [group_id]
values['groups_id'] = groups
return values
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):

View File

@ -84,48 +84,39 @@
</record>
<menuitem action="action_res_groups" id="menu_action_res_groups" parent="base.menu_users" groups="base.group_no_one"/>
<!-- res.users -->
<record id="view_users_simple_form" model="ir.ui.view">
<field name="name">res.users.simplified.form</field>
<field name="model">res.users</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Contact" version="7.0">
<form string="Users" version="7.0">
<sheet>
<field name="image" widget='image' class="oe_left oe_avatar" options='{"preview_image": "image_medium", "size": [90, 90]}'/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name"/>
<field name="id" invisible="1"/>
<div class="oe_form_box_info oe_text_center" style="margin-bottom: 10px" attrs="{'invisible': [('id', '>', 0)]}">
You are creating a new user. After saving, the user will receive an invite email containing a link to set its password.
</div>
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="login" class="oe_edit_only"/>
<h2><field name="login"/></h2>
<label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
<field name="company_id" context="{'user_preference': 0}" groups="base.group_multi_company"/>
</div>
<h1>
<field name="name" default_focus="1" placeholder="Name" />
</h1>
<field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
</div>
<group>
<group>
<label for="street" string="Address"/>
<div>
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div>
<field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>
<label for="groups_id" string="Access Rights"
attrs="{'invisible': [('id', '>', 0)]}"/>
<div attrs="{'invisible': [('id', '>', 0)]}">
<field name="groups_id" readonly="1" widget="many2many_tags" style="display: inline;"/> You will be able to define additional access rights by editing the newly created user under the Settings / Users menu.
</div>
<field name="website" widget="url" placeholder="e.g. www.openerp.com"/>
</group>
<group>
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
<field name="mobile"/>
<field name="fax"/>
<field name="email" widget="email"/>
<field name="email" widget="email" required="True"/>
</group>
</group>
</sheet>
</sheet>
</form>
</field>
</record>
@ -134,8 +125,8 @@
<field name="model">res.users</field>
<field name="arch" type="xml">
<form string="Users" version="7.0">
<field name="id" invisible="1"/>
<sheet>
<field name="id" invisible="1"/>
<div class="oe_right oe_button_box">
<button string="Change Password" type="action" name="%(change_password_wizard_action)d"
help="Change the user password."/>
@ -146,17 +137,29 @@
<h1><field name="name"/></h1>
<label for="login" class="oe_edit_only"/>
<h2><field name="login"/></h2>
<label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
<field name="company_id" context="{'user_preference': 0}" groups="base.group_multi_company"/>
</div>
<group>
<group>
<field name="company_id" context="{'user_preference': 0}"/>
</group>
<group>
<field name="active"/>
</group>
</group>
<notebook colspan="4">
<page string="Access Rights">
<group>
<field name="active"/>
</group>
<group string="Allowed Companies" groups="base.group_multi_company">
<field name="company_ids" nolabel="1" widget="many2many_tags"/>
</group>
<group col="4">
<field name="groups_id"/>
</group>
</page>
<page string="Contact">
<group>
<field name="phone" placeholder="e.g. +32.81.81.37.00"/>
<field name="mobile"/>
<field name="fax"/>
<field name="email" widget="email"/>
</group>
</page>
<page string="Preferences">
<group>
<group name="preferences">
@ -168,24 +171,16 @@
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
</group>
</group>
<group>
<field name="email" widget="email"/>
<group string="Email preferences">
<field name="signature"/>
</group>
</page>
<page string="Access Rights">
<group string="Allowed Companies" groups="base.group_multi_company">
<field name="company_ids" nolabel="1" widget="many2many_tags"/>
</group>
<group col="4">
<field name="groups_id"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_users_tree" model="ir.ui.view">
<field name="name">res.users.tree</field>
<field name="model">res.users</field>

View File

@ -480,7 +480,9 @@ class browse_record(object):
try:
return self[name]
except KeyError, e:
raise AttributeError(e)
import sys
exc_info = sys.exc_info()
raise AttributeError, "Got %r while trying to get attribute `%s`." % (e, name), exc_info[2]
def __contains__(self, name):
return (name in self._table._columns) or (name in self._table._inherit_fields) or hasattr(self._table, name)
@ -3589,8 +3591,6 @@ class BaseModel(object):
"""
if not context:
context = {}
self.check_access_rights(cr, user, 'read')
fields = self.check_field_access_rights(cr, user, 'read', fields)
if isinstance(ids, (int, long)):
@ -3600,12 +3600,7 @@ class BaseModel(object):
select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)
result = self._read_flat(cr, user, select, fields, context, load)
for r in result:
for key, v in r.items():
if v is None:
r[key] = False
if isinstance(ids, (int, long, dict)):
if isinstance(ids, (int, long)):
return result and result[0] or False
return result
@ -3742,34 +3737,37 @@ class BaseModel(object):
if field in self._columns:
fobj = self._columns[field]
if not fobj:
continue
groups = fobj.read
if groups:
edit = False
for group in groups:
module = group.split(".")[0]
grp = group.split(".")[1]
cr.execute("select count(*) from res_groups_users_rel where gid IN (select res_id from ir_model_data where name=%s and module=%s and model=%s) and uid=%s", \
(grp, module, 'res.groups', user))
readonly = cr.fetchall()
if readonly[0][0] >= 1:
edit = True
break
elif readonly[0][0] == 0:
edit = False
else:
edit = False
if fobj:
groups = fobj.read
if groups:
edit = False
for group in groups:
module = group.split(".")[0]
grp = group.split(".")[1]
cr.execute("select count(*) from res_groups_users_rel where gid IN (select res_id from ir_model_data where name=%s and module=%s and model=%s) and uid=%s", \
(grp, module, 'res.groups', user))
readonly = cr.fetchall()
if readonly[0][0] >= 1:
edit = True
break
elif readonly[0][0] == 0:
edit = False
else:
edit = False
if not edit:
if type(vals[field]) == type([]):
vals[field] = []
elif type(vals[field]) == type(0.0):
vals[field] = 0
elif type(vals[field]) == type(''):
vals[field] = '=No Permission='
else:
vals[field] = False
if vals[field] is None:
vals[field] = False
if not edit:
if type(vals[field]) == type([]):
vals[field] = []
elif type(vals[field]) == type(0.0):
vals[field] = 0
elif type(vals[field]) == type(''):
vals[field] = '=No Permission='
else:
vals[field] = False
return res
# TODO check READ access
@ -5283,7 +5281,10 @@ class BaseModel(object):
assert signal_name
return (lambda *args, **kwargs:
self.signal_workflow(*args, signal=signal_name, **kwargs))
return super(BaseModel, self).__getattr__(name)
get = getattr(super(BaseModel, self), '__getattr__', None)
if get is not None: return get(name)
raise AttributeError(
"'%s' object has no attribute '%s'" % (type(self).__name__, name))
# keep this import here, at top it will cause dependency cycle errors
import expression

View File

@ -1,12 +1,15 @@
# -*- coding: utf-8 -*-
import base64
import contextlib
import logging
import os
import threading
import traceback
from openerp import SUPERUSER_ID
import openerp.pooler
import openerp.release
import openerp.sql_db
import openerp.tools
@ -342,7 +345,7 @@ def exp_server_version():
""" Return the version of the server
Used by the client to verify the compatibility with its own version
"""
return release.version
return openerp.release.version
def exp_migrate_databases(databases):
for db in databases:

View File

@ -32,8 +32,7 @@ import StringIO
import errno
import logging
import os
import signal
import platform
import socket
import sys
import threading
@ -43,7 +42,6 @@ import werkzeug.serving
import werkzeug.contrib.fixers
import openerp
import openerp.modules
import openerp.tools.config as config
import websrv_lib