Commit Graph
246 Commits
Author SHA1 Message Date
Christophe Simonis 74033eb007 [MERGE] forward port branch saas-11.2 up to 90f8f17fb4 2018-04-16 19:50:50 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Christophe Simonis aab0908818 [MERGE] forward port branch 10.0 up to c92d43c04b 2018-04-16 12:33:49 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
xmo-odoo 14840d2064 [IMP] core: modernize tgz translations export
* don't use FS to do export
* update translations export dialog to fix outdated links (launchpad
  & 6.1 translations doc)

Note: can't use ``TarFile.gettarinfo`` to create the TarInfo object
because it wants an actual file object with a ``name`` attribute and
possibly even an fd.

closes #22798
2018-04-04 13:12:33 +02:00
Christophe Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Thibault Delavallée cd69ea8f9a [REM] crm, project: remove support of mail-based record update
Currently crm and project parse incoming email body following an old
syntax to find some "set field - value" lines in the email content. It is
used to update the record linked to the discussion directly from the email.

However this feature is undocumented and not really supported anymore.
Moreover we don't think being able to update records from emails is a
reliable way of working. Moreover those update is limited to

 * revenue and probably for leads; this should totally be managed from
   the pipeline view by lead / opportunity responsible;
 * priority update coming from a "priority" entry in the incoming email;
   this code seems strange as priority is probably not standard in email
   headers;
 * planned hours for project; this should be managed by project user
   and managers through dedicated views in Odoo;

Let us remove that old feature and let people use desktop or mobile
interface to update their records.
2018-03-16 11:00:35 +01:00
Sagar Ahirrao 05e02059f0 [IMP] base: resize partner image with actual aspect ratio
Purpose of this commit is to finally stop adding extra padding to
website logo. Indeed not giving square logos lead to padding added
to images, leading to not so beautiful logo that makes people sad.

Before this commit
 * partner's image was resized to square 1024x1024. Extra padding was added
   if user provided rectangle image;
 * due to this website logo resized to square when rectangle logo provided;

After this commit,
 * sizes dict can be passed in image resizer of tools;
 * e.g. tools.image_resize_images(vals, sizes={'image': (512, 512),
   'image_small': (128, 128)})
 * image field in partner will resize with max width 1024 and height based
   on given image ratio (still image_medium, image_small will be default
   square images);
 * now website logo will respect actual aspect ratio

This commit is related to task ID 31994 . Future commits should probably
clean all that mess, but at least it seems we have something that works.
2018-03-15 11:31:06 +01:00
Christophe Simonis c921d94236 [MERGE] forward port branch saas-15 up to 3730a0d2df 2018-03-13 12:05:36 +01:00
Christophe Simonis 3730a0d2df [MERGE] forward port branch saas-14 up to 0e898eae35 2018-03-12 18:48:15 +01:00
Christophe Simonis 0e898eae35 [MERGE] forward port branch 10.0 up to 0440e25380 2018-03-12 18:16:02 +01:00
Martin Trigaux 4fc0947850 [FIX] tools: do not escape \t
msgid ""
"You cannot set a negative product quantity in an inventory line:\n"
"\t%s - qty: %s"

Was creating a ir.translation record with a src as

You cannot set a negative product quantity in an inventory line:
t%s - qty: %s

('t' instead of \t)

Closes #23541
Fixes #23521
2018-03-08 13:47:12 +01:00
Christophe Simonis 5ad55264e4 [MERGE] forward port branch saas-15 up to b04c8eae6b 2018-03-01 18:02:30 +01:00
Christophe Simonis b04c8eae6b [MERGE] forward port branch saas-14 up to 153ae5e8b8 2018-03-01 17:26:43 +01:00
Christophe Simonis 153ae5e8b8 [MERGE] forward port branch 10.0 up to a6855b31c9 2018-03-01 16:51:37 +01:00
Christophe Simonis a6855b31c9 [MERGE] forward port branch 9.0 up to d4ec6b75ac 2018-03-01 13:25:10 +01:00
Christophe Simonis eefca5d492 [MERGE] forward port branch saas-11.1 up to 73610ff992 2018-02-05 16:20:48 +01:00
Christophe Simonis 33bf2fe922 [MERGE] forward port branch 11.0 up to aed8f45346 2018-02-05 15:06:55 +01:00
xmo-odoo 43617bbcb6 [FIX] type error when exporting to tarfiles
When exporting to a tarfile, we first export each module's translations
to a file on the FS, then create a tarball from all of them.

