Commit Graph

23147 Commits

Author SHA1 Message Date
P. Christeas 12f4f6232c sql_db: only do frame inspection when debugging
This affects the "Cursor not closed explicitly..." message.
The message is at a "warning" level, but the frame inspection added
some expensive overhead to each cursor open. So, avoid that unless we
are at debug mode.

bzr revid: p_christ@hol.gr-20101124094853-0ljr6nebkyya0eui
2010-11-24 11:48:53 +02:00
P. Christeas 5d53dcc700 websrv_lib: update copyright and remove bogus note
The reference to the "ganeti" project has always been totally arbitrary
and false. It is true that some parts of "websrv_lib" have been based
on Python's BaseHTTPServer and SimpleHTTPServer classes, but not more
than that. Overriding and perhaps resembling to parent classes is the
most common thing in OO programming. But never copied or knew about
any "ganeti" project whatsoever. (actually, the code mentioned at the
url admits itself that it copies the BaseHTTPServer, a common
denominator)

Git history to your help, all the code evolution is clearly recorded.

bzr revid: p_christ@hol.gr-20101123183357-fjroqywizql2qdkk
2010-11-23 20:33:57 +02:00
P. Christeas 597a871470 misc: import warnings, needed for earlier patch
bzr revid: p_christ@hol.gr-20101123180824-sk28lwc298v89rr4
2010-11-23 20:08:24 +02:00
P. Christeas 7165010fd6 ir.translate: revert some pg84 argument from the cherry-picks
bzr revid: p_christ@hol.gr-20101123155820-ltqymky8482k8l9l
2010-11-23 17:58:20 +02:00
P. Christeas a2ee48478a websrv_lib: add quirk for Darwin 9.x.x webdav clients.
They will report "HTTP/1.0" to us, while they support (and need) the
authorisation features of HTTP/1.1 .

This makes WebDAV work for some Mac OSX versions.

bzr revid: p_christ@hol.gr-20101123154448-0z7s5o77256cj1tu
2010-11-23 17:44:48 +02:00
P. Christeas c2c264467f fields: conform some default arguments to the coding standards
Side-effects may appear, let us test.

bzr revid: p_christ@hol.gr-20101123154408-qlkittdb7ogrqq2s
2010-11-23 17:44:08 +02:00
P. Christeas ec2c32e2fe ir.model: simplify some defaults
bzr revid: p_christ@hol.gr-20101123154335-tl2jm6litwx3ysro
2010-11-23 17:43:35 +02:00
P. Christeas 0c1061e4de module: improve over previous commit, fix mutable args
Conflicts:

	bin/addons/base/module/module.py

bzr revid: p_christ@hol.gr-20101123154306-j88k617evep9napa
2010-11-23 17:43:06 +02:00
Ferdinand Gassauer 09099f1ed8 module: sorted Features
returns alphabetically sorted Menu,Views,Reports to make these lists
readable for humans.

bzr revid: p_christ@hol.gr-20101123154255-4iazp4ec7wisn2sq
2010-11-23 17:42:55 +02:00
P. Christeas c5b99753ea ir.attachment: revise the access control code, let it be overriden
There was a fundamental problem when a user, through the 'document' module
would try to write into his personal folder; the res.users model won't be
writable by normal users. So, have all this code in a _single_ function,
which will be redefined by document.

Also follow the v6 API for access control, don't just lookup at ir.model.access.

Conflicts:

	bin/addons/base/ir/ir_attachment.py

bzr revid: p_christ@hol.gr-20101123154212-pphsnyp2rsmbjf72
2010-11-23 17:42:12 +02:00
P. Christeas a62f0bede4 ir.model: mutable argument fix
bzr revid: p_christ@hol.gr-20101123154032-tuoe1aiy9wpnjp2y
2010-11-23 17:40:32 +02:00
P. Christeas 04c05faf9b yaml-import: fix working with deleted data
At some cases, ir.model.data is left with orphan entries, so ensure that
the message below is used (rather than "bool has no get()" exception).

Conflicts:

	bin/tools/yaml_import.py

