Commit Graph

514 Commits

Author SHA1 Message Date
Olivier Dony 65d92dadf4 [FIX] base: incorrect code and locale for Bosnian
Stems from prebiblical commit f083aa2.

Fixes #3480
2014-11-05 19:09:23 +01:00
Samus CTO d2fd05ef21 [IMP] config: Test that the config file is readable
Fixes #3237

cherry-pick of 8e72049
2014-10-24 16:48:27 +02:00
Martin Trigaux 7705f883d2 [FIX] base: support float rounding with rounding_method=UP (ceiling)
Add rounding_method parameter on float_round method to offer
HALF-UP (default, usual round) or UP (ceiling) rounding method.
Use the second method instead of math.ceil() for product
reservations.

For UP, the python math.ceil() method uses "torwards infinity"
rounding method while we want "away from zero".
Therefore we use the absolute value of normalized_value to make
sure than -1.8 is rounded to -2.0 and not -1.

Fixes #1125 #2793

This is a cherry-pick of d4972ff which was reverted at 333852e due
to remaining issue with negative values.
2014-10-22 14:28:22 +02:00
Martin Trigaux bd52298073 [IMP] mail: parsing emails with several html parts
If an email contains several text/html parts inside a multipart email, the previous code was only keeping the last content part.
The Content-Type: multipart/mixed allows several independent part (RFC1341 7.2.2), so two html is technically valid.
With this patch, the two parts are concatenated. (opw 614755)

Modify append_content_to_html regex to make sure the regex keeps the content of the html instead of removing it.
e.g.: "123 <html> 456 </html> 789" used to be stripped to "123  789" while we expect "123 456 789"
2014-10-09 13:53:23 +02:00
Olivier Dony 9b1a9c9518 [FIX] tools: remove useless attributes 2014-09-29 17:39:01 +02:00
Denis Ledoux 333852e19d Revert "[FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP"
This reverts commit d4972ffdb6.

Seems to break some cases, at least in _product_reserve from stock/stock.py

Actual use case:

SELECT product_uom, sum(product_qty) AS product_qty FROM stock_move WHERE location_dest_id=%s AND location_id<>%s AND product_id=3645 AND state='done' GROUP BY product_uom;
returning 1 | 6

SELECT product_uom,-sum(product_qty) AS product_qty FROM stock_move WHERE location_id=%s AND location_dest_id<>%s AND product_id=%s AND state in ('done', 'assigned') GROUP BY product_uom;
returning 1 | -6

results += cr.dictfetchall()
    total = 0.0
    results2 = 0.0
    for r in results:
        amount = uom_obj._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
        results2 += amount
        total += amount
Total = 1, amount = -5

