Commit Graph

93269 Commits

Author SHA1 Message Date
Denis Ledoux 547204b7f4 [IMP] logging: store logs in database in multi databases env.
The server parameter `log-db` gives the possibility
to store the logs of a server in a specific database,
in the ir.logging model.

Unfortunately, it wasn't possible to store these logs within
the database from which the logs came from in a multi databases
environment (e.g. the SAAS).

This revision gives the possibility to store the logs
within the database where the logs come from,
using --log-db=%d (inspired from the --db-filter arg)

We also added the possibility to change the level of logs to store in
the database, with the --log-db-level argument, which is set
by default to `warning`.
2015-05-07 15:11:58 +02:00
Nicolas Martinelli 561346db9e [FIX] stock: forbids possibility to make inventory of all products when a given product is chosen
opw-634388
Fixes #6512
2015-05-07 14:04:26 +02:00
Jeffery Chen Fan 0e5e8d2873 [CLA] signqture for jeffery9 2015-05-07 13:45:03 +02:00
Levent Karakas 81dbbd8d87 [FIX] sale_layout: access rights 0 instead of O
Typo in ir.model.access with a letter instead of a number. 'O' will be
considered as True instead of '0' considered as False.
2015-05-07 12:13:50 +02:00
Denis Ledoux 272e085df4 [MERGE] forward port of branch saas-3 up to da93981 2015-05-07 11:34:48 +02:00
Denis Ledoux da93981cb0 [MERGE] forward port of branch 7.0 up to f300d64 2015-05-07 11:33:59 +02:00
Nicolas Martinelli 610a461099 [FIX] purchase: update and cancel of purchase order line takes into account existing procurements
Update:
When an existing purchase order line is updated, for example if a new procurement was required,
we check if the sum of existing running linked procurements is larger than the quantity in the
purchase order. If it is the case, we update the quantity and the unit price accordingly.
Without this fix, we systematically add the procurement quantity (or the provider minimum quantity)
to the purchase order line, even if the sum of the procurements is smaller than the ordered
quantity.

Cancel:
When a procurement is cancelled, we recompute the unit price of the associated purchase order
according to the quantity and make sure the provider minimum quantity is met. If the required
quantity is zero, we cancel and unlink the purchase order line.

opw: 632175 and 632176
2015-05-07 11:19:28 +02:00
Nicolas Martinelli 5b6dcbb3a8 [FIX] stock_dropshipping: use route with 2 steps for crossdock test 2015-05-07 11:19:28 +02:00
Goffin Simon f300d648a8 [FIX] web: attachment with safari
With Safari, the function content_disposition must return "attachment; filename=\"%s\"" % filename
to avoid that Werkzeug raises an UnicodeDecodeError.

Fixes #6160
opw:634205
2015-05-07 10:13:10 +02:00
Nicolas Lempereur d65dec9eef [FIX] mass_mailing: mismastched mailing list view name
opw-634693
2015-05-07 09:02:39 +02:00
Denis Ledoux dd47b6f5bc [FIX] account: Exchanges rates gain/loss during reconciliations
When processing the reconciliation of a bank statement
within the company currency with an invoice in a foreign currency,
avoid to recompute the bank statement debit / credit within
the currency rate at the time of the invoice when the
`amount_currency` of the bank statement line and the `amount_currency`
of the invoice move line are the same
(while having the invoice move line and the
bank statement move line in the same currency,
and having the bank statement currency and
the company currency the same),
to prevent gain/loss exchanges during currencies conversion.

Computing the amount of the statement line
within the currency of the invoice is useful
to compute the difference of amount paid within the company currency
when a change of currency rates occured between the invoice date
and the date of the payment.

Nevertheless, recomputing the amount in the currency of the company
is useless when the payment currency
and the company currency are the same,
and the amount of the invoice and the statement in the foreign currency
are identical, since the amount is already computed, within the
debit/credit field of the invoice move line.

Besides, this prevents gain/loss changes.
opw-631748
opw-632133
opw-631895
closes #6559
2015-05-06 18:29:47 +02:00
Denis Ledoux 9335fed9fe [FIX] account: debit/credit values for move lines in foreign currencies
When the target currency is the company currency, there
is no need to re-compute the debit/credit amounts of the move lines,
since these debit/credit values already contains the amount
of the move line within the company currency.

