Commit Graph
109601 Commits
Author SHA1 Message Date
Christophe Simonis 2d12ae3202 [MERGE] forward port branch 9.0 up to c9e7433c23 2018-04-23 14:07:12 +02:00
goliveirab 6157750a66 [FIX] l10n_mx: account 802.02
Changing account nature D > A, 802.02 Contra Cuenta CUFIN

Closes #24331
2018-04-23 13:53:24 +02:00
qsm-odoo c9e7433c23 [FIX] web_editor: prevent crash on outside-iframe click
The editor is performing text selection check when clicking on the
window. However, when clicking outside the iframe an editor is running
in, a crash may occur as the editor was trying to check a range outside
of its environment (the iframe).

Related to opw-1837818
2018-04-23 12:56:34 +02:00
Stefan Rijnhart 04b0d761e4 [FIX] core: Validate custom views without an XML ID
Regression of fc91feda30

Closes #23646
Closes #23626
2018-04-23 10:27:40 +02:00
Christophe Simonis 3bee6ebb0a [FIX] core: effectively warn on invalid custom views
Since new-api migration of `ir.ui.view`, the method that check views
raises exceptions instead of returning a boolean. Show them as warning.

Related to #14521
2018-04-23 10:12:16 +02:00
Lucas Perais (lpe) cd6150fe9e [FIX] web: NFD UTF-8 for safari in upload file
Before this commit, when uploading a file as attachment in Safari,
The file icon kept on showing 'downloading' whereas the request was successful

This was because the return from the server had a different UTF-8 norm than Safari

After this commit, it works well

OPW 1836545
closes #24307
2018-04-23 09:00:11 +02:00
Aaron Bohy e43b9ab9c6 [FIX] web: ListView: no infinite loop on empty nameget
Assume a list view with a many2many field, and a record for which
that many2many contains a single value, whose nameget returns the
empty string (which is a falsy value in JS). Before this rev., it
triggered an infinite number of namegets, and the browser crashed.

It was because the cell was re-rendered when the nameget returned,
and in the rendering of the cell, it re-performed a nameget if
the value was falsy.

opw 1838255d
2018-04-23 08:20:23 +02:00
Odoo Translation Bot 851356bf23 [I18N] Update translation terms from Transifex 2018-04-22 00:28:35 +02:00
Jeremy Kersten b16c4f50d4 [FIX] website_sale: avoid traceback when category don't exists
In case the category is given in GET, ?category_id=xx, we cannot guarantee that
the category exists

This commit closes #24235
2018-04-20 16:00:30 +02:00
Akim Juillerat 4d88e8e822 [FIX] hr_holidays: update _check_holidays constrains
It was possible to edit a leave request in order to use a leave type
which had no more days left. This was due to a missing field in the
constrains call.

Closes #24320
2018-04-20 14:13:51 +02:00
Nicolas Martinelli 0dd08bd148 [FIX] mrp: change BOM
- Create a MO for Product A with quantity to produce of 2
- Produce 1
- Open the associated BOM, and add a line to the bom
- Go back to the MO and try to update the qty to produce to 1

Traceback: division by 0

opw-1838006
2018-04-20 10:11:11 +02:00
Olivier Dony b61aad2f6b [FIX] hr*: restrict personal employee fields at model level
Fixes #12077
Closes #12160
2018-04-19 18:51:01 +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
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
Christophe Simonis 2f037a13ca [MERGE] forward port branch 9.0 up to cf163d19ee 2018-04-18 11:32:27 +02:00
Alexandre Kühn cf163d19ee [FIX] board,web: edit custom views in place
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.

This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.

With this commit, custom views are edited in place.

Fixes #23712
2018-04-17 17:32:27 +02:00
Nicolas Lempereur 91ca846447 [FIX] account_check_printing: write payment not journal
When we make a payment, we need the write access on account.journal
because check_manual_sequencing on account.payment is a related field
of account.journal and was used to decide on numbering the check or not.

With this change, the write access is not required.

opw-1834343
opw-1835888
closes #24281
2018-04-17 17:26:19 +02:00
Aaron Bohy 74e208eabf [FIX] base: export translations for added terms
in commit f27e86b
2018-04-17 15:36:05 +02:00
tgroutars f27e86bdde [FIX] base: no crash when setting wrong relation to m2m
Before this rev., in the ir.model.fields form view, it crashed
when the user specified an invalid model name as a relation for
fields of type many2many (the onchange crashed). This rev. displays
a warning instead.

opw 1837401
2018-04-17 14:46:54 +02:00
qsm-odoo 5d13a2f431 [FIX] web: properly right-align numbers in grouped list views' rows
The 'oe_number' class was replaced by 'o_list_number' but this was not
properly done for grouped list views. As a fix, the new class is added
on top of the old one to not break potential customizations.