bzr revid: p_christ@hol.gr-20101123153936-0cc4t4e2xwat70q1
2010-11-23 17:39:36 +02:00
P. Christeas 1fed78619f websrv_lib: abort request on partial headers.
While searching for the KTHML bug, noticed that partial http requests
would falsely be honoured. Instead, we must check if the full headers
(including the blank line) have been parsed before we dispatch the
request to the virtual handler class.

Conflicts:

	bin/service/websrv_lib.py

bzr revid: p_christ@hol.gr-20101123153558-oh44mjkhwjaebwow
2010-11-23 17:35:58 +02:00
P. Christeas 186b9190f6 tools.convert, misc: use pythonic logging
Conflicts:

	bin/tools/convert.py
	bin/tools/misc.py

bzr revid: p_christ@hol.gr-20101123153325-wicnjxt98lp03cpf
2010-11-23 17:33:25 +02:00
P. Christeas 652be11b57 rml2pdf: better message if a font is not available.
Since 91422704d965268f, specifying a font that is not registered with
pdfmetrics will raise an exception. Now, improve that exception to
help the user understand what has gone wrong.

Note: rather than hiding the fact that some font is missing, the admin
should see this error and try to either fix the report (to use a known
font), or register more fonts with the customfonts.py mechanism.

bzr revid: p_christ@hol.gr-20101123153235-c1yri33ptaydb5eo
2010-11-23 17:32:35 +02:00
P. Christeas 3a220a0214 res.user: cleanup defaults, use 1 sql query per login (from 3)
bzr revid: p_christ@hol.gr-20101123153223-2u34e4eszt5aflv1
2010-11-23 17:32:23 +02:00
P. Christeas f9f0d929e7 ir.attachment: mark 'type' and 'company_id' with change_defaults
Other fields of attachments (like the directories, in document) should
have their default properties depending on these.

bzr revid: p_christ@hol.gr-20101123153159-wpus8bxls1q03ks9
2010-11-23 17:31:59 +02:00
P. Christeas 4db6f0e5c1 translate: fix default arguments after last patch
bzr revid: p_christ@hol.gr-20101123152740-pn9mbptpdvw0sz98
2010-11-23 17:27:40 +02:00
P. Christeas 49dc2ec5ec ir.ui.menu: Fix default args, no need for lambda in _defaults.
bzr revid: p_christ@hol.gr-20101123152551-dr7dov1fip2r7jet
2010-11-23 17:25:51 +02:00
P. Christeas e037e96f6d module: fix usage of new get_module_resource()
It will return False, now, if the file is missing. No need to perform
os.path.exists().

bzr revid: p_christ@hol.gr-20101123152234-4iptp8yzboq3gicz
2010-11-23 17:22:34 +02:00
P. Christeas d4379792fc tools/misc: port the exec_command_pipe() to the subprocess module.
The os.popen2 is deprecated since Python 2.6. It also failed to properly
escape the command line arguments.

Conflicts:

	bin/tools/misc.py

bzr revid: p_christ@hol.gr-20101123152224-d52414w2tscw6bvo
2010-11-23 17:22:24 +02:00
P. Christeas b4e5c51311 res_user: fix default args, close db cursors.
Conflicts:

	bin/addons/base/res/res_user.py

bzr revid: p_christ@hol.gr-20101123152029-c823isjqrpml7dva
2010-11-23 17:20:29 +02:00
P. Christeas 3e3270264f trml2pdf: Fix using of custom fonts in reports
That snippet of code practically meant "don't use anything but the
standard fonts (by name) in the report". It obviously wanted to prevent the
rml2pdf engine from crashing at a non-existent font.
Well, if the report specifies a font that cannot be mapped by the system,
it should preferably raise an exception (and ask us to fix the report), not
silently ignore the font.
Case 1: the internationalized reports, where font name is used to select a
Unicode-capable font.
Case 2: l10n_ch, where the OCR-B font had to be used (perhaps legal req.)

bzr revid: p_christ@hol.gr-20101123152002-es404ul29rsohzqd
2010-11-23 17:20:02 +02:00
P. Christeas 6e893f1e9e rml2pdf: use ustr() instead of unicode()
When strings are 8-bit utf8-encoded, unicode will break with the usual:
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position ..
message. ustr() will have better luck in those cases.