Avoiding the recomputation prevents gain/loss during currencies exchanges

opw-631748
opw-632133
opw-631895
2015-05-06 18:29:47 +02:00
Nicolas Martinelli 4392289745 [FIX] account_invoice: residual of invoices in foreign currencies
If a line of the invoice move was in a foreign currency
but its residual amount in this foreign currency was 0,
the `amount_residual` (in company currency) was used,
instead of the `amount_residual_currency`, which
is the residual amount in this foreign currency.

This was due to the fall back with the `and / or` statement.
Using `if / else` instead solves the issue.

This could lead to issues when the residual amount
in the foreign currency was 0, but the residual amount
in the company currency was 0.01, due to the exchange rate
loss.
2015-05-06 18:29:47 +02:00
Denis Ledoux 8aa6aa0c78 [FIX] account: entries analysis with null values in debit/credit
In SQL, the addition/subtraction between NULL and an integer/numeric
returns NULL.

Therefore, if either debit or credit was set to null instead
of 0.0, debit-credit returned null, instead of the actual subtraction

opw-634044
2015-05-06 18:22:16 +02:00
Rui Andrada 2e3fdf3794 [CLA] individual signature for shingonoide 2015-05-06 18:12:42 +02:00
Manuel Vázquez Acosta 7fa432ee11 [CLA] individual signature for mvaled 2015-05-06 18:12:29 +02:00
Alexandre Fayolle a922d39632 [ADD] sale, delivery: tests for sales prepaid flow
Test uses cases for revision b7f1b9c01e
2015-05-06 17:29:37 +02:00
Denis Ledoux 576cf26a53 Revert "[FIX] stock: `product_qty` field is not recomputed at record creation."
This reverts commit a1da6c2132.

This revision was a temporary patch to solve function fields
computation issues, solved thanks to the commit b7f1b9c01e
2015-05-06 17:27:17 +02:00
Denis Ledoux b7f1b9c01e [FIX] models: recompute nested old-style computed field
The `set` method of the one2many class returns a list
of the fields that require recomputation,
the computing of the function fields being delayed
for performances reasons.

Nevertheless, if the `set` method was called
through another `set` method, in other words,
nested `set` calls, the fields to recompute returned
by the second, nested, call to set were never recomputed,
the result list were simply lost.

e.g.:
```
create/write
│set
└─── create/write with recs.env.recompute set to False
    │set
        └─── create
             with recs.env.recompute set to False
```

To overcome this problem, the list of old api style
compute fields to recompute is stored
within the environment, and this list is cleared
each time the store_set_value has done its job of
recomputing all old api style compute fields.

opw-629650
opw-632624
closes #6053
2015-05-06 17:25:44 +02:00
Nicolas Lempereur 6553eb3742 [FIX] website_quote: use sale description for options lines
Use the sale description for suggesteds items.

So when seeing suggesteds items in a quotation, we so the sale description
(if there is one) next to the product name.

It was already done for contained items, but not for the suggested ones.

closes #6565
opw-634507
2015-05-06 15:41:00 +02:00
Raphael Collet 1a535b9d87 [IMP] models: in recompute, do not store fields that should not be recomputed
Consider a new field that uses the same compute method as another existing
field.  When the field is introduced in database, its value must be computed on
existing records.  In such a case, the existing field should not be written, as
its value is not supposed to have changed.  Not writing on the existing field
can avoid useless recomputations in cascade, which is the reason we introduce
this patch.
2015-05-06 15:24:39 +02:00
Denis Ledoux 6b72008c32 [FIX] point_of_sale: products search with ':' in products names
This is related to revision bb913d0.

':' in product names are removed, to avoid issues when
searching products with ':' in their name.

JS replace method only replaces the first occurence, if the
needle isn't set as a regex with 'g', e.g. /':'/g