Proper fix will be done in master.
See https://github.com/odoo/enterprise/commit/a2ce226a2a085b26174cdfd32922517dff39658c

Closes https://github.com/odoo/odoo/pull/23966
2018-04-17 13:37:24 +02:00
len-odoo 1777646d1e [FIX]mail: fix help command in livechat with unlogged user
When an unlogged user creates a livechat, typing the /help command in the
backend would result in the help command sending a traceback.
The function processing the command would assume the existence of a channel
partner name, which is not the case when the user starting the chat is unlogged.

opw:1835484
2018-04-17 13:23:50 +02:00
Nicolas Martinelli 866b48a267 [FIX] mass_mailing: sanitize test email
When sending the test email of a mass mailing campaign, it might be
observed that the result is different from the final email sent to
customers.

This is because the `body` field of the final mail message is an `Html`
field with options `sanitize_style=True` and `strip_classes=True`. On
the other hand, the `body_html` field the test mail is a simple `Text`
field which is not sanitized.

We sanitize the `body_html` field with similar options.

opw-1820064
2018-04-17 09:16:26 +02:00
Edilianny Sanchez - https://www.vauxoo.com/ 57808c4482 [CLA] add edy1192 to Vauxoo's CCLA
Closes #24264
2018-04-17 08:56:19 +02:00
chirag 941ddaee74 [FIX] purchase: pickings stat button visibility
When you create a purchase order for a product of service type, the
picking stat button is displayed but there's no linked pickings. When
clicking on the stat button, all pickings were displayed, which is
wrong.

Issue:#9181
Task:#1817421
2018-04-16 14:23:49 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
Kirti Choudhary aaadfd7d76 [FIX] sale: income account in invoice with down payments
When creating an invoice with 'Down payment' option for an SO, it should
first consider income account of the 'Deposit Product'. if it does not
have one then it should consider that product category's income account.

Fixes #23100
Task# 1819531
2018-04-16 11:35:29 +02:00
Christophe Simonis 752dcc761c [IMP] core: load geoip2 database by default 2018-04-16 11:20:39 +02:00
Christophe Simonis 264398de3e [IMP] website: handle geoip2 databases
Since April 1, 2018, free versions of GeoLite Legac y databases are no
longer updated and free downloads not available [1].

[1] https://support.maxmind.com/geolite-legacy-discontinuation-notice/
2018-04-16 11:20:39 +02:00
Christophe Simonis 7147622665 [MERGE] forward port branch 9.0 up to 8c0b23c239 2018-04-16 10:28:42 +02:00
len-odoo 1ae1cac9ae [FIX] stock: set procurement time to noon to avoid timezones changing the date
If a user set a procurement to the day N, the procurement datetime field would
be set to day N at midnight. So any negative timezone make it appear that the
procurement is set to day N-1.

opw 1831272
2018-04-16 08:58:00 +02:00
Odoo Translation Bot 2901c0f0e5 [I18N] Update translation terms from Transifex 2018-04-15 00:29:26 +02:00
Martin Trigaux e09609bb31 [FIX] base: set correct Sudanese currency
Since July 1, 2007, the Sudanese pound is the only legal tender.

Closes #13802
2018-04-14 16:29:07 +02:00
Nicolas Martinelli 83a03e6349 [FIX] hr_timesheet: description on timesheet report
- Go to Timesheets > Add a Line (grid view)
- The view opened is `view_timesheet_form`
- Add a description with several lines
- Go to Project, and display the timesheet entries.
- Print the report "Timesheet Entries"

The lines in the description are merged into one single line.

Since it is possible to write a description on several lines, the report
should keep the formatting.

opw-1830703
2018-04-13 12:33:46 +02:00
qdp-odoo c58ef14a01 [FIX] account: tax adjustment wizard fixed.
The former version of the tax adjustment wizard was copying the selected tax on both the credit and debit line of the created journal entry. Although it was fine for the belgian use case (since the report was taking only the sum.debit or sum.credit to gather data for grid 61/62), this was a stupid limitation as it was preventing to use that wizard to touch any grid using sum.balance (as both lines would be taken into account and cancelling each other).

To enhance/fix this, we introduce a fields.selection in the wizard to depict if the tax needs to be copied on the debit OR the credit line.

Inspired by ticket 1826242.
2018-04-13 11:41:34 +02:00
Nicolas Lempereur 7a1db7e620 [FIX] web: wrong day column title in arabic
In arabic, with the version localization of bootstrap we use the week
starts on saturday. But the version of bootstrap-datetimepicker we use
in 10.0 and saas-14 is 3.0.3 which only fully supports week starting
on sunday and monday.

