Commit Graph
109139 Commits
Author SHA1 Message Date
Alexandre Kühn 262bec6af5 [FIX] l10n_fr_pos_cert: datetime.timedelta
When a user was closing a POS to go into the backend, and click on "Reprendre",
there was an error which prevent him to reopen the POS.

There was a confusion between object <datetime> and <datetime.datetime>, as
the previous code was trying to use the function timedelta() from datetime.datetime
instead of datetime. As a result, the error states that datetime.datetime has no
function timedelta.

opw-801523
2017-12-22 15:48:15 +01:00
Nicolas Martinelli fbaee8b267 [FIX] mrp: WO report
- Activate Work Orders
- Go in MRP > Reporting > Work Orders

The status filters ('Ready', 'Pending'...) do not work.

This is because the action forces the domain to `[('state','=','done')]`
instead of using one of the available filters.

opw-788043
2017-12-22 15:44:59 +01:00
Nicolas Martinelli 2aa3132d09 [FIX] base: prevent App Switcher as home action
This reverts commit 1ffe85f1cb and replaces the domain with a
constrain.
2017-12-21 13:47:24 +01:00
Nicolas Lempereur f771a9d945 [FIX] stock_account: stock_history slow read_group
The stock_history view is generated from by grouping of move from
sources and move to destinations which depending on the request and
number of request can be rather slow.

This fix replace a possibly high number of request by a slower number.

On a production instance, doing an inventory at a choosen date:

- with 300 stock moves, went from 4 minutes to 4 seconds,
- with 130 000 stock moves, went from 66 minutes to 10 minutes

opw-765793
closes #19594
2017-12-21 09:59:51 +01:00
Lucas Perais (lpe) 1ffe85f1cb [FIX] base: prevent App Switcher action to be selected as home action on user
Before this commit, one could choose the App Switcher as his Home action.
and arriving on /web would trigger an infinite loop at startup

After this commit it is not possible to choose the App Switcher as Home action anymore

OPW 800323
2017-12-20 15:08:53 +01:00
Nicolas Martinelli 8b69b2f732 [REF] account: hook for currency rate
Commit 74e4130f5f makes sure to make the accounting date prevail on
the invoice date when it comes to currency conversion.

However, the choice of date is not universally recognized. Softwares
(and accountants) might use either the accounting date or the invoice
date.

Therefore, we provide a hook se the behavior of the software can easily
be changed if necessary.

opw-783372
2017-12-20 13:35:43 +01:00
Pierre Masereel f1fdb97eed [FIX] mrp_sale: compute unit price of kit
When the unit price of a kit is computed in anglo saxon accounting, the
average price of kit parts is not multiplied by the quantity of this
parts in the bom.

E.g.: a kit of 2 prod1 and 1 prod2, when the price is computed, it only
take into account the cost of 1 prod1 and 1 prod2 to compute the kit
cost instead of 2 prod1 and 1 prod2

opw-786268
2017-12-19 16:27:44 +01:00
Nicolas Martinelli e5f61fa10c [FIX] mrp: real duration
- Create a MO which generates WOs
- User 1 starts working on it
- User 2 starts working on it

The field 'Real Duration' only displays the time spent by the user
connected. It means that there will be an inconsistency between the
field 'Real Duration' and the list of durations shown in the `time_ids`
field.

We want to keep 'Real Duration' limited to the current user, because it
should represent the duration updated in real time (done in widget
`mrp_time_counter`). However, we also want to see the total real
drations for all users. Thereofe, we simply update the view to show the
total in the list view.

opw-784456
2017-12-19 13:38:11 +01:00
Christophe Matthieu fdf0f014bf [FIX] web: avoid race condition in the website
Depending on the speed of the runbot, errors may appear if one tries to
use a template that is not yet loaded. Templates are being
loaded and we add new template to read, the ready function does not
take into account new additions.
2017-12-19 13:35:36 +01:00
Géry Debongnie 102e838473 [FIX] web: prevent double translation in kanban view
The kanban view uses a template which comes from the server, already
translated.  Before this commit, it tried to retranslate again the
template in qweb.js, which may be a problem (in addition to the useless
work): if some english string A is translated in B (french), but B is
also a valid english string which is translated into C in french, then
we will have a wrong result.

In this commit, we simply add a flag to disable the translation process, which
should also slightly improve the kanban view rendering performance.
2017-12-19 13:35:36 +01:00
Christophe Matthieu 7dfdfa0103 [FIX] web_editor: Avoid twice translated for static xml
Avoid texts to be translated twice if some modules have the translated
value corresponding to the English source term.