opw-634547
2015-05-06 14:04:34 +02:00
Nicolas Lempereur a124988c52 [FIX] website_quote: typo for accept button's modal
Correcting typo introduced by commit 0d591ca.
2015-05-06 13:25:05 +02:00
Nicolas Lempereur 4237207000 [FIX] website_quote: css issue for mobile view
When seen from a mobile, the shortcut menu was over the content of the
quote and hid it.

This fix sets the menu inline in the page when he has no place to be on a
column on its own.

opw-633890
2015-05-06 13:24:50 +02:00
Raphael Collet 3e497ea35f [FIX] registry: recompute `pure_function_fields` after every setup
The lazy property `pure_function_fields` was not invalidated upon every setup
of models, and hence could contain old instances of fields.  As every model
setup re-creates instances of fields, the property has to be recomputed.
2015-05-06 09:11:53 +02:00
Denis Ledoux a939a272ef [MERGE] forward port of branch saas-3 up to ae634e7 2015-05-05 17:55:25 +02:00
Denis Ledoux ae634e7a04 [MERGE] forward port of branch 7.0 up to 567ade5 2015-05-05 17:51:31 +02:00
Denis Ledoux 567ade56df [FIX] account: import invoices wizard currency amount
Within the 'import invoices' wizard in bank statements
(addons/account/wizard/account_statement_from_invoice.py)

Prevent currency rate differences when the statement
currency is within the company currency (and therefore
the debit/credit fields are already within the currency
of the statement)

opw-631895
Closes #6504
2015-05-05 17:48:18 +02:00
Raphael Collet 0c665edb66 [FIX] models: make sure an environment is available when we access field.digits
Accessing `field.digits` can crash if no environment is available at that
point.  This happens in function `get_pg_type()`, which is called from method
`_auto_init()`.  An environment is simply created in the method's scope to be
available for `field.digits`.
2015-05-05 17:33:16 +02:00
Raphael Collet 071152216f [FIX] fields: when computing digits, use an existing cursor instead of a new one
The computation of property `digits` was creating a new cursor to call the
function that determines digits.  This technique is fragile because the current
cursor may have pending updates that the new cursor will not see.

The issue was discovered by Cécile Tonglet (cto).  She observed an infinite
loop during a database migration, and a traceback inside the loop showed the
presence of the `digits` property.  This change fixes the infinite loop issue.
2015-05-05 17:33:16 +02:00
Lionel Sausin 9d7b6aa67f [FIX] mrp: default sequence on bom line
To avoid null sequence
Fixes #6074
2015-05-05 17:25:21 +02:00
Christophe Simonis 94fc45b7e7 [FIX] mass_mailing: create an index on mail_mail_statisctics.mail_mail_id
As deletion of mail.mail records is frequent, we need to have an index
on this column to speed up deletion
2015-05-05 14:40:07 +02:00
Arthur Maniet bb252f201e [FIX] account: bank reconciliation widget: correctly set the 'New' button a new line (continuation of bf9544d7d4) 2015-05-05 12:50:37 +02:00
belkacem77 71c76aebc5 [CLA] sign for belkacem77 2015-05-05 11:36:24 +02:00
Julien Legros 8e6f9be08f [CHG] web: odoo.com account fallback url
The default odoo.com account page is now located at
https://accounts.odoo.com/account.
2015-05-05 11:29:15 +02:00
Jeremy Kersten 9f93a9ae1c [IMP] ir_http: add facebookinternalhit in the list of bot.
Avoid redirect in en_US if lang is installed  when a link is added via Facebook
2015-05-05 10:55:00 +02:00
belkacem77 72cc8b99a9 [ADD] web: Kabyle datejs file
Missing globalisation file for kab_DZ
2015-05-05 10:46:55 +02:00
Martin Trigaux 7dd2d201a0 [FIX] web: localisation for Lao and Bosnian
The datejs globalisation files are loaded based on the user's language.
If the file is not present, the loading crashed and the user could not access to
the web client.
Adding empty files for lo_LA and renaming bs-BS.js to bs-BA.js for bs_BA (see
65d92da) that were missing.