Thus in arabic, the column title in the date picker would be:

  Sunday <- Monday (ﻥ, ﺙ, ﺭ, ﺥ, ﺝ, ﺱ, ﺡ)

Instead of what the numbered days in the calendar are shown as:
  Friday <- Saturday (ﺱ, ﺡ, ﻥ, ﺙ, ﺭ, ﺥ, ﺝ)

This issue doesn't happen in saas-15, 11.0 and over since the library
has been updated with ad6fd5f8 and the as of version 4 supports any
starting day of week, with this change:
 https://github.com/Eonasdan/bootstrap-datetimepicker/commit/557b657

opw-1825640
closes #24200
2018-04-13 09:33:24 +02:00
Jeremy Kersten 3ac4b1ab51 [FIX] website_sale[_event]: add timout for tour.
Seems like this tour crash randomly due to default 10000 ms.

This button, in some case, seems to take more than 10000ms (slow server? slow
connection ?) to validate the order (cretae invoice, generate PDF, send mail, ...)

It is a test to see if increase the timeout could decrease the risk of false
positive on the runbot.
2018-04-12 12:48:21 +02:00
Goffin Simon 9bf1f97d9b [FIX] sale: Translation issue on T&C on Invoices
The sale_note field is translated according to the language of the customer in a SO.
This fix applies the same behavior on the customer invoice.
Inspired from this commit: 978b8f64ec

opw:1830838
2018-04-12 11:57:29 +02:00
Adrien Dieudonne 8c0b23c239 [FIX] mrp: quick create bom on new mo
Before this commit, an error was raised when you tried to create a
new bill of material on a new manufacturing order.
In fact, the name_create RPC returned 'false' and slow_create()
wasn't executed.

By adding _rec_name (as in 10.0) on the corresponding model, the RPC
call will raise an error that will be caught by quick_create and
forces slow_create().

Closes #9761
2018-04-12 11:24:54 +02:00
Nicolas Lempereur 2b380e4e39 [FIX] web_editor: indent just a line inside table
Inside the cell of a table, indenting had several behaviors:

- if the selection is contained in several nodes elements: indent the
  element child nodes of common ancestor

- if the selection is contained in one or more list items: indent these
  list items

- if the selection is contained in one 'content block': indent the whole
  cell content

The two first behaviors are expected, but the third one is a little odd
and unexpected next to other existing editors behaviors.

With this commit, the third behavior becomes:

- if the selection is contained in one `content block`: indent this
  content block

note: 'content block' is defined as p, pre, h1, h2, ..., blockquote, td

opw-1824647
closes #24182
2018-04-12 10:10:05 +02:00
Joren Van Onder eb84a30999 [FIX] pos_mercury: don't lose credit card info
Due to historical reasons the amount on a statement line is used to
find it again so the credit card information can be added to it.

Doing a search directly on 'amount' will fail in rare cases when
the currency rounding doesn't result in a float with the same amount
of decimals as the rounding specifies. E.g.:

>>> currency = env['res.currency'].browse(3)
>>> currency.rounding
0.01
>>> currency.round(74.85000000000001)
74.85000000000001

When that happens the credit card information is not saved in the
backend. To avoid this we do the float comparison properly with
float_compare afterwards.

PS. Ideally the logic in add_payment should be moved to an override of
_prepare_bank_statement_line_payment_values. This way we wouldn't have
to do these awkward things to find the statement line. But this
approach is not suited for a stable release.

opw-1832156
2018-04-11 14:30:08 -07:00
Jairo Llopis 30aa75329c [FIX] website_form: Disable form send on editable mode
Before this patch, when a user was editing a website page containing a form
and he clicked "Send", for some reason, the form tried to be sent.

Now, the button behavior is disabled when entering editable mode.

Closes #23852
2018-04-11 15:45:47 +02:00
Romain Derie c09b89596e [FIX] website: keep query strings when redirecting 'website.' page
Urls like `/page/website.XXX` are redirected to `/page/XXX`.

Before this commit, the redirection would not keep query strings:
`/page/website.XXX?rde=1` would redirect to `/page/XXX`.

Now, we keep the query strings:
`/page/website.XXX?rde=1` will redirect to `/page/XXX?rde=1`

Closes #24140

Courtesy of @MTantin
2018-04-11 15:04:24 +02:00
Toufik Benjaa fc6d98df24 [FIX] account_asset: Allow accountant to validate invoices
- When validating an invoice, the create method of the model account.asset.asset is called.
  Accountant have the access rights to create account.asset.asset object, but they do not have the rights to write on them.
  The issue here is that the create of the account.asset.asset is done, but right after a right is done in the same object, which trigger an AccessError.
  To fix this issue, we make the write using the admin env. This doesn't cause security issues since the user needs the create accesses.