To reproduce: create a translation for static xml (comment 'openerp-web')
with 'Modifier' translated by 'Tadaaa'. In french context, the 'Edit'
button in forms is translated by 'Tadaaa'.

Don't translate template in web_editor if we are in the backend because
the translations of all the modules have already been loaded and applied.
2017-12-19 13:35:36 +01:00
Denis Ledoux f3da958fa1 [FIX] product: price computation with dated pricelist rules and tz
Take account of the user timezone to compute the price for
pricelist rules with start / end date.

Before this revision, the date used to compare to
the dated pricelist rule is always the date of today
in UTC.

For instance:
- If a user is in timezone UTC +12
- The 10% discount on the pricelist starts on December 19
- It's currently December 18 13:00

The user did not have the discount,
because it was consdiered December 18,
while the user was already in December 19.

With this revision, we take account of the context
and its timezone to compute the date of today
and return the correct price according to the
dated start and end datetime.

opw-785203
2017-12-18 18:23:22 +01:00
qsm-odoo b1b13dbeed [FIX] web_editor: revert copy/paste feature of the editor
The feature was introduced and fixed by following commits:
- https://github.com/odoo/odoo/commit/906875fc78cb80f6c3d5f1f14f997008cd406473
- https://github.com/odoo/odoo/commit/76be5eed449c78eaf0b4208c381169132492ab4a
- https://github.com/odoo/odoo/commit/7401807510a103374fa8eb524ae5a5698ae21a39

The feature is however still buggy in lots of cases as it is a bad
heuristic that cannot handle simple pasting cases. The feature was
initially introduced to allow pasting PDF content without having to
remove all the unwanted line breaks this induces. As this feature is
not that important and introduced more bugs than it solved, the feature
is deleted by this commit. If we want that feature again, maybe it is
worth considering an "Import from PDF" button or something like that.

See https://github.com/odoo/odoo/issues/15665
2017-12-18 16:10:33 +01:00
Stéphane Bidoul (ACSONE) 34ed42f16d [FIX] hr_expense: unbreak consistency check
Purpose
=======

Unbreak consistency check:

- on creation (check not done)
- when applied to a record set of several sheets belonging to different employees (reporting spurious errors)

Specification
=============

- self.something() in a api.model method does not make sense, so I replaced it with a call on the newly created sheet.
- Iterate on sheets instead of mapping all the lines
2017-12-18 12:37:28 +01:00
Stéphane Bidoul (ACSONE) 5377f7b85c [FIX] hr_expense: Make _check_employee dependent on employee_id
Purpose
=======

Employee must match on sheet and lines

Since the employee_id field of hr.expense.sheet is modifiable in submit state, there is a possibility to modify a sheet in such a way that the employee does not match on the expense sheet and expense lines. This commit fixes this.
2017-12-18 12:32:17 +01:00
Goffin Simon 052323fae4 [FIX] l10n_in_hr_payroll: Unable to refund payslip
When no input line is found in get_payslip_lines, the input line with
amount_python_compute = 'result = inputs.ARS.amount', the function __getattr__
on BrowsableObject returns 0.0 for ARS and raises an error for amount because
a float has no attribute amount.

Inspired from 9a6e7799fe

opw:785033
2017-12-18 10:29:22 +01:00
Odoo Translation Bot cfe0ebcc59 [I18N] Update translation terms from Transifex 2017-12-17 00:42:09 +01:00
qdp-odoo 78ae6f470b [MERGE] forward port branch 9.0 up to 9bba7fea42 2017-12-15 16:58:40 +01:00
qdp-odoo 9bba7fea42 [FIX] l10n_ch: update taxes for 2018
- Added taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added tax in VAT report(enterprise branch) for Switzerland

Was PR #20851. Was task 39082.
2017-12-15 15:50:43 +01:00
qsm-odoo 69d4383d7b [FIX] web_editor: browser-unify alignment editor option
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.

Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.

Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.

We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:

```html
<p class="text-center" align="left"/>
```

(`align` attribute is ignored because of the `text-center` class)

On Chrome, this would be produced with the same steps:

```html
<p class="text-center" style="text-align:left"/>
```

With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.

See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)
2017-12-15 14:06:04 +01:00
Nicolas Martinelli 601bf82ba9 [FIX] base_import: currency removal
Typo in the currency removal method.

