Commit Graph
114455 Commits
Author SHA1 Message Date
Odoo Translation Bot d6e3463dcd [I18N] Update translation terms from Transifex 2018-01-12 17:48:53 +01:00
Alexandre Kühn 41fe7f9d11 [FIX] web: contexts on field widgets + enforce bin_size for binary
Field widgets now have a key 'context' that let them
extend the context of the dataPoint (e.g. list).

In particular, widgets on binary fields enforce the contextual
item {bin_size: True}, so that the server gives the size of the
binary field as its value, instead of its content.

This change on binary fields reduces network load when accessing
a view with binary fields.
2018-01-12 16:12:49 +01:00
Alexandre Kühn 7813a8e714 [FIX] web: binaryfile field in list views
Revert partially 255e8ca3d9

Removed widget 'download_link', as it was a sub-version of widget 'binary':
it did the exact same thing (representation of binary fields by means of a download link)
in a much better-looking way (download icon + filename as text of the download link,
instead of just a download link with text "Download").

Also, the values of binary fields might be already a human-readable binsize (e.g. 2.52 MBs),
instead of its plain textual string representation in base64:
The contextual parameter 'bin_size', when set to true, does not download the data of binary fields.
As a consequence, the server provides the sizes of the binary, instead of their value.
2018-01-12 16:12:49 +01:00
celm1990 c3e3770f06 [FIX] account: state cancelled not exist on invoice
The domain was using a wrong 'cancelled' state
Bonus: avoid code redundency

Closes #22121
2018-01-12 15:47:39 +01:00
William Henrotin e9b09d4778 [FIX] account, crm, website_sale: wrong link to sale settings
After sepration of CRM and Sales, The xml_id of sales settings action
changed. This patch update old links in web_planner to the new settings.

opw-804426
2018-01-12 13:18:47 +01:00
Nicolas Martinelli b3088532f2 [FIX] account: save due date
Complement of e832fbfd7a

opw-803939
2018-01-12 09:55:40 +01:00
Fabien Meghazi 65b41eb291 [IMP] ir_cron: use 'info' loglevel instead of 'debug' when starting job
This information is important for `ir.cron` troubleshooting hence
deserves a little more love.
2018-01-12 09:34:08 +01:00
Nicolas Martinelli 6d5c2d0bea [FIX] stock: unset warehouses
When 'Applicable on Warehouse' is set to `False`, the list of warehouses
should be emptied.

opw-803678
2018-01-12 08:39:07 +01:00
Nicolas Martinelli 8ab2b099fb [FIX] sale_stock: unecessary dependency 2018-01-12 08:39:07 +01:00
Aaron Bohy 90279c70eb [FIX] web: quick create in empty grouped kanban views
For kanban views with attribute 'on_create="quick_create' set on
their root node, clicking on 'Create' in the control panel should
open the quick create widget in the first column if the view is
grouped and if there is at least one column displayed.

It was working as expected, except when there were no record yet.

This was because the kanban controller used the 'state.count'
attribute of the state (which indicates the total number of records
in the group), whereas it should have used 'state.data.length'
(which is the number of columns).
2018-01-12 08:13:15 +01:00
Aaron Bohy 25b101f15b [FIX] web: Kanban: quick create several records in a row
Before this rev., when quick creating a record in a grouped kanban
view, the quick create widget wasn't automatically re-opened, which
didn't allow the user to quickly create several records in a row
(without clicking each time on the '+').

This desired behavior had been broken by rev. 1d34e26, which aimed
to properly reload the kanban column when a record was created
(e.g. column counter, progress bar...).
2018-01-12 08:13:15 +01:00
Simon Lejeune b7b38ed141 [FIX] stock: remove superfluous track visibility messages
`_run_move` creates the move, calls `_assign_picking` and then confirms it. The
result is that a draft move is added to a picking and then its state is changed to
confirmed. As the state of the picking is computed across its moves and a manual
call to `message_track` is done when any of its move changes its state, there was
a lot of tracking messages in the picking chatter, especially when you confirm a sale
order (a lot of calls to _run_move).

The thing is that this is unnecessary as stock.move’s `_action_confirm` will call
`_assign_picking` later on AND after having changed its state to “confirmed”. Now
a confirmed move is added to a confirmed picking and no message are posted. This
improves considerably the validation of a massive SO.
2018-01-11 16:33:14 +01:00
Géry Debongnie 27dd19c0b9 [FIX] web: prevent crash in some rare cases
When we have a form view with a one2many with an onchange, and with
lines which contains a x2many, and more lines that the limit (so more
than one page), and the read is not in the same order as what is
displayed because we have a widget=handle, then we might have a problem
when we delete one of the lines, if the onchanges tries to change the
x2many.