OPW-1832797
2018-04-11 12:39:48 +02:00
Toufik Benjaa 2a09289e32 [FIX] payment_stripe: Create stripe charge with email
- When creating a Stripe charge, we have the possibility to send the customer email.
  This is then used by Stripe to send a payment notification (receipt) to the customer.
  This was never done by Odoo, this commit introduce this feature.

OPW-1829945
2018-04-11 11:58:55 +02:00
Joren Van Onder 7805825941 [FIX] pos_mercury: allow test transactions again
It used to be possible to run test transactions against mercurypay.com
using a regular swiper device, test credentials and test cards
provided by Mercury.

Mercury has recently disabled this saying this feature did not adhere
to certain PCI regulations.

It means that currently on the regular mercurypay.com network only
real cards (and thus real money) can be used.

Because we require a way to test without spending money this commit
allows to switch to the test network (mercurycert.net). It uses a
system parameter because we cannot introduce a Boolean on
pos_mercury.configuration in a stable release. It also changes the
test credentials to some that work on mercurycert.net.

Note that the regular 'production' swiper devices can not be used on
this test environment. This results in:

Error 004118: Failed to decrypt

The swiper contains embedded cryptographic keys specific to
mercury*pay*.net. Instead a specific 'development' swiper device with
embedded keys for mercurycert.net is required.

opw-1832156 (this is necessary to test that issue)
2018-04-10 12:05:00 -07:00
Nicolas Martinelli d64ce53071 [FIX] stock_calendar: scheduled data
- Install stock_calendar
- Create a stockable product
- Add the route "Buy"
- Add a vendor with a delivery lead time of 30 days
- Create a reordering rule for x units
- Run the schedulers

A PO is created, but the scheduled date is set as today, not today + 30
days.

What happens is the following:
1. Since no `calendar_id` is defined on the orderpoint, `_get_group`
   returns `[(now, None)]`
2. `now` is used in the `procurement_values` of the `res_groups` by
   `_procurement_from_orderpoint_get_groups`
3. The `res_groups` values are used in `_procure_orderpoint_confirm`
   when calling `_prepare_procurement_values`.
4. `_prepare_procurement_values` is overridden by `stock_calendar` to
   set a value for `next_delivery_date`. At this point, the `now` value
   is used.
5. Finally, when creating the PO line, `_prepare_purchase_order_line` is
   overridden by `stock_calendar` to set the `next_delivery_date` as
   `date_planned`.

So, `date_planned` becomes `now`.

There should not be any date set when no `calendar_id` is defined.

opw-1828371
2018-04-10 11:10:29 +02:00
Nicolas Martinelli 77bf2c96af [FIX] stock_landed_costs: defer AML creation
In order to improve the speed of landed cost validation, we defer the
creation of AML at the very end of the process. This way, we don't
suffer from various performance issues caused by:
- cache invalidation (use of `with_context`)
- recomputations

opw-1824661
2018-04-10 11:02:36 +02:00
len-odoo eca99f1f12 [FIX] point_of_sale: fix quantity rounding
When the user set a decimal accuracy on the product quantity, the point_of_sale
(POS) frontend would display the correct rounding of the quantity according to
both the decimal accuracy and the rounding set on the unit of measure.
However the quantity used to compute the price was only using the rouding on the
unit of measure. This led to an inconsistency in what is encoded in the backend,
and thus made it impossible to close the session as the price paid by customers
did not match what is encoded.

The problem comes from the fact that there is a variable this.quantity and
another one to display this.quantityStr. Unsurprisingly, this.quantityStr
was not computed directly from this.quantity, leading to the inconsistency.

opw 1826092
2018-04-10 09:32:05 +02:00
Goffin Simon ec7f88c334 [FIX] account_asset: Access error with shared product with deferred revenue
Steps to reproduce the bug:
-Let's consider a multicompany environment with company A and B
-Let's consider a shared product P for A and B
-P has a deferred revenue type D set on it
-D is defined in A
-Let's consider a user U in company B
-U creates a SO with P and try to generate the invoice

Bug:

A access error was raised because U is not allowed to see D and
D is needed to genrate the invoice.

opw:1825944
2018-04-09 14:47:31 +02:00
Goffin Simon 026781ec3e [FIX] account: Validating a statement with old posted moves
When validating a statement with old posted moves, the lock date
was checked by function, _check_lock_date and then it was impossible
to validate the statement even if all the moves were already posted.

Backport of this commit: 86a0d31251

opw:1830804
2018-04-09 14:33:29 +02:00