opw-787873
2017-12-15 10:55:03 +01:00
Alexis de Lattre d223ba1484 [FIX] account: 'Due Payment' letter: overdue_msg in partner's lang
Was PR  #21352. Courtesy of Alexis de Lattre (Akretion)
2017-12-15 09:30:07 +01:00
Richard Mathot 2b32f52b48 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-15 09:11:52 +01:00
Christophe Simonis e89fbb5c38 [FIX] l10n_fr_certification: correct view inheritance hook 2017-12-14 14:27:53 +01:00
Sanjay Jamod 3830621075 [FIX] base: language code for Khmer (Cambodia)
Closes #17633
2017-12-14 13:44:14 +01:00
Christophe Simonis 767e2509f7 [MERGE] forward port branch 9.0 up to 228f6086b1 2017-12-14 13:24:01 +01:00
Nicolas Lempereur c8df0333f5 [FIX] mrp: determine order of mrp.production
The order of production was first based on "priority DESC" and then
"date_planned ASC".

So for production with the same priority/date_planned the order is not
deterministic.

This commit make the order deterministic as it seems preferred.

opw-784243
closes #21644
2017-12-14 12:57:22 +01:00
Christophe Simonis 228f6086b1 [FIX] l10n_fr_pos_cert: correct dependency 2017-12-14 12:55:32 +01:00
David 849a10b1da [FIX] website_event_sale: registration visibility
- When all the tickets in an event expire, the form is still visible,
wich is confusing for users.

This closes #21384
2017-12-14 12:50:05 +01:00
Lucas Perais (lpe) b75927f9e3 [FIX] l10n_fr_certification: adapting to the new specs
Main resource document to be found at https://www.economie.gouv.fr/files/files/directions_services/dgfip/controle_fiscal/actualites_reponses/logiciels_de_caisse.pdf

    This document states that only business operations with partners not being subject to VAT should be inalterable and secure.
    We adpat the module by differentiating between b2c and b2b journals and apply hashing on the former's moves

    Protection against account_cancel is not necessary anymore

    By default, this module considers a sales journal being a b2c, thus activating hashing on its move.
    Since we can't afford to lose information, when a b2c journal contains hashed moves, its b2c characteristic cannot be changed

[ADD] l10n_fr_pos_cert: module to adapt the POS to the recent French regulation CGI art. 286, I. 3° bis.

    The module adds following features:

    - Inalterability: deactivation of all the ways to cancel or modify key data of POS orders, invoices and journal entries

    - Security: chaining algorithm to verify the inalterability

    - Access to download the mandatory Certificate of Conformity delivered by Odoo SA (only for Odoo Enterprise users)

[ADD] l10n_fr_sale_closing: module to store automatically the total of daily/monthly/annualy sales.

    (both of the period and cumulative).

    This fulfills another requirement brought by the recent French regulation CGI art. 286, I. 3° bis related to the storage of data

Was PR #20581. Was task 29922
2017-12-13 17:22:51 +01:00
qsm-odoo 3a13eada0e [FIX] web: readonly required text fields should not be highlighted
The bug is also present in enterprise but the required style of
enterprise makes the bug invisible. The bug has also been naturally
fixed in 11.0 thanks to the views and design refactoring.

Thanks @auyeung112002 for the original fix.
2017-12-13 17:14:11 +01:00
Christophe Simonis 1022e4fb25 [MERGE] forward port branch 9.0 up to 22f8660e22
Works better when you add files...
2017-12-13 15:17:22 +01:00
Christophe Simonis 39fb0825ac [MERGE] forward port branch 9.0 up to 22f8660e22 2017-12-13 15:16:46 +01:00
Martin Trigaux b92aaf1e66 [FIX] mail: display email of partner in the tags 2017-12-13 12:57:48 +01:00
auyeung112002 d847a66415 [FIX] web: Make search view dropdown menu scrollable 2017-12-13 11:35:48 +01:00
Josse Colpaert 22f8660e22 [FIX] stock: don't propagate cancel when chained move is done
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done (and raises an error).

As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the destination
move is done.

opw-786571
2017-12-13 10:17:48 +01:00
Josse Colpaert b3be0b7576 [FIX] stock: don't propagate cancel when chained move is done
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done.

As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the
destination move is done.

opw-786571
2017-12-13 10:10:46 +01:00
Wolfgang Taferner 30d0861f0a [FIX] base: ir.sequence better fallback
Zero is an non-acceptable value for sequences, so the fallback should be
one instead.

Fixes #21267
2017-12-13 08:51:05 +01:00
Adrien Peiffer (ACSONE) 2a9e6e6a3b [FIX] res_partner: bad sudo.
Using sudo on super call can turn into infinite call in odoo.

opw:785415
2017-12-12 15:58:59 +01:00
Josse Colpaert b0acb42f0b [FIX] stock: avoid infinite or longer than necessary loops
In some cases the MRP scheduler can remain blocked on an infinite loop
consuming a lot of CPU. The reason comes from the loop 'Check done
procurements'