This is due to the fact that the order of the basicmodel datapoint is
not preserved by the various operations going around.  I think that we
may still have a few other issues of this type, but it is actually quite
difficult to establish.

In any case, this situation is now properly handled.

opw 804530
2018-01-11 16:30:34 +01:00
Nicolas Martinelli 8dcee7f17e [FIX] product: price digits
Complement of cf32a23b92

Closes #21686
opw-800279
2018-01-11 16:10:09 +01:00
Denis Ledoux 78d0a32470 [FIX] web: force a determinist installed modules order for the assets
The backend assets includes a list of the installed modules with:
```
odoo._modules = <t t-raw="get_modules_order()"/>;
```

Because of the randomization of Python 3.5 in the dict keys,
the order of the installed modules could change from time to
time, therefore making the assets being regenerated unnecessarily

This revision is a bit linked to the below one:
f3bb9ae679

In addition to have the dict keys always in the same
order, it's important for the values to always be
the same, and it was not the case for this list
which was in the content of the backend assets,
in various order.

opw-804747
2018-01-11 15:48:08 +01:00
Nicolas Martinelli bc1c72f9af [FIX] sale_stock: test error
`sale_stock.tour` requires `sale.tour` which is defined in
`sale_management`.

Aside from the test failing, this is more logical to add the 'Sales'
menu once the set-up is past a simple 'eCommerce' configuration. Note
that it was intended in the original commit 5dfd342d08, but was
later changed back to avoid issues.

We need to depend both on `sale` and `sale_management` explicitly, to
make sure installing `sale` and `stock` separately will also install
`sale_stock`.

opw-804621
2018-01-11 15:34:06 +01:00
Romain Derie 3ec98ae6b0 [FIX] website_sale: can't send coupon code after an ajax request
Before this commit, an user could only use the coupon form if he didn't perform
any ajax request (eg: change quantity, already sent a code..).
Since the cart html would be reinjected with theses ajax requests, the click
event would not work afterward until the page got fully reload.

Now, we changed the jquery click binding to work with dynamically injected DOM
2018-01-11 15:28:31 +01:00
Nicolas Martinelli 411a9fa326 [FIX] web: autofocus
Support autofocus on notebook pages:
```
<page autofocus="autofocus">
```

This was supported before the web client refactoring.

opw-801259
2018-01-11 15:19:52 +01:00
Raphael Collet 309b6b8e5a [FIX] api: optimize odoo.api.Cache.get_records()
Assuming that `field.cache_key(record)` is independent from `record.id`,
compute the cache key once for all records, and avoid using `browse` on all
record ids.  This makes `get_records` about 20 times faster.

This has a good performance impact on `field.modified_draft()`, which is used
during onchanges for invalidating fields.
2018-01-11 13:52:16 +01:00
Romain Derie 0474de44c0 [FIX] website: unpublished homepage read error + first menu fallback
Before this commit:
1. If the website's homepage is unpublished and a public user naviguate on it,
it will log an access read error in the server. The user won't see the error
though.

2. If the user can't access '/', we serve the first menu's page instead.
This first menu's page can be an unpublished page, resulting in a 403, which is
not convenient.

3. Menus are sorted by sequence, then the ORM sort them by write_date.
Menu with same sequence will be sorted differently every time you edit one of
them. (This issue get hidden/solved if user edit and save the menus with
"Edit Menu" since it will recompute every sequence.)
  - Create 3 pages 'A', 'B', 'C', with 'Add page in menu' enabled
  - Menu is now 'A B C'
  - Edit website.page B (in property dialog), it will write on the page's menu
    aswell
  - Menu is now 'A C B'

Now:
1. We prevent this error by ensuring the page is published and so can be read
by anyone before accessing its properties.

2. We serve the first menu's page that is published

3. We sort menu by id after sequence to keep original order

This closes #21259
2018-01-11 13:33:30 +01:00
Romain Derie bf8519853f [FIX] website: hide menu if related to an unpublished page
Before this commit, if there was a menu entry linked to an unpublished
website.page, the menu would be shown. For restricted users, they would land on
a 403 forbidden.

Now, we dont show website.page's menu if user can't access it.

This closes #21328
2018-01-11 13:30:12 +01:00
Romain Derie 32701aa512 [FIX] website: menus with null URL would throw an error on display
Before this commit, if a website.menu had a URL set to null, it would throw an
error when displaying that menu.
It is normally not possible to do so in v11 but after a migration, menus can be
empty. (eg: Using an empty menu to display a divider in a dropdown menu)