It should actually be
Total = 0, amount = -6
2014-09-26 21:21:06 +02:00
Cedric Snauwaert d4972ffdb6 [FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
2014-09-24 17:11:25 +02:00
Denis Ledoux b601015800 [FIX] tools: restrict available attributes 2014-09-15 11:55:53 +02:00
Denis Ledoux d824769b3c [FIX] tools,mail: improve parsing of references from rev. 0bee015dd6
Backport of 8.0 fix was not enough for 7.0, because it still fails for the legacy reference match (model+res_id), which is not used in 8.0
2014-09-05 11:44:20 +02:00
Desai Binjal 8fe9f07cac [FIX] note: small bugs 2014-08-21 15:55:23 +02:00
Martin Ambroz 106cb1ec2b [FIX] base: python 2.6 incompatibility for dictionary comprehension 2014-08-20 10:28:37 +02:00
Olivier Dony 69eef5ac8d [FIX] tools.translate: addons path resolution failed with duplicates
When the addons_path config contained the
default path, the system was working with
an empty addons_path in the middle of the
other paths. This empty one matched for all
files, making all files appear to belong to
the root path component, e.g. `home` if the
root path is in /home.
Refactored a bit to avoid duplicates and
redundant path calculations.
2014-08-14 02:07:59 +02:00
Vo Minh Thu 680214c47e [FIX] tools.translate: when loading entries from a PO file, use also the POT.
On Launchpad, as commented on bug 933496, PO entries (and their comments) are
shared between series. This mean that e.g. the 7.0 series can have the wrong
`reference` comments (those beginning with #:) as they would be copied from say
the trunk series. Those `reference` comments are used to import translations
and look them up.

This patch adds a few lines of code to tools.translate so that targets
defined in the POT `reference` comments are used in addition to those from the
PO file.

Also adds a test module to validate the new behavior.

This patch stems from:
 - the 6.1 branch by Vo Minh Thu:
    https://code.launchpad.net/+branch/~openerp-dev/openobject-server/6.1-fix-po-targets-933496-vmt
 - the 7.0 port by Numerigraphe:
    https://code.launchpad.net/~numerigraphe-team/openobject-server/7.0-fix-po-targets-933496-vmt
2014-08-13 23:07:40 +02:00
Denis Ledoux 2b0487113a [FIX] yaml tests: Set on_change keys not in view logger as debug instead of warning
This is related to commit d31faceb67
(This is to avoid the runbot being yellow if on_change methods have extra keys in the returned value, this is not wrong, the web client will simply ignore them).
2014-08-11 11:11:36 +02:00
Denis Ledoux d31faceb67 [FIX] yaml tests: extra key in on_change result isn't that bad.
In the return result of an on_change, having keys which are not ine the view is not that bad, it is not an actual problem.

Display warning instead of asserting all the keys are in the views.
2014-08-08 11:40:30 +02:00
Mathieu Benoit 40b1fccb2a [FIX] translate: Fix debug print when parse path list to translate. 2014-07-25 16:17:29 -04:00
Denis Ledoux 46ef1356d6 [ADD] safe_eval: UNPACK_SEQUENCE and Exception
Allowing UNPACK_SEQUENCE allows the use of the "multi" assignation:
a, b = [1,2]
for a,b in items
2014-07-25 13:00:17 +02:00
Thibault Delavallée 7a928b151a [FIX] tools: mail: fixed last commit, solving an issue with the html2plaintext introduced another issue with notes. Reverting to the first version. 2014-07-11 16:21:01 +02:00
Anand-Dharampuriya 5cbc611361 [FIX] Solve some mail issues which are currently present in 7.0 2014-07-10 16:29:54 +02:00
Fabien Meghazi c0aa86b9ab [FIX] configuration file dbfilter's option has no effect
lp bug: https://launchpad.net/bugs/940439 fixed

bzr revid: fme@openerp.com-20140508075025-yszqmzie1z4n7l4j
2014-07-07 18:08:31 +02:00
Kiril Vangelovski c0882872be [ADD] Macedonian language 2014-05-18 22:57:07 +02:00
Olivier Dony 188930bb01 [FIX] convert: gracefully ignore missing XML IDs when processing <delete> tags + warn in log
bzr revid: odo@openerp.com-20140505074636-bl2y5pst4pfmpz3u
2014-05-05 09:46:36 +02:00
Olivier Dony 4836354a16 [FIX] safe_eval: allow STORE_FAST and DELETE_FAST opcodes, used e.g. for comprehension expressions
bzr revid: odo@openerp.com-20140428151133-uz7mphscch35dl6o
2014-04-28 17:11:33 +02:00
Martin Trigaux 91bf583b1c [FIX] amount_to_text: make sure accented string is in unicode
bzr revid: mat@openerp.com-20140423150215-578nzug1glccvpwy
2014-04-23 17:02:15 +02:00
Martin Trigaux 1db082db9d [FIX] convert: use _all_columns instead of _columns as it contain fields from inherited models.
bzr revid: mat@openerp.com-20140418164552-2mlprexkdlqlui2h
2014-04-18 18:45:52 +02:00
Kersten Jeremy 3285feab53 [FIX] Allow missing opcodes, harden check for private attributes (dunder), check inside embedded code objects.
bzr revid: jke@openerp.com-20140409151659-xwttchbtbj02v1w7
2014-04-09 17:16:59 +02:00
Martin Trigaux 94b3b0d6f6 [FIX] image tools: do not crop an image when resizing it, use reduce the size instead and add transparency background (opw 593992)
bzr revid: mat@openerp.com-20140212155104-zc6hhkzqw6711e9m
2014-02-12 16:51:04 +01:00
Martin Trigaux e328c0a40e [FIX] html_sanitize: partial backport of trunk revision 5047.
Unescape elements that have been wrongly escaped.

Some elements (eg: 'href' tag in links) are sanitised in templates which prevents the execution of mako templates.

lp bug: https://launchpad.net/bugs/1273251 fixed

bzr revid: mat@openerp.com-20140210144023-9sp8cqn07ta5o64y
2014-02-10 15:40:23 +01:00
Christophe Simonis c234d8547d [FIX] _(): avoid useless warning where translating string without a cursor
bzr revid: chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
2014-02-06 11:51:41 +01:00
Olivier Dony 7a819ca8d0 [FIX] tools.email_split: improve email extraction using stdlib + extra tests
The original code was having issues telling apart
names containing emails from the actual email.
This patch is inspired by Etienne Hirt's patch
on bug 1165531 for OpenERP 6.1.
This will also help solve bug 1199386, if we can
centralize all email parsing through this helper.

lp bug: https://launchpad.net/bugs/1199386 fixed
lp bug: https://launchpad.net/bugs/1165531 fixed

bzr revid: odo@openerp.com-20140114154426-usu6intv5139egd3
2014-01-14 16:44:26 +01:00
Xavier ALT 4986d636b4 [FIX] translation: force clearing of cached translated term after a successfull `trans_load_data`
When re-loading a translation (with 'Overwrite Existing Terms') we need to
  empty the translation cache to ensure overwritten terms get their new values.

bzr revid: xal@openerp.com-20131217145738-9oy2fjhbc46yzonq
2013-12-17 15:57:38 +01:00
Martin Trigaux 0216a53a0f [FIX] convert: better error message when failed to load csv file (module name already in path, no need to append)
bzr revid: mat@openerp.com-20131204155244-sy223fbt0tmpeqw1
2013-12-04 16:52:44 +01:00
Cecile Tonglet 767aaeb8cc [FIX] Wrong error message when data cannot be loaded at module loading
bzr revid: cto@openerp.com-20131203092433-uu1brp5csqvvd8yh
2013-12-03 10:24:33 +01:00
Olivier Dony 4e4b5af3d9 [ADD] i18n: enable Lao language (Laos) as an installation option
bzr revid: odo@openerp.com-20131125084215-nddml5h65i2xkuf9
2013-11-25 09:42:15 +01:00
Christophe Simonis 7ba1d747cc [FIX] html_sanitize: handle the case of empty documents (after sanitization).
[IMP] test_mail: do not mute logger

bzr revid: chs@openerp.com-20131113113715-tzaog0d6o2u4q0x4
2013-11-13 12:37:15 +01:00
Stefan Rijnhart 7de17a9358 [FIX] Keep backwards compatibility with Babel 0.9.6
bzr revid: stefan@therp.nl-20130918074505-59q1fs3ixlev1ein
2013-09-18 09:45:05 +02:00
Stefan Rijnhart a9b8936a4d [RVT] Undo previous fix
bzr revid: stefan@therp.nl-20130918074407-ae6yu2f001vxl0le
2013-09-18 09:44:07 +02:00
Stefan Rijnhart b224b40fac [FIX] Restore compatibility with Babel > 0.9.6
lp bug: https://launchpad.net/bugs/1226576 fixed

bzr revid: stefan@therp.nl-20130917122312-r6s7dgzdsfil7xyg
2013-09-17 14:23:12 +02:00
Vo Minh Thu 43ff43383e [MERGE] lang: added Amharic (Ethiopia) language.
The corresponding web branch was merged in january.

bzr revid: vmt@openerp.com-20130702141733-mpk2163pclupwwqs
2013-07-02 16:17:33 +02:00
Christophe Simonis e383386a79 [FIX] correct stripping of arguments when _reexec() OpenERP
bzr revid: chs@openerp.com-20130612151912-m19okjsdkjo12qnt
2013-06-12 17:19:12 +02:00
Christophe Matthieu 600f03b294 [FIX] html2plaintext: bug 1159782
bzr revid: chm@openerp.com-20130329154130-56wjtfrj41eatxl6
2013-03-29 16:41:30 +01:00
Ravi Gohil (OpenERP) bdde088d08 [FIX] re-importing the translation from a file(.csv, .xml) updates the terms in ir_translation table but does not update it in cache memory, need a server restart to take those change effect in interface. (Maintenance Case: 587178)
bzr revid: rgo@tinyerp.com-20130318133338-djkx3ykbkitvbzeb
2013-03-18 19:03:38 +05:30
Cedric Snauwaert f05aff8ac9 [FIX]tools/mail: fix regex when sanitizing html containing mail address
bzr revid: csn@openerp.com-20130308104850-02nfuaxdr91bo0nx
2013-03-08 11:48:50 +01:00
Olivier Dony 527ef066dd [REVERT] tools.translate: undo rev 4874 refactoring and renaming `trans_parse_view`, was meant for trunk
rev 4874 = rev-id xmo@openerp.com-20130306095720-3277aw0rq9pzpsw4

bzr revid: odo@openerp.com-20130307164558-alvl7hcov2uhqxbw
2013-03-07 17:45:58 +01:00
Christophe Simonis ab2dd715de [FIX] module loading: allow addons path entries to have substring of others.
i.e. having ./addons/ and ./addons2/ is now possible

bzr revid: chm@openerp.com-20130307131104-ju2n7zm7yvced68h
2013-03-07 14:11:04 +01:00
Xavier Morel 7e7a8b44a9 [IMP] deduplicate trans_parse_view code, rename for clarity
also correctly handle all translatable attributes in a <attribute name=...> extension tag

bzr revid: xmo@openerp.com-20130306095720-3277aw0rq9pzpsw4
2013-03-06 10:57:20 +01:00
Chris Biersbach 61eb94fb58 [MERGE] OPW 585261: translations: corrects extraction of translation for placeholders
bzr revid: cbi@openerp.com-20130305091225-kkpeb6i8yohce5if
2013-03-05 10:12:25 +01:00
Antony Lesuisse d19777aa1d [FIX] tools image thumbnailing jpg into png
bzr revid: al@openerp.com-20130220222612-g0j6d2a7az0u53hi
2013-02-20 23:26:12 +01:00
Dhruti Shastri c0e0110f42 [translation] : placeholders are missed out for Translation (Case:585261)
bzr revid: dhs@tinyerp.com-20130219095601-ncsy6tnfns1xz4ls
2013-02-19 15:26:01 +05:30
Dhruti Shastri 01eb26c35a [translation] : placeholders are missed out for Translation (Case:585261)
bzr revid: dhs@tinyerp.com-20130219084856-ab44isuegq7w31wo
2013-02-19 14:18:56 +05:30