Commit Graph
114426 Commits
Author SHA1 Message Date
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
Christophe Simonis e3080d8433 [MERGE] forward port branch 9.0 up to 35c829f12b 2018-01-08 11:15:33 +01:00
Alexandre Kühn 255e8ca3d9 [FIX] web: binary field format in list view
Binary fields were simply shown simply by their textual representation in list views,
e.g. the base64 string.

There was no formatter for binary fields, therefore it has been implemented so that
it displays its estimated size.

Binary fields in list views had a download link in v10.0.
We provide this feature back by means of a widget called 'download_link'.
It is also possible to define an option to set the field name having the filename as its value.

Example:

    <tree>
        <field name="fname"/>
        <field name="datas" widget="download_link" options="{'filename': 'fname'}"/>
    </tree>

with the following record: {fname: 'document.txt', datas: 'Cg=='},
we get a file named "document.txt" by clicking on the download link.

Closes #21996
2018-01-08 10:17:44 +01:00
Florent de Labarre bc3d5ca775 [FIX] stock.move : add more information in UserError of product_uom Constrains
Steps to reproduce the bug:

- Create a bom with lines
- Change on one product in product view form the uom with diffrent category (exemple : unit -> meter)
- Create un manufactoring order : you have an error You try to move a product using a UoM that is
not compatible with the UoM of the product moved. Please use an UoM in the same UoM category.,
the error message doesn't give with product there are an issue. (
if you have hundred of line in your Bom, it is very difficult).

This fix improves the error message.

opw:800328
2018-01-08 10:10:33 +01:00
Aaron Bohy bd2e783d30 [FIX] web: DebugManager in dialogs
For actions executed in dialogs (target='new'), a DebugManager
is instantiated and appended to the dialog's header (div with
classname 'modal-header').

However, in the full composer dialog (in a chatter, click on
'Send message', and then click on the expand icon), there are
more than one element matching the selector '.modal-header',
because it also occurs in the html generated by summernote.

In this case, the widget's $el is cloned and appended to each
element of the JQuery nodeset matching the given selector, but
widget.$el only refers to one of those. So when it isn't the one
appended in the real dialog's header, the debug manager remains
empty as the widget isn't able to populate it correctly.

This bug appeared with rev. 5f1ef09, as before it, the debug
manager was appended to the dialog before its content.
2018-01-08 08:23:02 +01:00
Simon Lejeune 25943696ea [FIX] stock: _compute_entire_package_ids
When a picking contain a few thousands move line, reading it was slow
because of the computation of "entire_package_ids" and
"entire_package_detail_ids". The compute method for this field calls
"_check_move_lines_map_quant_package" that check that, for a picking,
all the move lines having "package_id" and "result_package_id" as the
same package (ie moving an entire pack) match exactly the content of the
package (ie the quants).

The issue was that the method was called for every move line without
packaging because of a wrongly written condition. We now only call the
method one time for each package, whatever the number of move line.

opw-803887
2018-01-05 18:28:32 +01:00
Christophe Matthieu d4982394bc [FIX] web: speed resequence up in x2m
Resequencing a x2m is very slow because the view is reloaded after each
change instead of only once after all the changes.
2018-01-05 17:34:26 +01:00
Christophe Matthieu 73e2ba991c [FIX] web: add a stableSort method for sorting x2m
Issue: create 60 lines in ordered x2many with the same value (0) for the order
field and make a change ; the displayed records will be switched.

The problem appears because the sorting function is not stable and the
records with the same values can change place (hence change page), which is
quite disturbing for the user.
2018-01-05 17:34:25 +01:00
Christophe Matthieu b7ee1aa4b1 [FIX] web: sort and onchange in tabbed editable x2m
Two attempts of dealing with sorting (and resequencing) in tabbed (multi-pages)
x2many editable lists (see odoo/odoo@c2563db and odoo/odoo@983c7ae) have been
previously done, using a static attribute (`keepChangesUnsorted`) on the
datapoint.

This solution sadly only covers both cases separately, not if they are combined.
Morever, onchanges were not correctly managed in neither of these two cases.

A new approach is used here, by "freezing" and "unfreezing" the datapoint when
needed, which is more flexible.

Some modifications have been introduced:
 - when ordering a x2many, all records are now considered (and not only the
   records on the current page) ; an additional read is thus done on the sorted
   field for all records in the x2many relation
 - `setSort` is now asynchronous as a `read` might be needed