Now we return an empty url instead of an error
2018-01-11 12:49:18 +01:00
Goffin Simon 88fe132a27 [FIX] mail: Wrong title for the image's activity
An activity is always created with sudo, so it's useless to set the
image and the name of the "Administrator" all the time.

Now the image and the title of the assigned person is displayed.

opw:802759
2018-01-10 16:10:03 +01:00
Rémi Rahir 13baea56b9 [FIX] phone_valdation: fix default behaviour for numbers formatting
before this commit, the selection on res.company was by default hiding the country prefix. THe option was not available on res.company view.

We fix the default behaviour and add the option in the res.company view in debug mode.
2018-01-10 15:39:28 +01:00
Martin Trigaux 932ac72c7e [FIX] hr: correct action source model
Should be from hr.employee
At a8326cc6 source model inconsistence was introduced but the bug was revealed
only after 55549f1e where it kept the wrong one

Fixes #20203

PS: this action should be removed in master in favor of hr_org_chart module
2018-01-10 14:18:31 +01:00
Xavier Morel f7323dbe23 [FIX] doc: informal sub-params
Revert 6cb12273e2 which reverted
08d48b0fff.

Issue was the support for sub-parameters (aka @param {type} foo.bar)
where the "parent" parameter was not formal (only present in a
function's docstring, but not in the function's parameters list),
subtype creation would fail to find a root parameter to attach the
sub-parameter to.

This has not actually been fixed, but for the specific case where the
formal parameters list is *completely empty* we fall back on a list of
the docstring's parameters, which works well enough for this case.
2018-01-10 12:36:58 +01:00
Goffin Simon cd05c16641 [FIX] mrp: location_id domain on mrp.routing
Steps to reproduce the bug:

- Create a routing with a Product Location of type view
- Create a MO with this routing
- Click on "Plan" without clicking on "Check for Availability"
- Complete the work orders
- Go back to the MO and try to put it in state "Done"

Bug:

Impossible to set the MO on state "Done". By clicking on "Mark as Done",
it returns:

You cannot take products from or deliver products to a location of type "view"

opw:803580
2018-01-10 11:53:07 +01:00
Martin Trigaux ff0abd214c [FIX] untranslated defaults
The field was translatable but the default value was untranslated

Fixes #22059
2018-01-10 08:57:12 +01:00
Christophe Simonis 55caee6481 [FIX] base: adapt test to new behaviour defined by 7e894aca0b 2018-01-09 19:07:01 +01:00
Christophe Simonis 81d03da360 [FIX] mail: do search at the right time...
Oversight of previous forward-port
2018-01-09 18:50:58 +01:00
Martin Trigaux 7e894aca0b [FIX] models: do not keep the old source in case of copy override
Current behaviour when duplicating a record:

    apply copy override in the user language (e.g. "%s (copy)")
    copy the previous term in all the other languages (including)

So if product was named:

    cheeses (en)
    kaas (nl)
    fromage (fr)

Duplicating the product, while in French, will result into:

    cheeses (en)
    kaas (nl)
    fromage (copie) (fr)

This is a problem if there is a unicity constrain on the field, it will be
raised (there is already a product named 'cheese')

After this PR:

Duplicating the product, while in French, will result into:

    fromage (copie) (en)
    kaas (nl)
    fromage (copie) (fr)

This applies **only** if there is an override of copy

This is detected by comparing the old and new value for the user language

Fixes #7010
Closes #22052
2018-01-09 18:15:47 +01:00
Christophe Simonis a7c2a22310 [FIX] web: adapt new test introduced by previous forward-port 2018-01-09 17:58:06 +01:00
Christophe Simonis 033c7975fa [FIX] stock: remove unknow field from pivot view
Oversight of previous forward-port
2018-01-09 17:37:51 +01:00
Christophe Simonis 6e25eb9b05 [MERGE] forward port branch saas-16 up to 4c410ee6a1 2018-01-09 17:03:07 +01:00
Christophe Simonis 4c410ee6a1 [MERGE] forward port branch saas-15 up to 38b201abce 2018-01-09 16:30:50 +01:00
Christophe Simonis 38b201abce [MERGE] forward port branch saas-14 up to e671cdcc44 2018-01-09 15:54:16 +01:00
Christophe Simonis e671cdcc44 [MERGE] forward port branch 10.0 up to 849d8ffd21 2018-01-09 15:12:51 +01:00
Nicolas Lempereur 3770097183 [FIX] mail: activity extraneous Administrator str
In march 2017 saas-15 on activity message, the create_uid was displayed
with 26940f8d.

In november 2017 saas-14 an activity was always created sudo() with the
change 53ad585bf.

Thus in saas-15 we always have "planned by Administrator for {user}"
not making sense.