Conflicts:

	bin/report/render/rml2pdf/utils.py

bzr revid: p_christ@hol.gr-20101123151930-8r9q9gg7r902i2nv
2010-11-23 17:19:30 +02:00
P. Christeas 1a0a2535a2 http_server: allow requests to "see" the protocol of the server
Needed for WebDAV.

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20101123151740-ovx7jg8yp3070qqe
2010-11-23 17:17:40 +02:00
P. Christeas 792c8eba19 trml2pdf: cleaner import of StringIO
bzr revid: p_christ@hol.gr-20101123151444-sbnfj0fu1nkl2pkr
2010-11-23 17:14:44 +02:00
P. Christeas 1a5e3cf073 pdf customfonts: allow absolute paths in registered fonts
bzr revid: p_christ@hol.gr-20101123151131-v0v1qfkiajh0cw73
2010-11-23 17:11:31 +02:00
P. Christeas 03b4e87cca report customFonts: have debugging logs for fonts mapped.
Since this is platform-dependant, it is good to be able to debug
if that algorithm worked and located our TTF fonts.

bzr revid: p_christ@hol.gr-20101123151124-wk5r5fac00kpu3f4
2010-11-23 17:11:24 +02:00
P. Christeas 27ae6f3522 report/render: fixes from xrg branch
This should log the rendering exceptions for reports. Also fix am error at
custom fonts, suppress a message.

Conflicts:

	bin/report/render/rml2pdf/utils.py

bzr revid: p_christ@hol.gr-20101123151110-bckon1ji7hul20mp
2010-11-23 17:11:10 +02:00
P. Christeas d1347d0b0d Fix rml2pdf custom ttf fonts.
The attempt to put checks in that code had broken it.

bzr revid: p_christ@hol.gr-20101123150945-012xrvhz3ya2watl
2010-11-23 17:09:45 +02:00
P. Christeas 2f2ed1d138 rml2pdf: fix logging of exceptions.
exception() cannot be called without a string, yet it is even better to
demote those logs to warnings.

Conflicts:

	bin/report/render/rml2pdf/utils.py

bzr revid: p_christ@hol.gr-20101123150903-zgiyob943ivcftkq
2010-11-23 17:09:03 +02:00
P. Christeas 53c306cfe0 websrv_lib: allow "noconnection" object to carry the socket name
Needed for WebDAV, which wants to know the server's endpoint address.

bzr revid: p_christ@hol.gr-20101123135858-qycopdfqsll1fy38
2010-11-23 15:58:58 +02:00
P. Christeas 7ce5179086 translate: don't complain about fuzzy strings.
They are part of the format and ought to be silently discarded.

bzr revid: p_christ@hol.gr-20101123135858-zkp7hjcn4slv3r57
2010-11-23 15:58:58 +02:00
P. Christeas 8e6c11a16c ir.module: use pythonic logging, addons api
bzr revid: p_christ@hol.gr-20101123135856-0px463nz9xei8ho4
2010-11-23 15:58:56 +02:00
P. Christeas fe35e2517b Move the client scripts into tools/
Just a cleanup of the root dir.

bzr revid: p_christ@hol.gr-20101123135849-z6bojjykt7r0dgx1
2010-11-23 15:58:49 +02:00
P. Christeas e5bc5503d7 setup: The ssl certs should *not* be distributed.
The meaning of any SSL certificate (even self-signed) is that it uniquely
identifies the server. So, if we have a generic cert distributed with our
packaging, we break that. We could not even generate a cert at the "build"
stage of our server, because that would be included in the packages.

If anybody needs to run OpenERP with SSL, they will need to generate the
certificate at the target server, possibly using ssl-cert.cfg as a sample.

Also, the "ssl" directory under bin/ would confuse some pythonic code that
had tried to "import ssl" (eg. urllib.py).

bzr revid: p_christ@hol.gr-20101123135844-nr8k78qrmlyn19xb
2010-11-23 15:58:44 +02:00
P. Christeas 7d3afa7c0c sql_db: Better exceptions.
A closed cursor should behave the same as a closed connection, ie.
OperationalError. Also instrument a function we don't expect to be called.