With the P3 bytes/string split, translation export was defined to export
to a bytes IO object in order to work correctly with CSV (which work on
bytes IO for better cross-version compatibility). However the tgz file
export was left opening module's files in `w` mode, which in P3 means
text, which blows up as POFile expects to ultimately write to a bytes IO
object: it uses text, and a StreamReaderWriter is used to translate that
into an underlying bytes IO.

Fix by explicitly opening the files in binary mode.

Fixes #22700
2018-02-02 19:39:51 +01:00
Christophe Simonis e00a447e2c [MERGE] forward port branch saas-11.1 up to 7e469eb77a 2018-02-01 18:20:28 +01:00
Christophe Simonis 7e469eb77a [MERGE] forward port branch 11.0 up to f5e7b86686 2018-02-01 18:15:21 +01:00
Nicolas Martinelli 8ed7570b1c [FIX] tools: float_round DOWN
The result of the following:
```
float_round(2.5, precision_rounding=0.05, rounding_method='DOWN')
```
is 2.45. Instead, 2.5 is expected.

In case of the `DOWN` method, epsilon should be added, not subtracted.
In the meantime, we introduce a slight reorganization of the method to
make it clearer.

opw-805008
2018-01-29 11:06:33 +01:00
Raphael Collet f50c6b1f6c [FIX] tools: align API of groupby on the one of itertools.groupby
The function `stripped_sys_argv` was broken because of `itertools.groupby`
being hidden by the local `groupby`.  Aligning APIs makes the local one a valid
substitution for `itertools.groupby`.
2018-01-25 11:28:13 +01:00
Raphael Collet 6f30f0af9c [FIX] models: behavior with multiple inverse/compute mixed on same fields 2018-01-23 16:41:45 +01:00
Raphael Collet f1d60d2e52 [IMP] api: make the implementation of field protection more robust 2018-01-23 16:41:45 +01:00
Christophe Simonis bd3869bd3a [FIX] core,google_drive: python3 compatibility 2018-01-19 13:42:26 +01:00
Christophe Monniez ad7bf6b9c9 [REM] config, loading: remove test-commit and test-report-directory
As there are few use cases for the --test-commit and --test-report-directory
options, they are removed.
2018-01-18 13:27:33 +01:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
Purpose: When running tests, all the tests for the installed/updated
files are done. This commit adds a 'tagged' decorator that can be used to
tag tests. Combined with a new 'test-tags' CLI option, it adds the ability
to filter which tests are executed. For example, @tagged('slow') will
add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will
only run tests tagged 'slow'.

One can use prefixes to select cases with tags.
'+' or no prefix means that the tests tagged with this tag are selected
for execution. '-' prefix will exclude the tests tagged with this tag.
Exclusion takes precedence over inclusion.

Also, by default, all Odoo tests cases are tagged 'standard' and with
the technical name of the module.
This means that when selecting tests with the 'test-tags'
parameter, if '-standard' is not specified, all tests tags are
going to be executed.
When tagging tests, one can remove such automatic tag by prefixing the
tag name with '-'. E.g. @tagged('-standard') will remove the standard
tag from the test.

Another example, if one wants to test the 'sale' module alone,
even without adding any 'tagged' decorator thos tests can be selected
like that: --test-tags="sale"

Tests are selected or deselected using a TagsSelector. When instanciated,
 a string is passed with comma separated tests selectors like
'+slow,-standard'. When the 'check' method is called  with a test as argument,
it returns True or False if the test has to be executed or not.
2018-01-18 13:20:37 +01:00
Thibault Delavallée cdfe479e2e [MOV] mail: reorder a bit mail thread methods by category
As this class has grown a lot some methods have been put a bit anywhere
in the file. To prepare future improvements it is easier to regroup
them a bit.