By the way, this is a 0 bit commit, beat that!
2015-05-05 10:28:17 +02:00
Olivier Dony c667eb06b8 [FIX] website: only consider valid languages in URL path
Improves aea358ca67 and avoid spurious
redirects for URLs that do not match a controller but do not
have a valid language.

When the URL does not match any controller, the language
matcher tried to strip the leading path component, treating
it as a language code. For example:
    /fr_BE/page/homepage
would not match any route, so it would be rerouted internally
as  /page/homepage, after setting `request.lang` to fr_BE.

This breaks the magical 404 handler that allows ir.attachment
entries to be mapped to static URLs. Due to the internal rerouting,
the mapping of e.g. /website_mycompany/static/src/image/logo.png
would be rerouted to /static/src/image/logo.png and not match
the mapped URL anymore.

Now the stripping of the path component will only occur if
that path component matches an installed language code.

The consequence is that URLs containing uninstalled language codes
will now lead to 404 errors - an acceptable trade-off (e.g.
when an older version of the website is still indexed by a search
engine)
2015-05-05 10:12:22 +02:00
Arthur Maniet ce32867a90 [FIX] account: bank statement reconciliation:
- ctrl-enter only persist balanced reconciliations
- give a reconciliation proposition only if there's an unambiguous match
- added some missing tanslations
- use default order to display statement lines in reconciliation widget
2015-05-05 09:55:36 +02:00
Nicolas Martinelli 7feb9c112b [FIX] report,qweb: use non-beaking space between amount and currency
Fixes #6369
opw-633975
2015-05-05 08:27:04 +02:00
Denis Ledoux 90cb409be9 [FIX] stock: procurement set as done of sets bom.
In the case of sets, several stock moves can have
the same procurement.

Therefore, appending procurements in the list `procurement_ids`
without checking if the procurement isn't already in the list
could lead to having several times the same
procurement in that list,
and could therefore lead to the check of the same procurement
over and over, leading to performances issues and the fact you cannot
call `write` on a list having several times the same id.
See models.py 3875

Using a set instead of a list solve this issue

opw-634393
2015-05-04 18:05:17 +02:00
belkacem77 d377f5690e [ADD] base: Kabyle language
Add a new language: Kabyle language
2015-05-04 16:56:03 +02:00
Erwin van der Ploeg 782deef905 [FIX] hr_timesheet_invoice: untranslated warning message 2015-05-04 15:07:51 +02:00
Mathieu Le Marec - Pasquet f6a4c932b0 [FIX] auth_ldap: anonymous connection
LDAP allows anonymous authentication with no password. In such case
conf['ldap_password'] is None so converting would fail.
Fixes #5763
2015-05-04 14:43:09 +02:00
Mathieu Le Marec - Pasquet 1593c5c482 [CLA] makinacorpus / kiorky: sign cla 2015-05-04 14:39:03 +02:00
Anthony Muschang 2925bb5c9a [FIX] models: Always use MissingError when a document is missing
As done in write and already in next version (see 0fd773a), accessing a deleted
record (through read or check access rights) should always return a MissingError
instead of the generic except_orm.
This will allow code ignoring deleted record (e.g. 'recompute' method) to safely
process the other records.
Fixes #6105
2015-05-04 13:39:21 +02:00
Goffin Simon 7d79520559 [FIX] web_graph: graduations on Y axe
For bar chart, the graduations along Y axe must be in language format
of the user.

opw:631659
2015-05-04 12:16:17 +02:00
Nicolas Lempereur dd88f3c82f [FIX] search: searching fields.property not set
When searching if a many2one property field is not set, there may be less
results since only the ones with a reference set to NULL are returned.
We should also get those not in the table.

This commit change this case so instead of returning ['id', 'in', {matching non-set ids}],
the ['id', 'not in', {matching set ids}] is returned.

e.g: if (1, 3, 8) are set, (5, 9) are not set. ['id', 'not in', (1, 3, 8)] would
be returned instead of ['id', 'in', (5, 9)] which might not select all non-set
property fields.

closes #6044
opw-631057
2015-05-04 12:00:22 +02:00
Denis Ledoux 1288536c03 [FIX] point_of_sale: sale details, start/end date with user tz
opw-633998
2015-05-04 10:30:57 +02:00