bzr revid: p_christ@hol.gr-20101123135837-vkn3ph0e4bz9urf0
2010-11-23 15:58:37 +02:00
P. Christeas c67f1746f4 translate: port to pythonic logging, filename in a message
It is good to know which .po file we are currently loading.
Warning: some messages moved from the 'db' logger to the 'i18n' one.

bzr revid: p_christ@hol.gr-20101123135835-k6d6r7sgif5zhb75
2010-11-23 15:58:35 +02:00
P. Christeas 81a1a310fc addons-init: better messages when an ir.model is missing
Suppress the msgs "no access rules", but add an explicit message that
the model is not there.

bzr revid: p_christ@hol.gr-20101123135748-y6t35206fy4tq44c
2010-11-23 15:57:48 +02:00
P. Christeas ba47847b20 ORM: moved columns should carry the old name, not the table
When a column changes type in module upgrades, we have code to rename
the column. The new name shall be based on the old column name, not the
name of the table.

bzr revid: p_christ@hol.gr-20101123135748-z8rtmy36c8u972xb
2010-11-23 15:57:48 +02:00
P. Christeas 6cd5fec0e2 sql_db: Avoid using inspect.stack(), use failsafe alternative.
Inspecting the full stack just to learn the file:line info for debugging
purposes is both expensive and error-prone. Write an alternative function
in tools/func.py that will just go N frames back and try to get the info.

bzr revid: p_christ@hol.gr-20101123135742-2jp75f3uxyg3a6b6
2010-11-23 15:57:42 +02:00
P. Christeas 962a4cce70 orm: revert e940ece64169da4f, read(<bad-id>) must return empty list!
bzr revid: p_christ@hol.gr-20101123135728-rqoec2b92roln4up
2010-11-23 15:57:28 +02:00
P. Christeas 6e13dcb8a2 orm: Return numeric uid at perm_read() when no access to res.user
If a res.user belongs to a company_id that the current user has no access
to, perm_read() wouldn't be able to return results (but exception). Now,
just skip the uid->login resolution and return the numeric value instead.

bzr revid: p_christ@hol.gr-20101123135654-bslxfv93p10216d3
2010-11-23 15:56:54 +02:00
P. Christeas ddb331f944 res_users: When deleting a group with users, have a more detailed exc.
bzr revid: p_christ@hol.gr-20101123135506-qr5aumaw8bwoedfd
2010-11-23 15:55:06 +02:00
P. Christeas 1aa8aad95e ir_actions: Cleanup code, use pythonic logging.
Conflicts:

	bin/addons/base/ir/ir_actions.py

bzr revid: p_christ@hol.gr-20101123135224-190hp303ipjncml8
2010-11-23 15:52:24 +02:00
P. Christeas f4c0dfd0f5 addons/base: bump the module version
bzr revid: p_christ@hol.gr-20101123135003-krickjbds9qnbnhq
2010-11-23 15:50:03 +02:00
P. Christeas 063ac95428 base.module.upgrade: have default context arg.
bzr revid: p_christ@hol.gr-20101123135001-gosz6v48duf3t467
2010-11-23 15:50:01 +02:00
P. Christeas 091a3eba2b websrv_lib: fix do_OPTIONS for m$ webdav
Since we have moved all code into the websrv_lib, we must also support
this non-standard extension in our do_OPTIONS(). It has been noted that
some Win XP machines wouldn't connect to our WebDAV unless we set that
header.

bzr revid: p_christ@hol.gr-20101123134932-65wmh8bntuwt4jvc
2010-11-23 15:49:32 +02:00
P. Christeas ac2c09908a OSV: a lint check fix
bzr revid: p_christ@hol.gr-20101118184840-08li9h2ebfzdtxpy
2010-11-18 20:48:40 +02:00
P. Christeas 41c9098ca9 OSV: Fix callable _sql_constraint messages
This fixes the support for callable sql_constraint messages, which have
always been wrong. It respects the (cr, uid, ids, context) arguments and
will fallback to Postgres's error if it cannot call.

Note that sql constraints are not properly explained when base_module_record
or audittrail are installed.

bzr revid: p_christ@hol.gr-20101118184643-8tnmj83b09kuvf1j
2010-11-18 20:46:43 +02:00