remove_accent from mail_alias is also moved to tools in order to separate
tools from business or class specific code.
2018-01-11 11:52:37 +01:00
Pierre Rousseau 9ec0455abc [FIX] tools: fixed missing import in xml_utils 2018-01-04 18:58:38 +01:00
Christophe Simonis 362f0489d0 [MERGE] forward port branch 11.0 up to fe22a0f9ca 2018-01-03 12:28:52 +01:00
Martin Trigaux cab7e0d204 [FIX] *: add missing space in multilines messages
Courtesy of @Yenthe666
2018-01-03 11:09:09 +01:00
Christophe Simonis 8ef7af6afe [MERGE] forward port branch 11.0 up to f96a797fe6 2017-12-06 12:02:58 +01:00
Christophe Simonis 970be94f37 [MERGE] forward port branch saas-14 up to e9c2dcd28d 2017-12-05 14:52:16 +01:00
Lucas Perais (lpe) 2a86e9245c [FIX][BACKPORT] Always round monetary values in database
backport of afef71d6b9

Original commit message:

Let `create` and `write` round monetary field values before sending them to the
database. Pass the values to be written to `field.convert_to_column`, so that
the currency can be retrieved from the values, and the value be rounded.
2017-12-05 13:46:06 +01:00
Xavier Morel 150fc064fd [FIX] product: image changes not sticking everywhere
Fixes #20046

Simply reverting e5ef1c5917 looks to
work *but* since I didn't note the repro case for the issue and don't
remember what it was it may re-introduce previous breakage. Instead,
ensure all "sizes" for the image are reset if any of the sizes is
present *and* Falsy by adding a final case to the conditional.

If any of the image fields is present and non-falsy one of the
previous branches will be taken, so we can just check that any of the
image fields is present at all (this implies it's falsy).
2017-12-05 13:35:51 +01:00
Christophe Simonis 2f99470458 [MERGE] forward port branch 11.0 up to c201cf2b77 2017-12-01 12:55:02 +01:00
Olivier Laurent 046e4ee29e [FIX] anonymization: P3 encoding issues 2017-11-29 16:19:11 +01:00
Thibault Delavallée 6bd5033e7f [FIX] tools: fix location of res.lang.csv file
It has been moved inside base/data insteaf of base/res. Let us adapt code
calling it.
2017-11-28 18:16:24 +01:00
Moises Lopez - https://www.vauxoo.com/ eb90eb42ce [IMP] translate: export empty translations for empty ones
Instead of use the original string by default.

Currently odoo export a PO translation file using the logic:
"If there is not a translation then use the source."

This generate a false 100% of file translated for tools based on PO
files.

This commit change this logic to:
"If there is not a translation then use empty string."

Odoo import a PO translation file supporting empty string because
if a item is empty string odoo use the original source.

Closes #17925
2017-11-21 17:56:28 +01:00
Christophe Simonis c703a2a0c3 [MERGE] forward port branch 11.0 up to d279a3e6d5 2017-11-16 17:55:37 +01:00
Yannick Tivisse 77eb1f82d9 [REM] tools: Remove the yml import engine 2017-11-16 14:49:06 +01:00
Christophe Simonis a094f6318b [MERGE] forward port branch saas-16 up to 745d00362a 2017-11-16 12:40:36 +01:00
Christophe Simonis 5877b7b38c [MERGE] forward port branch saas-15 up to 73e4dacf78 2017-11-15 15:50:36 +01:00
Christophe Simonis 73e4dacf78 [MERGE] forward port branch saas-14 up to 0bf7ab4511 2017-11-15 15:20:52 +01:00
Christophe Simonis 0bf7ab4511 [MERGE] forward port branch 10.0 up to 0fe7989e24 2017-11-15 14:50:46 +01:00
Nicolas Martinelli a9beee42d6 [FIX] tools: lang in formatLang
- Install French language
- Set language of Customer A to French
- Create an invoice due in the past
- Open the Customer Statements

The customer statement of A is translated in French, but the amounts are
formatted in the company's user language (English by default).

We add the possiblity to take into account the lang in the context when
calling `formatLang`.
2017-11-15 12:57:19 +01:00