opw-804409
closes #22113
2018-01-09 14:04:38 +01:00
Nicolas Martinelli 81d1296323 [FIX] account, stock, website: access rights
1. Create a new user with all the permissions as manager (or at least
   Accounting) except Inventory
2. Login and then go to Invoicing --> Settings
3. Do a minor change, save

An access error occurs.

Since the settings of all modules are smartly loaded in v11, it now
implies that a user must have extra manager access rights to be allowed
to save them. We could have kept separate actions for each setting page,
but we would have missed the fun of access errors.

Anyway, security-wise this is not an issue to force the manager groups
since a user with 'Settings' access rights can change his own rights.
It's just very annoying. Or fun.

Complement of aa65a46fc5

Fixes #21766
opw-801210
2018-01-09 13:19:33 +01:00
Martin Trigaux 4637bdf9bf [FIX] web: properly format translatable string
'Edit <type>View' makes untranslatable content as it is split in 3 and the type
is not translated. e.g. 'Editer FormVoir'
2018-01-09 11:23:18 +01:00
Goffin Simon a7c081941c [FIX] sale: Description of the product 'Downpayment' not translated
When you create a down payment invoice from an SO, the product that is used in the line is 'Down Payment'.
The description of this product, which is visible for the customer, was not translated to the language
of the customer in the SO and in the invoice. It was translated to the language of the user logged.
This fix is made to keep the same behavior for the description of an SO line and for the description
of the invoice line.

opw:803977
2018-01-09 10:19:47 +01:00
Goffin Simon fe0fc9eef4 [FIX] event: Duplicate an event and try to publish it leads to the previous event webpage
- Steps to reproduce the bug:

Go to events ->Duplicate an existing published event
Try to publish that new event

- Bug:

You get redirected to the previous event webpage, which is already published.
Unable to publish the event from that page.

The url used to access the event is computed the function _compute_website_url which
a slugify of the display_name of the event.

opw:804118
2018-01-09 09:59:09 +01:00
Nicolas Martinelli a650f2359b [FIX] mrp: extra move line in sub-location
- Define a Component A tracked by lot.
- Define a Final Product B tracked by lot.
- Create a BOM, e.g. 5 units of A to produce B.
- Get some quantity of A in a sub-location, e.g. 'WH/Stock/Shelf 1'.
- Create a MO for 1 unit of B.
- When clicking on 'Produce', record 6 units consumed instead of 5.
- Post the inventory

5 units of A is removed from 'WH/Stock/Shelf 1' and 1 unit of A is
removed from 'WH/Stock'. The latter might create a negative quant if no
stock is available in 'WH/Stock'.

When the extra move line is created, it is created using the data of the
stock move (in `_generate_consumed_move_line`). When posting the
inventory, the quants selection is made strictly in the location set (in
`_update_available_quantity`), which might cause the mentioned negative
quant.

The solution is to select a sub-location where the product can be found.
This gives a higher chance to avoid negative quants afterwards. Note
that if we wanted to avoid negative quants, we could make a reservation
process on the move, and potentially create several stock move lines.
This is beyond the scope of the integration of MRP with sub-locations.

opw-803969
2018-01-09 08:59:44 +01:00
Nicolas Martinelli 849d8ffd21 [FIX] sale: protect SO if done
Prevent the modification of the SO line if the SO is locked.

opw-803439
2018-01-09 08:56:32 +01:00
Nicolas Martinelli 684483b634 [FIX] website_portal_sale: SO state
Add the SO state on the payment transaction, in order to be able to spot
more easily unconfirmed SO due to incomplete payments.

opw-748467
2018-01-09 08:30:25 +01:00
Nicolas Lempereur dc61861f90 [FIX] payment: py3 error payment icon save
Code to thumbnail payment icon image had an error for python3 because
from RPC the image would be a text string instead of an expected
bytestring.

This change accepts both and made another small fix in the view since
image_medium doesn't exist (and image is already thumbnailed).

A third fix was that removing an image caused an error.

opw-803722
closes #22088
2018-01-08 15:58:30 +01:00
Richard Mathot 10c3b31d0f [FIX] payment: avoid crash when no acquirers (#22090)
opw-803882
2018-01-08 15:03:46 +01:00
Nicolas Lempereur 53cb87883a [FIX] website_sale: allow Pay Now button translate
opw-803628
closes #22083
2018-01-08 12:10:34 +01:00
Martin Trigaux e7eb3eeba1 [FIX] point_of_sale: translate 'Unused' keyword
Was set inside an expression so not translatable

Fixes #22062
2018-01-08 11:46:01 +01:00
qdp-odoo ab01e79754 [FIX] account: make sure to return only one unaffected earning account
OPW 787612
2018-01-08 11:37:56 +01:00