Commit Graph
115750 Commits
Author SHA1 Message Date
Christophe Matthieu db37f9c4ef [FIX] web_editor: wrong display for td in Apple Mail
the td are displayed with wrong background color if the td tag is empty
2018-04-23 16:44:57 +02:00
Toufik Benjaa e34b8b07b4 [FIX] stripe: Fix float representation error
- Stripe needs to have the amount in integer, so we have to multiply by 100 the amount.
  Which sometimes create float representation errors and remove/add ~1 cent on some transactions (i.e 72.60€)
2018-04-23 16:28:08 +02:00
Martin Trigaux eccb2bcf76 [FIX] base: do not crash on gravatar timeout
ConnectionError is raised when there is no internet connection
if case of timeout a ConnectTimeout or ReadTimeout is raised.
It was not catched.

requests.exceptions.Timeout catches both
2018-04-23 15:20:36 +02:00
Christophe Matthieu 4809091b15 [FIX] website_blog: wrong parse background-image generate console error 2018-04-23 14:28:00 +02:00
Goffin Simon 32d5a31364 [FIX] mrp: Wrong decimal format in user error
When the produced quantity was a float, it only displayed the integer part.

opw:1837334
2018-04-23 14:06:34 +02:00
Nicolas Martinelli 899ae6d3da [FIX] account: print invoice
- Create a user A with group `group_sale_salesman` but no Accounting &
  Finance group set
- Create and validate a SO, create the invoice
- With another user B, pay the invoice
- Print the "Invoices" with A

An access error occurs.

The error is due to user A not having the rights to see the payments.

We set a group on the corresponding report to avoid a user without
proper rights to print it.

opw-1837845
2018-04-23 13:35:05 +02:00
qsm-odoo 61c32429a6 [FIX] web, web_editor: restore report edition feature
Since 11.0, reports could not be edited at all anymore. This is due to
the fact the editor files were refactored but the report feature is not
correctly organized since it was merged with the 'web' app. Indeed, the
'web' app is still calling files and assets of the 'web_editor' app which
is not a dependency (but it is working as 'web_editor' is auto-installed
with 'web').

opw-1826599
opw-1834971
Closes https://github.com/odoo/odoo/issues/24034
2018-04-23 12:57:51 +02:00
Nicolas Martinelli adfec42561 [FIX] base_import_module: imported module version
- Create a simple module, set version to 2.0
- Import the zip file

The 'Latest Version' (field `installed_version`) is set to 11.0.1.0,
while one would expect 11.0.2.0.

There are several reasons for this. First, the method
`get_values_from_terp` doesn't return the version, so at this point the
information is already lost. Then, the field `installed_version` is a
computed field which retrieves the version from the `__manifest__.py`
file. In the case of an imported module, there is no such file in which
we can look up for the value (even though the imported module contained
one).

To avoid this, we explicitly set the 'Installed Version' (field
`latest_version`) to the version retrieved at import. Since this field
refers to the version installed in the database, it makes sense to use
it this way. Moreover, in the case of imported modules, we use the value
of `latest_version` for `installed_version`.

Fixes #23988
opw-1833522
2018-04-23 09:58:24 +02:00
David Arnold 71862789f2 [FIX] ORM code comment
Make misleading comment more precise, made debugging harder than needed be.
2018-04-23 09:31:50 +02:00
Odoo Translation Bot 379b735962 [I18N] Update translation terms from Transifex 2018-04-22 04:11:42 +02:00
RomainLibert 6941de185c [FIX] website_sale: make automatic invoicing more usable
In V11 with automatic invoicing set in website settings, it's no longer
possible to confirm an online order paid with wire transfer without
registering the payment. A user might want to confirm the order and then
register the payment.

Deactivates the `Mark As Paid` button on the order. (by removing the
xpath)