2018-01-05 17:34:25 +01:00
qsm-odoo d3cebdc4a2 [FIX] web_editor: always hide icon & video tabs when choosing bg img
This was broken in 11.0 if the media dialog was the first dialog to be
opened when using the editor. This happened for two reasons:

- Never use a widget (dialog)'s `$el` before it is started (opened).
  This was the case here. The bug is even worse in saas-11.1 as we do
  not allow to do that from there so it results in a JS crash.

- It worked in <= saas-16 because dialogs were started at once as they
  did not need to load anything. In >= 11.0, the first dialog which is
  opened in the page needs to request the main dialog template and this
  takes some time.

So, this fix makes sense in >= 9.0 but I chose to merge it in 11.0 as it
only induces a real bug from there.
2018-01-05 16:23:44 +01:00
Adrien Dieudonne 0f1832a362 [FIX] web_enterprise: chatter: remove horizontal scrollbar in mobile
Before this commit, the user had the ability to scroll horizontally
on some form views containing chatter.
This horizontal scroll only appeared in mobile (Android and iOS) but
it wasn't useful.
2018-01-05 15:22:21 +01:00
Géry Debongnie 1efc9d0b5e [FIX] web: transfer attributes to subnodes in list views
In many cases, we allow class and style attributes in the arch of a
view.  However, it did not work in a list view, and there is not really
a good reason for that (only cost is a few runtime checks).

So, with this commit, we allow those attributes in list views (and
x2manys obviously).

However, note that there is a subtle (maybe slightly confusing)
behavior: when a list renderer is in 'readonly' mode, it does not
actually instantiate any field widgets.  In that case, it optimizes the
rendering by putting only the formatted value inside a cell:

<td>some value</td>

So, in that case, the only valid target for the attributes is the td:

<td class="hello">some value</td>

But when we are in edit mode, we actually have a field widget inside a
td:

<td><input>some value</input></td>

And in that case, the natural home for the attributes is the field
widget.  This is quite important, because this is the way attributes are
done in the form view, and we do not want different behaviour.

<td><input class="hello">some value</input></td>
2018-01-05 14:42:55 +01:00
Aaron Bohy 35c829f12b [FIX] mail: Discuss: apply default filters
Before this rev., the default filters were ignored in Discuss. The
SearchView was instantiated and correctly retrieved the default
filters. However, a first manual 'do_search' needs to be done by
the client action for the search view to provide the domain, and
for Discuss to correctly filter the messages.

Steps to reproduce the issue:
  - In Discuss (e.g. in Inbox), add to Favorites a given search,
    and tick 'Use by default'
  - Leave Discuss, and then go back: the default filter correctly
    appears in the search view, but the messages aren't filtered.
2018-01-05 14:39:34 +01:00
Nicolas Martinelli e8634b60c9 [FIX] purchase: almost equal
Prevent failing test.

opw-802764
2018-01-05 14:09:50 +01:00
Christophe Monniez c05ec6536b [FIX] sale_timesheet: fill customer email field
When creating an SO for a service that create a new Task in a Project, the customer
email field is left empty.
With this commit, the email field is filled with the SO customer's
email.

opw-803566
2018-01-05 13:52:42 +01:00
Yannick Tivisse f483768983 [FIX] l10n_be_hr_payroll: Take 'Others costs' into account to compute net 2018-01-05 13:21:15 +01:00
Yannick Tivisse 1276ca9dbf [FIX] l10n_be_hr_payroll: Reset transport information on mode change 2018-01-05 13:02:52 +01:00
Nicolas Seinlet b9edb91418 [FIX] stock_account: change standard price
Improve performance when 70k+ locations, only use locations where the
product is instead of all locations.
2018-01-05 12:57:27 +01:00
Lucas Perais (lpe) 47e2521d94 [FIX] delivery: reactivate update soline on shipper
install delivery
Create a SO with a shipper
Validate it
validate the delivery

Before this commit it was:
- impossible to do the setup for the delivery cost on the SO to get updated with the delivery validation
- the delivery cost on the SO did not update

This was because the stock API changed a bit a some functions were not here anymore

OPW 786500
2018-01-05 11:18:05 +01:00
Josse Colpaert 18bb3ac71b [FIX] mrp: in move validation, take into account the owner
Before this commit, the special mrp validate_move method did a call to
quants_move with an incomplete signature. IN the use case, that we want
to make "own" produced quantities by a third party (maquila), we can do so in
downstream modules by restrict the partner on the move so that any moved (or
created) quants will belong to this partner (owner).  This is certainly
important for the case where finished products are not your own
property.  Courtesy of blaggacao.