If a new procument is created from another process (such like MTO
orders) during this loop, the process never ends.

The only way to reproduce is in debug mode:
1. Put a breakpoint on line 'Check done procurements'
2. Launch the MRP scheduler manually and stay paused on the breakpoint
3. In parrallel, create and confirm a sale order with a MTO route, this
   will trigger the creation of a new procurement order in state
   'Running'
4. Continue debugging step by step the scheduler and you will notice
   that the loop never ends.

Closes #21565
opw-787651
2017-12-12 15:20:57 +01:00
Christophe Simonis 219c93252f [MERGE] forward port branch 9.0 up to 7a24a2f45f 2017-12-12 14:15:15 +01:00
Nicolas Martinelli 7a24a2f45f [FIX] field: avoid overhead of record._set_dirty when setting fields (#21378)
Setting fields as dirty was dramatically slow for huge one2many fields.
2017-12-12 13:36:23 +01:00
Nicolas Seinlet eb36f42729 [FIX] stock: complete_name of stock location
Have the following location structure: Loc A -> Loc B -> Loc C
The `complete_name` fields are:
- Loc A
- Loc A/Loc B
- Loc A/Loc B/Loc C

When changing Loc A to Loc D, the `complete_name` are:
- Loc D
- Loc D/Loc B
- Loc A/Loc B/Loc C

Compute `complete_name` of stock location using `complete_name` of
parent instead of parsing the full bunch of ancestors.  This improves
the computation speed, and moreover solves the recursivity problem.

Closes #21585
2017-12-12 13:15:47 +01:00
Goffin Simon 2720eb84ee [FIX] website_portal: Verification of vat number in EU country
We have problems when trying to validate our EU VAT report because some vat number are wrongly encoded in Odoo.
    There are 2 problems:

    1) We use vatnumber library to check the validity of the VAT number entered by the user on website.
       That library removes the following characters '.' and '-' in order to perform the check and
       thus can return True for a number like 123.123.123.13 or -123-3454-34
       And those VAT number are then saved in our database but are rejected by the state
       as VAT number should only contains alphanumeric character
    -> Solution: prevent entering vat number with other characters than alphanumeric for users that are located in EUROPE!

    2) Usually VAT is prefixed by country code, however some people in europe managed to bypass the system
       by prefixing their VAT number with CC instead of their country code, CC is consider valid in odoo
       (it means Country Code) but is not a valid European country code in general, which means that those
       people that should have pay some tax have not. Which is a huge problem.
    -> Solution: prevent the use of CC as country code by the user when entering a vatnumber only if the user country is in EUROPE!

    source: https://en.wikipedia.org/wiki/VAT_identification_number

opw:785443
2017-12-12 11:51:52 +01:00
Pedro M. Baeza d82b360309 [CLA] backport signature for Tecnativa
backport of dc8010c9b to 9.0
Asked in #21496
2017-12-12 11:39:35 +01:00
Martin Trigaux ffbcf69af5 [FIX] product_extended: remove not working price computation
costs_hour field no longer exists
Some modules in a different repository (let say enterprise), may be still using
it but it is not its place here.
For stability reasons, we keep the computation if an external module adds the
missing field anyway

Fixes #16269
Closes #20899
2017-12-12 11:36:58 +01:00
Nicolas Seinlet 98072f1ad0 [IMP] stock: performance on _compute_reserved_availability
Improve performance (* 2.5) on _compute_reserved_availability
`mapped` makes use of orm prefetch, which is inefficient in this use
case when facing high volume.

Closes #21198
2017-12-12 11:17:54 +01:00
Christophe Monniez 17c9208889 [FIX] base: backport of set mimetype on js and css assets
On MS Windows, the mimetypes module relies on the Windows Registry to
guess mimetypes. As a consequence, when generating assets bundle for
javascript files, the mime type of js files may be wrong. In that
particular case, the Odoo user is facing an empty web page.
This commit enforce 'application/javascript' for js assets when they are
saved as ir_attachment in the database.

This commit is a backport of 77ca51f
2017-12-12 09:42:55 +01:00
Arnold Moyaux 6d02f7d6bf [FIX] purchase: Only use purchase UOM on vendor bill
It was the purpose of this commit fea667a243
However it uses purchase uom in any cases and not
only vendor bill.

This commit correct it by using it only if a purchase
order is linked to the invoice.
2017-12-11 11:24:33 +01:00
Odoo Translation Bot f3623f1513 [I18N] Update translation terms from Transifex 2017-12-10 00:42:03 +01:00