Task #1819491
Closes #24347
2018-04-20 17:09:36 +02:00
pka-odooandMohammed Shekha 3fd24cba2a [FIX] web: calendar: show Undefined label if sidebar filter has no value
and keep all those filters at last. (PR#20463)

e.g. If field used in color attribute of calendar view does not have value then such sidebar filters will not have string besides filter checkbox
in such cases we should set Undefined string and put all those filters at last in filter list
Currently we can see issue in calendar of manufacturing orders in db with demo data

Related to Issue #1778360

Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-04-20 16:29:50 +02:00
William Henrotin d8221eab30 [FIX] stock: update qty_done in move wizard
Scenario : Create a transfer on a product tracking by lot. Update the
operation type "Receipt" by unchecking the "show reserved" option.
Open the Register lots, pack, location wizard and set some lots with a
quantity done. The quantity done field is not updated in real time.

Issue :
The depends function on quantity_done is triggered only on move_line_ids
but "show reserverd" option replace move_line_ids by
move_line_nosuggest_ids in the wizard.
2018-04-20 16:02:12 +02:00
Martin Trigaux 82de88b066 [FIX] mail: cover more cases for URLs
Transifex URLs have an original scheme using #lang, followed by the module or
'$' (for any module) and the searched text can be quoted

Before this commit the link was cut after
https://www.transifex.com/odoo/odoo-11/translate/#fr/, making the link not
clicable

Closes #24346
2018-04-20 15:45:08 +02:00
RomainLibert dab5a83132 [DOC] views: add documentation for gantt view attributes
Closes #24341
2018-04-20 15:27:29 +02:00
Martin Trigaux 794e1cbb29 [I18N] crm: update source terms
To reflect the (unstable) changes made at 002bf77df3
2018-04-20 14:05:51 +02:00
Simon Lejeune 383947646f [REF] stock: rounding issues
There's a certain configuration of UOM that is not correctly handled in
the v11 stock:
- create a move with an UOM having an higher factor than the product's
  UOM
- this higher UOM has a rounding of 1.0, meaning it doesn't allow
  partial reservation
- use the product's uom in this move and enter quantities that aren't
  expressible in the move's uom

A practical example is to set the rounding of dozen at 1.0, set the uom
of a product to units, create a move for a dozen and create a new move
line with 8 units.

The first issue is the `quantity_done` field, that uses an half-up
rounding on the `qty_done` field of each move line and sum them. When
applying this logic to the previous example, `quantity_done` field would
be 1.0, meaning we won't make a backorder for the missing 4 units. We
fix these issue by summing a non rounded qty_done and afterwards
rounding this value to the general products'UOM. This mean
`quantity_done` is technically not be expressible in the move's uom, but
keeping this value close to the reality will allow to handle the
backorders and extra moves correctly.

The second issue is that the backorder is always expressed in the move's
uom. In the previous example, this would mean creating a backorder of 0
dozen. In v10, an error was throwed, saying this operation is
impossible.

The `_prepare_move_split_vals` previously always received the quantity
of the backordered move in the uom of the original move. This is a
remnant of the v10 implementation where, if the quantity to backorder is
not expressible in the original move's UOM, an error was throwed. We now
pass the used uom via a context key to not update the method signature,
as it is probably legitimately overidden by custom modules. This way, in
the previous example, a backorder of 4 units is created.

The last issue is in `_action_assign`. Let's say you have 8 units in
stock and you want to reserve a dozen, the system will reserve 8 units
and then convert back 8 units in dozen, meaning a dozen was reserved.
This resulted in awkward situation where more items than available were
reserved, and the famous "cannot unreserve more than what's available in
stock" was throwed at almost each operation. To solve this, we convert
the not-yet reserved quantities back and forth in both uom. This
prevents partial reservation when not allowed, which is good. We had to
adapt some lines of `_action_assgn` that expected
`_update_reserved_quantity` always at least partially reserved the move.
It is now possible that it doesn't reserve anything.

We also normalize the quantity with a greater decimal precision when
deciding if we open the immediate transfer wizard or not (in the
original exemple, if you enter a single unit the immediate transfer
wizard would be openned because 0 was done in the UOM of the dozen). We
also prevent to enter `qty_done` on the move line if the value doesn't
honour the rounding of the UOM.

We introduce two tests, a simple  `_action_assign` in MTS and a more
complete MTO scenario with backorders, extra moves and invalid qty_done.

opw-1835186
opw-1835946
2018-04-20 11:26:17 +02:00
Odoo Translation Bot 6ff8eeea36 [I18N] Update translation terms from Transifex 2018-04-20 11:22:41 +02:00
Xavier Morel b41c4396dd [FIX] handling of empty/absent modules in xids
Restore behaviour of not adding the separating dot if the module field
of an ir.model.data record is empty. This is useful/important for
interop with external systems.
2018-04-20 11:03:33 +02:00
Nicolas Lempereur 96ce375c61 [FIX] models: more than one prefetch in onchange
When a record fields are prefetched, the currently accessed record is
prefetched as well as PREFETCH_MAX (=1000) minus currenly accessed
records.

Since 439fa826 the id field was thought as "prefetched" but was not,
which caused that in an onchange, we would have a prefetching as follow
for 1200 records:

- get records 1-1000
- get record 1001 (1001-1200 INTERSECTION 1-999 (id) + 1001 (current))
- get record 1002 (1002-1200 INTERSECTION 1-999 (id) + 1002 (current))
- get record 1003 (1003-1200 INTERSECTION 1-999 (id) + 1003 (current))
- ...
- get record 1200 (1200 INTERSECTION 1-999 (id) + 1200 (current))

So we would do 201 queries instead of 2 when prefetching the records.

The added test without this change failed the query count with:

 "AssertionError: 284 not less than or equal to 5 : admin"

opw-1837548
opw-1837552
closes #24326
2018-04-20 10:54:29 +02:00
Nicolas Martinelli 9daf3f85a8 [FIX] stock: search on quantity
- Create a stockable Product A
- Get create an incoming picking at date D for A
- Go to Inventory > Report > Inventory, and search for the the inventory
  at date D-1.
- A should appear with a quantity on hand of 0.
- Filter on 'Available Products'

The product still appear in the list with a quantity on hand of zero.

The optimized method `_search_qty_available_new` is used, although it
doesn't take into account dates.

The original use case for this optimized method was to quickly get
products with stock on hand, i.e. products with quants without needed
information of stock moves.

opw-1833510
2018-04-20 10:22:58 +02:00
XavierDo dea07fc291 [IMP] project, portal: group tasks by project on portal.
The portal view for tasks previously listed all task of all projects
without grouping them. It was a problem, mainly when we want to make
the distinction on project label_tasks, to make the difference
between tasks, issues, ... Grouping task by project by default allows
to show the label_tasks before each project.

Grouping the tasks removes the possibility to define a primary
ordering. We want to be able to ungroup the tasks in some cases.
The implentation was done in the portalsearch bar adding
a group by option. The portal proposes two grouping options,
project (by default) and none (to keep strict ordering).

Task: #1827950
PR #23769
2018-04-19 17:22:00 +02:00
Géry Debongnie b8bf945335 [FIX] web: do not change pager when discarding changes
Here is a scenario that could happen before this commit:
1. go to a list view with more than one record, say 3
2. click on the 3rd record to open the form view
3. the pager says 3/3
4. click on edit button
5. click on discard button
6. the pager says 1/3 (but the record displayed is still the same)

It is often necessary to restore the offset for the sub records, because
the number of pages in a one2many could have changed.  However, it is
not a good idea to do that for the main record, since it interferes with
the usual flow of operations.
2018-04-19 17:15:26 +02:00
Géry Debongnie 6c97aeee8d [FIX] web: use FieldText as fallback for html fields
Currently, the default field widget of type html is not defined in the
web addon, but in the web_editor addon.  It uses the summernote library
and different assets.

The web_editor addon is defined with auto_install=true, so it is usually
not an issue.  However, it could happen that there is some issue with
the web_editor asset bundles.  In that case, any form view with a field
of type html will crash.

With this commit, we define a default widget of type html in the web
addon.  This will render as text (so, not exactly what one might
expect), but it is still better than making the web client unusable.
2018-04-19 17:15:26 +02:00
Christophe Simonis 841f3914cc [MERGE] forward port branch saas-15 up to 75853066a1 2018-04-19 13:12:55 +02:00
Christophe Simonis 75853066a1 [MERGE] forward port branch saas-14 up to c638cb4d56 2018-04-19 13:10:53 +02:00
Christophe Simonis c638cb4d56 [MERGE] forward port branch 10.0 up to 23431389c3 2018-04-19 13:10:12 +02:00
asa-odoo 1d1fd8219c [FIX] website: fix design of mobile preview close icon
The broken design prevented to click on the close button.

task-1817880
2018-04-19 13:00:21 +02:00
Nicolas Martinelli dccef8e41d [FIX] mail: auto-subscribe at user creation
Auto-subscribe to channels at user creation.

opw-1834031
2018-04-19 10:15:10 +02:00
Nicolas Martinelli 386c91b856 [FIX] account: missing widget
A Many2many field is unusable in a list view without the proper
widget...

opw-1837903
2018-04-19 10:14:13 +02:00
Raphael Collet c9caf55177 [FIX] models: bad setup of inherited custom fields
Assume a custom field F is defined on model 'res.partner'.  The setup of F may
silently fail because of missing stuff.  In that situation, setting up the
field inherited from F on model 'res.users' should also silently fail.

To reproduce the bug, install Invoicing, create a related custom field F on
'res.partner' with 'property_account_position_id.active', and install another
module.  Setting up F after loading module 'base' will fail because the field
'property_account_position_id' does not exist yet.  The error is not caught by
the inheritance of F on model 'res.users', and the installation crashes.
2018-04-19 10:00:49 +02:00
Josse Colpaert 8c64159b88 [FIX] stock_account: valuation report needs company_owned in context
When calculating the stock_value of a product,
the system will take into account all the locations
that have this company as company.  (that way if owner_id
is not set, the company_id on the location is the owner (virtual: not set))

The Qty on Hand field takes into account however
the quantities that are in the warehouses.

This could lead to weird situations where the Quantity On Hand is 0
and so the record is not shown, while the stock value is positive.
(e.g. stock in Transit)

In order to use the same logic for both fields, we pass company_owned=True
in the context.
2018-04-18 17:42:22 +02:00
Aaron Bohy 05589db823 [FIX] web: don't ignore required attrs on image fields
Before this rev., falsy image fields could be saved even if they
were required.
2018-04-18 17:40:09 +02:00
Raphael Collet 23431389c3 [FIX] models: bad setup of inherited custom fields
Assume a custom field F is defined on model 'res.partner'.  The setup of F may
silently fail because of missing stuff.  In that situation, setting up the
field inherited from F on model 'res.users' should also silently fail.

To reproduce the bug, install Invoicing, create a related custom field F on
'res.partner' with 'property_account_position_id.active', and install another
module.  Setting up F after loading module 'base' will fail because the field
'property_account_position_id' does not exist yet.  The error is not caught by
the inheritance of F on model 'res.users', and the installation crashes.

OPW 1835872
2018-04-18 17:26:05 +02:00
Toufik Benjaa 0e49ccc419 [FIX] payment: Save payment token only if user is connected
- Fix an issue where the transaction were always set a 'form_save' thus always creating payment tokens.
- Fix an issue where when the customer paying while not being logged in was crashing.
  The issue is due to the fact that we are creating payment transactions linked to no partners, doing so it crashing the code when creating the payment token with no partner set.
2018-04-18 16:49:53 +02:00
Martin Trigaux 8550cf28e8 [IMP] doc: add link to qweb variable syntax
To mention you can use the {{ var }} syntax too

Closes #12035
2018-04-18 16:25:42 +02:00
Martin Trigaux c74f975994 [FIX] base: correct Arabic iso_code
The Arabic we use on Transifex is "simple" Arabic, not the one from Syria.
The .po files we synchronise are named 'ar.po', not 'ar_SY.po'

Change the iso_code to match the one we actually use.
transifex module relies on the iso_code to make its URL
2018-04-18 15:51:30 +02:00
Raphael Collet 87b42ad9a8 [FIX] models: make group by date and order by date work together
The issue occurs when `read_group` is called with a date/datetime field to
group and order on, and the group_by is qualified, such as:

    model.read_group(..., groupby=['date:week'], orderby='date')

The ORDER BY clause in the query should use the same term as the GROUP BY
clause for the corresponding field.

OPW 1834148
2018-04-18 15:47:30 +02:00
len-odoo 7671e0c30d [FIX] calendar: fix event sorting function with relational fields
When working with relational fields, the sorting function would
compare empty recordsets with Strings (the field value),
crashing in the process.

This is essentially an addendum to previous commit
b6c962e62a
which fixed the sorting for non-relational fields.

opw 1831457
2018-04-18 15:15:47 +02:00
Christophe Simonis 2c1c9c21f1 [MERGE] forward port branch saas-15 up to 16ec176620 2018-04-18 14:43:35 +02:00
Martin Trigaux 41e7df7880 [FIX] transifex: adapt the URL scheme
The search patterns have changed on Transifex
While the URL is still backward compatible, it may change in the future
2018-04-18 13:59:56 +02:00
Christophe Simonis 16ec176620 [MERGE] forward port branch saas-14 up to 67054b6dcb 2018-04-18 13:49:24 +02:00
Christophe Simonis 67054b6dcb [MERGE] forward port branch 10.0 up to 2f037a13ca 2018-04-18 12:14:53 +02:00
Florent de Labarre e155244007 [FIX] sale_stock: access rights when updating delivered quantities
If a user only has the stock user access rights, he's not able to
validate or write on a move that has to update the delivered quantities.

Closes #23782
opw-1835138
2018-04-18 11:56:36 +02:00
Yannick Tivisse a78442194a [FIX] fleet: Track driver modifications on vehicles 2018-04-18 11:53:32 +02:00
Arnold Moyaux a6e2830631 [FIX] barcode: do not trigger barcode on pending views
The check on the event target and the barcode target is done outside
the check on barcode found. That result in a warning for each modal/form
view that is pending.

This commit do the check before doing any operations in order
to directly stop if the event target is not similiar to listening
barcode target
2018-04-18 11:50:48 +02:00
Arnold Moyaux e5305ca8b7 [FIX] barcode: use the same process for quantity listener
The barcode scanner and the quantity listener do not use
the same proccess although they act for the same operation.
(For example the quantity listener trigger onchange server side
while the barcode scanner not if 'notifychange' key on the
active_barcode is set to False)

Since quantity listener is based on candidate we could directly
call the _barcodeSelectedCandidate method in order to have a common
behavior and code.
2018-04-18 11:50:48 +02:00
Christophe Simonis 2f037a13ca [MERGE] forward port branch 9.0 up to cf163d19ee 2018-04-18 11:32:27 +02:00
Lucas Perais (lpe) 20f5f625f4 [FIX] pad: prevent concat bool and string
Before installing pads, create a second company
On the first company, create a task and initialize its pad

Switch companies and try to edit the task

Before this commit:
There is a traceback because since the pad credentials of the second company are not set,
the url cannot be computed

After this commit, we prevent the Null field to concat with a string
hence there is no traceback

OPW 1837059
closes #24263
2018-04-18 11:03:22 +02:00
Nicolas Martinelli ffdfbed42c [FIX] calendar: avoid memory overflow
On a DB with thousands of events including recurring ones, fetching the
complete list of events might lead to a memory overflow due to the
prefetching of all virtual events.

We reduce the memory footprint by handling no more than 50,000 records
at a time and clearing the cache at each step. This limit is purely
arbitrary, but seems to be a good compromise between performance and
memory usage.

opw-1832482
2018-04-18 08:17:50 +02:00