Closes #21072
2018-01-05 10:45:26 +01:00
Lucas Perais (lpe) 10af3284ab [FIX] l10n_be_intrastat: manage dropshipping triangular
Before this commit, the triangular case was not handled:
A transaction in dropshipping which happens outside our country
(provider and customer both outside our country)
was counted in the intrastat XML when it shouldn't

After this commit, those transaction are not accounted for in the XML

opw-800342
2018-01-05 10:13:46 +01:00
Nicolas Lempereur bc8f7a44d6 [FIX] mail,web: adapt email in m2m tags b92aaf1
Adapt commit b92aaf1 for framework changes in saas-16.

That commit made Many2ManyTagsEmail widget display name_get gotten
dynamically. This allow to have 'show_email' context key working and
having the email displayed.

This commit use the new views (as of saas-16) to do the same change.

opw-801558
fixes #21812 fixes #21523
closes #21969
2018-01-04 18:09:56 +01:00
Nicolas Martinelli e441f348ba [FIX] sale_stock: failing test
- Install a new db with demo data and sale_stock module
- Set rounding for product unit of measure from 3 to 5.
- Run sale_stock tests (from command line with --test-enable)

Current behavior:

> FAIL: test_02_sale_stock_return (odoo.addons.sale_stock.tests.test_sale_stock.TestSaleStock)
>
> AssertionError: 3.0000000000000004 != 3.0 : Sale Stock: delivered quantity should be 3.0 instead of "3.0000000000000004" after picking return
>

Fixes #21246
opw-803837
2018-01-04 16:17:01 +01:00
Nicolas Martinelli 6a481dce1f [FIX] stock_account: cost price digits
Complement of cf32a23b92

Closes #21686
opw-800279
2018-01-04 15:03:03 +01:00
Yannick Tivisse dd0453e610 [MERGE] Update belgian fiscal rules up to the 1rst of January 2018
See :
https://www.ucm.be/Secretariat-social-Employeur/Tout-savoir-sur-le-tax-shift/Toutes-les-infos-qui-me-concernent/Employeur-PME/Tax-shift-Renforcement-du-bonus-a-l-emploi
http://www.emploi.belgique.be/defaultTab.aspx?id=45436
https://www.securex.eu/be/lex-go.nsf/vwAllDocsRead/0A26E522E378CCD6C12572730034B4A0?OpenDocument#.Wk4QDbynFhF
https://financien.belgium.be/nl/node/1540
2018-01-04 14:54:22 +01:00
Yannick Tivisse cfb2d81273 [IMP] l10n_be_hr_payroll: Update reduction for disabled spouse to 2018 2018-01-04 14:54:06 +01:00
Yannick Tivisse 27ca82efc9 [FIX] l10n_be_hr_payroll: Remove unapplicable rule
This corresponds to:

Réduction pour personnes physique à bas revenu dans le secteur public
Réduction du précompte professionnel de 5,83 € (après application des réductions précédentes)
pour les rémunérations imposables comprises entre 565,02 € et 2 027,86 € maximum aux personnes
à bas revenus qui sont occupées comme statutaires, stagiaires ou temporaires au service
4 Net = brut − ONSS − 20 %
précompte professionnel 2017 • 7
de l’Etat, des Communautés, des Régions, provinces, établissements subordonnés aux provinces,
communes et établissements subordonnés aux communes, qui ne sont pas engagées en vertu
d’un contrat de travail.
2018-01-04 14:54:06 +01:00
Yannick Tivisse 6b7b194824 [IMP] l10n_be_hr_payroll: Update Withholding taxes to 2018
See https://finances.belgium.be/fr/entreprises/personnel_et_remuneration/precompte_professionnel/calcul
2018-01-04 14:54:06 +01:00
Yannick Tivisse 6f7bfbdc06 [IMP] l10n_be_hr_payroll: Update employment bonus up to june 2017
Purpose
=======

https://www.ucm.be/Secretariat-social-Employeur/Tout-savoir-sur-le-tax-shift/Toutes-les-infos-qui-me-concernent/Employeur-PME/Tax-shift-Renforcement-du-bonus-a-l-emploi
2018-01-04 14:54:06 +01:00
Yannick Tivisse e6562f20b6 [IMP] l10n_be_hr_payroll: Update reduction for low spouse revenue to 2018 2018-01-04 14:54:06 +01:00