Commit Graph
23159 Commits
Author SHA1 Message Date
Olivier Dony ebdd7f7f40 [REVERT] use move instead of delete+add, revert revid:p_christ@hol.gr-20101123135849-z6bojjykt7r0dgx1use
bzr revid: odo@openerp.com-20101125141157-3gbjfqf0iwt1uqh8
2010-11-25 15:11:57 +01:00
Olivier Dony ad490bdcf5 [IMP] orm.write: ignore unknown fields, more consistent with rest of API
bzr revid: odo@openerp.com-20101125135800-dzad2x864bn8p1ah
2010-11-25 14:58:00 +01:00
Olivier Dony 30cb4b8891 [IMP] orm.orm: cleaned up comments after previous patches
bzr revid: odo@openerp.com-20101124184108-iw1up4jomysfoh85
2010-11-24 19:41:08 +01:00
Olivier Dony 0fa9b15868 [IMP] yaml_import: improved resolution of XML IDs
bzr revid: odo@openerp.com-20101124173222-177ra54gh0t5z0uy
2010-11-24 18:32:22 +01:00
Olivier Dony 7505e7d822 [FIX] websrv_lib: Darwin webdav workaround
bzr revid: odo@openerp.com-20101124173028-iumdj77clfhsnsuj
2010-11-24 18:30:28 +01:00
Olivier Dony 475667d384 [FIX] orm.import_data: also translate SQL constraints error messages that are not callable
bzr revid: odo@openerp.com-20101124172819-33ahiq3aacgwt8f2
2010-11-24 18:28:19 +01:00
Olivier Dony 03f3100346 [FIX] ir_actions: minor typo
bzr revid: odo@openerp.com-20101124164135-6qemb2nof0uzx2f2
2010-11-24 17:41:35 +01:00
Olivier Dony c34d2ae6d4 [FIX] res.user: code cleanup after merging previous patches
bzr revid: odo@openerp.com-20101124164105-xsd2nkit09g29gjl
2010-11-24 17:41:05 +01:00
Olivier Dony 276a54b0af [FIX] osv.osv: code cleanup after merging previous patches
bzr revid: odo@openerp.com-20101124164041-760b4zoidv0omu6c
2010-11-24 17:40:41 +01:00
Olivier Dony 458d7c7dea [FIX] addons.__init__: fixed mismatching logger API usage
bzr revid: odo@openerp.com-20101124163840-eyctlqtgjfq9h1u0
2010-11-24 17:38:40 +01:00
Olivier Dony af506691a3 [MERGE] merged second batch of fixes from xrg-pg84 branch
bzr revid: odo@openerp.com-20101124152707-ksfaru7en81x8xn2
2010-11-24 16:27:07 +01:00
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