Commit Graph
117975 Commits
Author SHA1 Message Date
Nicolas Martinelli f536592691 [FIX] web: inline views should share their fields
This causes issues (already 3, and counting...)

This reverts commit 27c9f838d3.

opw-1840984
opw-1841041
opw-1841000
2018-05-03 08:30:55 +02:00
Joren Van Onder a91512daf6 [FIX] gamification: support large amounts of goals in update_goals
update_goals is called through the 'Run Goal Challenge Checker'
cron, potentially on a large amount of goals.

With self containing ~400k records a worker has been observed to use
~3.4 GiB. With sensible memory limits this will probably cause the
worker to be killed.

To avoid this turn of prefetching in this initial loop. Performance
shouldn't be affected too much because in the following loop
prefetching for goals will still take place per definition.

opw-1840666
2018-05-02 16:01:50 -07:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Martin Trigaux 521414b1c1 [FIX] l10n_be: remove hardcoded translations
These translations were for the first company only ('1_' part)
The process_translation part in l10n_multilang is enough to propagate the
translations of the templates to the accounts
2018-05-02 17:03:31 +02:00
Christophe Simonis f3af5745ca [FIX] website_slides: import function from right place
Oversight of previous forward-port
2018-05-02 16:32:30 +02:00
Oscar Ulises Garza Cordova cfe094acee [FIX] stock_account: valuation value on out moves
- Set the system parameter "stock.propagate_uom" to 1.
- Create a Sale Order with a product (1 Dozen).
- Confirm the Sale Order
- Validate the stock picking with 1 Dozen of quantity done.
- See the stock move form.

The value of the stock move is the price unit and not the correct value
because the amount is computed by the quantity_done (1) and not
12 Units.

Closes #24352
opw-1838335
2018-05-02 15:40:01 +02:00
Christophe Simonis 320b631c81 [MERGE] forward port branch saas-15 up to 810603f4ef 2018-05-02 15:34:42 +02:00
Yannick Tivisse 97889d20c4 [IMP] base: Add a new module category 'Document Signatures' 2018-05-02 15:03:25 +02:00
K. Aberer 1bf3429b23 [CLA] signature for nomadic-coding
Closes #24515
2018-05-02 14:53:41 +02:00
Christophe Simonis 810603f4ef [MERGE] forward port branch saas-14 up to 55ce6aff10 2018-05-02 14:49:58 +02:00
Vincent Schippefilt 8ec9a39aa7 [IMP] web: set focus on item when using accesskey
on Firefox, the focus was not set automatically on the search input when
the Q accesskey was used.
Now we set the focus before activating the item that is the target of
the accesskey
2018-05-02 14:49:23 +02:00
Vincent Schippefilt a017946737 [FIX] web: allow focus to move to a field monetary
In the chart of account editor, which is an editable list with 2
contiguous monetary field, we could not change the first then move to
the second using the TAB key: the focus was not set on the input of the
second monetary field, and when it is, that input is destroyed and
recreated so the focus was lost

Before this fix, the user needed to hit TAB twice to move to the next
field.
After this fix, the user can navigate between fields monerary with TAB
2018-05-02 14:49:23 +02:00
Vincent Schippefilt 7cf68c838b [FIX] web: kanban card do correct action on ENTER key
When the focus is on a kanban card that do not have
oe_kanban_global_click or oe_kanban_global_click_edit when hitting the
ENTER key,
before this fix, the default action was to open the record of the card
after this fix, the action executed will be the action of the first
button or link of the card

if the card has the oe_kanban_global_click or
oe_kanban_global_click_edit class, the record still opens with ENTER key
2018-05-02 14:49:23 +02:00
Christophe Simonis 55ce6aff10 [MERGE] forward port branch 10.0 up to 79bbd1dcb8 2018-05-02 13:52:12 +02:00
Nicolas Martinelli 79bbd1dcb8 [FIX] product: name search not ilike
- Create a product named 'toto'
- Perform a call to `name_search`:
  `self.env['product.product'].name_search('pouet', [], 'not ilike')`

Product 'toto' doesn't show up in the result list.

The domain should take into account that `default_code` can be `False`.

Note: the bug also occurs if the product is called 'trululu'.

opw-1837957
2018-05-02 12:58:52 +02:00
Nicolas Martinelli 5ac9d8e57f [FIX] product: variant in partner_ref
- Create a product with 2 variants (e.g. black and white)
- Create an invoice with one of the variant

The description doesn't contain the attribute name, as it would be in a
SO.

This is because the invoice uses `partner_ref`, which doesn't include
the attribute name.

opw-1839598
2018-05-02 12:39:16 +02:00
Thibault Delavallée 635932fe09 [MERGE][REF] mail: optimize a bit notification process and lessen query count
This merge cleans a bit code called during notification process to avoid
browsing / prefetching unnecessary data and optimize a bit performances.
Please see sub-commits for more details.

All performance tests in test_mail are improved. On overall community
runbot about 13K queries are gained with this merge.

This merge is linked to task ID 1838693. Closes #24374. Please also refer
to commit https://github.com/odoo/enterprise/commit/0a3ba658f18e03fd76caba86cba7be32d047f0a9 done in enterprise
that cleans a bit mobile notification code.
2018-05-02 11:46:06 +02:00
Thibault Delavallée c5c369355d [IMP] mail, mass_mailing: clean mail body processing and mail sent post processing
Purpose is to lessen query count by avoiding to browse and/or fetch data when
not necessary. This commit does two main things

 * first one is to avoid checking for existing statistics in mass_mailing
   where only checking existing of a mass_mailing on a mail to send is
   sufficient. It allows to avoid fetching data from statistics table;
 * second one is to rewrite part of the post_process code called after sending
   emails. Using list comprehension and mailing_id existence on mail_mail
   allows to save several queries on standard post flows;

Most tests benefit from this code update. On overall community runbot about
3K queries are saved with those small optimizations.
2018-05-02 11:42:24 +02:00
Thibault Delavallée 0603dab655 [IMP] test_mail: update top counters due to enterprise update.
mail_push module in enterprise was adding too much extra queries. mail_push
being auto-install in enterprise mail performance tests were done with its
overhead taken into account. Commit done in enterprise cleaned a bit the code
to lessen mail_push impact allowing to lessen some top counters. Community
runbot counters are now nearer enterprise-based counters.

This commit is related to enterprise commit https://github.com/odoo/enterprise/commit/0a3ba658f18e03fd76caba86cba7be32d047f0a9 .
2018-05-02 11:41:27 +02:00
Thibault Delavallée 058d2fd4f6 [REF] mail: shortcut chat notification if no one to notify
Well, it seems we gain a lot of query when avoiding to format a message we
actually don't have to send on any bus. Cheers.

Formatting message for bus notification is quite costly as it has to fetch
data from message, partner, attachments, subtypes, ... meaning a lot of
queries. With this commit we avoid calling that method when not necessary.

It allows a gain of queries in simple cases when no-one has to be notified
as shown in the performance counters. On overall community runbot about 9K
queries are saved which is not bad for a 2-lines commit.
2018-05-02 11:39:57 +02:00
Nicolas Martinelli 8ee2a0d191 [FIX] account_asset: avoid company mismatch
On existing databases, the SQL not null constrain is not removed, making
the creation of new assets impossible. This is because a computed field
is not inserted at creation, but written afterwards.

This reverts commit 0c76bd3c63.

opw-1840661
2018-05-02 11:29:51 +02:00
Thibault Delavallée c832452590 [IMP] mail: update subscription instead of unlink / create new followers
In some cases when subscribing followers code may ask to force subtypes
of the subscription. It means existing followers should have only asked
subtypes independently from existing subtypes. Previously it was done
by unlinking and creating new followers for same partner or channel.
This commit proposes to instead update missing subtypes and remove extra
subtypes.

It has a small impact in real life as forcing subtype is not done often.
Some tests are improved thanks to this commit. This commit is linked to
task ID 1839043. Closes #24417.
2018-05-02 11:18:22 +02:00
Lucas Perais (lpe) 27c9f838d3 [FIX] web: inline views should share their fields
Have a One2Many
The views of that o2m define two inline views: the list and the form

in the list view, put a field that isn't in the form and used in a domain
Try to add an item to the list
The form pops up

Fill in the data and save & close

Before this commit:
It crashed when evaluating the domain on a field using the field that is not in the form

After this commit:
Subviews share their fields in a special object on the parent record
In our case, the form view checks in that shared resource if the fields it is supposed to initialize
are there.
Hence, this flow doesn't crash anymore

OPW 1837511
closes #24350
2018-05-02 11:09:50 +02:00
Christophe Simonis a33362bb51 [MERGE] forward port branch 9.0 up to 532b11ce41 2018-05-02 11:01:38 +02:00
Géry Debongnie e0424b9603 [FIX] web: fix form_view_id attribute in calendar view.
The way the calendar view selected its form view was broken for two
reasons:

- any value given in the form_view_id attribute was kept as string,
  which means that the string value would be sent to the server, and
  this is not good.
- if no value was set, the calendar view then simply did a do_action
  with the form view id set to false, which means that the default form
  view is used.  This is mostly ok, except when we are in the context of
  an action with a form view which is not the default one.  In that
  case, we clearly prefer the form view from the action.

For example, before this commit, the form view in the timesheet
application (community) is not the same as the default form view on
account.analytic.line.

Note that this commit also adds a small tweak to the mock server to
better simulate errors like the web client does (in session.js).
2018-05-02 10:51:45 +02:00
Lucas Perais (lpe) 208a400b06 [FIX] website_slides: avoid mixed content iframe when computing iframe src
Have a nginx set up with HTTPS (and the web.base.url too, obviously)
HAve a multilang website
Call a slide with the https domain with the non-default lang in the path of the resource
[https://domain/fr_FR/slide....]

Before this commit, when the iframe src is requested for by the browser
the python will transform the url of the iframe by injecting /fr_FR/

When the request for the *content* of the iframe is actually fetched by the browser, there is a mixed content
(though in the SAAS case and through cloudFlare for some reason)

After this commit, since we explicitly form the iframe src with lang, there is no error of mixed content

OPW 1839308
closes #24445
2018-05-02 10:03:22 +02:00
Lucas Perais (lpe) 472c5a4f9f [FIX] web_editor: disable button when html field loading
Commit bed33e1ca2 forgot to include the case
where the html field is in a modal

This commit accounts for that case

closes #24500
2018-05-02 09:58:04 +02:00
Nikunj Ladava 95a90689aa [FIX] l10n_fr{certification,_pos_cert}: Set server actions' 'state' to 'code'
Since these server actions are triggering python code, their 'state' field must explicitely be set to 'code'.
Currently it is taking default value for 'state' field which is, since saas-15, 'object_write' and thus not working as intended.

Was PR #22706
Was task: 1813998
2018-05-02 09:54:58 +02:00
Lucas Perais (lpe) 2f5e44d40b [FIX] web: checkbox in editable list are clickable
Having boolean checkbox in an editable list

Before this commit, the checkbox was disabled, thus not clickable
The user, who probably expects to click on it to tick/untick
was thus misled, and needed to click *outside* the checkbox in order to activate the row
and only then tick the checkbox

After this commit, the behavior is as expected from the editable list point of view
clicking anywhere in the row (inlcuding on the checkbox itself) activates it into editable mode

OPW 1836067
closes #24292
2018-05-02 09:52:50 +02:00
Lucas Perais (lpe) a21db141d4 [FIX] account: soften the constraint on company_id on partner's fp
Have a partner with company_id = False
Your user is currently in company A

Before this commit, only FPs with no company id could be set on the partner

After this commit, FP without company or belonging to company A are available

The drawback is that since this computation takes place in an onchange, when you first arrive on the partner
no filter is applied and you can choose whatever FP that appear
This might cause access errors when it is misued

related to #24256
closes #24507
2018-05-02 09:47:53 +02:00
Vincent Schippefilt 151594af05 [DOC] web: client actions must be AbstractAction 2018-05-02 09:26:50 +02:00
Odoo Translation Bot 532b11ce41 [I18N] Update translation terms from Transifex 2018-05-01 02:39:26 +02:00
Jaykishan Solanki b34f26406f [IMP] sale_order_dates, sale_stock: change dates computation
In order to make the module more userfriendly:
  - Some labels have been changed/added
  - The Commitement date is now called the Expected date
  - The Requested date becomes the Commitement date
  - The Effective date is now related to the picking `date_done`

Task #34343
Closes #18325
2018-04-30 17:41:53 +02:00
jem-odoo 2ebf703420 [MOV] purchase: split code in right file to fit guidelines
No code changes, simply move them to the right places,
the place where they should be.
This will ease the split between stock and purchase
addons.
2018-04-30 17:19:38 +02:00
Henry Zhou b36cc498b6 [ADD] l10n_cn: add new 16% rate
and correct the '%' character
Source: http://www.chinatax.gov.cn/n810341/n810755/c3377945/content.html

Closes #24475
2018-04-30 16:54:29 +02:00
Adrien Dieudonne fa2ea4683e [FIX] barcodes: Android Odoo app webview not detected as chrome
Before this commit, it wasn't possible to use a barcode scanner
with the Odoo mobile app.
However it works fine for mobile Chrome browsers.

We now know that 'keypress' event doesn't work as expected in
Chrome for mobile. See @3a74afd21
It's why 'keydown' detection has been implemented.

We also want to use this detection in our Android app.
Unfortunately, 'window.chrome' doesn't seem to exist anymore
in the Android webview.

In this commit, we change the way Chrome is detected.
2018-04-30 16:14:46 +02:00
Adrien Dieudonne 9e14d93c05 [FIX] barcodes: keep vertical position while scanning
Before this commit, you were automatically redirected to the top of
the page when you scanned a product.
It was, therefore, difficult to find the product that had just been
scanned and to check its quantity.

Because of @3a74afd21 we need to put the focus in an invisible input
at the top of the page.

This input is now always vertically centered in the middle of the page.
2018-04-30 16:14:38 +02:00
Kishan Gajjar 28d763f4b3 [FIX] website_sale: properly compute scss files
In LESS, writing `100% / 4` gives `25%`.
In SCSS, to get `25%` the operation must be wrapped with parenthesis.
This commit is even using a better method: using the `percentage`
function.

Closes https://github.com/odoo/odoo/pull/24501
2018-04-30 15:46:18 +02:00
JulioSerna 29c29b4578 [FIX] purchase: wrong get 'group_id'
The error before this pr could be reproduce with the steps,
- Create two warehouse WA and WB
- Create Route to get: Purchase in WA and transfer to WB
- Create product with Route created before
- Create orderpoint to WB
- Run scheduler

If there is no purchase created the `_run_buy` method tries to create a
PO, but if there is no `group_id`, a traceback occurs.

Closes #24353
opw-1838384
2018-04-30 14:54:01 +02:00
Nicolas Martinelli 8baee81c79 [FIX] hr_expense: account on expense
- Set a specific expense account on an expense product
- Send an email to the expense alias

The specific expense account is not used; a default account is used
instead.

opw-1838174
2018-04-30 14:46:15 +02:00
Simon Lejeune 518ed13602 [FIX] stock: backorder
Do not try to keep the reservation when creating a backorder for two
reasons:
    1) it doesn't make sense since the backordered move will only be
    confirmed while it got some reserved move lines
    2) with badly configured uom's rounding,  it is possible that the
    initial demand of the backorder is inferior to the now reserved
    quantity

We also fix another "cannot unreserve more than available" cause that
could happen in the second case ; let's imagine in the second case that
the backordered quantity is 0.999, `_update_reserved_qty` will reserve
0.999 on the quants but do not create a move line as range (0, 0.999)
will not return anything.

We remove `test_split_1` as it tested a behavior we removed and add a
new test showing a new flow with what we fixed.

Please note that setting the rounding of unit to 1.0 would have
prevented all the issues here.
2018-04-30 11:05:33 +02:00
Simon Lejeune 4322985a8a [FIX] stock: rounding issues
Followup of rev 383947646f

Let's say you have 6 units and you try to reserve a dozen while the
rounding of the dozen is 1.0. The previous commit correctly only allows
to reserve 12 units, and handle correctly forced quantities in other
compatible UOM, all that with extra moves/backoders.

But we missed an important issue: if now you have 12 units, you will
reserve them. If these 12 units are split across quants, i.e. some are
in another sublocations or are assigned a special lot_id, then we'll
again have rounding issue because the reservation was always expressed
in the move's uom while sometimes it is not possible to go back and
forth between the move uom and and the product's uom. In other word,
we'll reserve 12 times 0 dozen and get stuck at the next step.

This patch now only reserve a quantity if the quantity is expressible in
the rounding's UOM. If this quantity is split across multiple move
lines, we'll make the move line reserved in the UOM of the quants if
necessary. We also do not apply the rounding down -> halfup dance if
`_update_reserved_quantity` is called with the force argument set as
True (meaning, in an mto scenario). The change in
`_prepare_move_line_vals` will make the move lines in the uom of the
qants and everything should be good. With the last change, we need to
adapt the test added by the previous patch, else we won't  be able to
make a chain of 2 move moving producst tracked by serial number if the
rounding of the dozen is set at 1.0.

opw-1835186
opw-1835946
2018-04-30 11:05:33 +02:00
Sanjay Jamod 7862b2b71c [IMP] website_event: quick add to Outlook/Google Calendar
In order for the user to easily add the date of the events to his
calendar we need to facilitate the integration with Outlook/ Google
Calendar.

For this we add two buttons at the end of the subscription phase (one
for Google Calendar and one for Outlook [ics file download])

Task ID: 39315
Closes #21854
2018-04-30 10:58:20 +02:00
Simon Lejeune 0e28b858e0 [FIX] stock_account: fifo, anglosaxon and return
When computing the amount of the anglo saxon entry, if it's a vendor
bill only consider IN move, if it's a credit note only consider out move
(the returns).

opw-1819353
2018-04-30 10:25:42 +02:00
Hiral Bhavsar eb55eda740 [FIX] crm: change the position of a tour step
One step of the crm tour was not visible on large screens.

Related to Task: #1839210
Closes #24472
2018-04-30 10:01:23 +02:00
Hetashree Chauhan 71f80c1383 [IMP] im_livechat: move input_placeholder
In order for the user to understand what the chat_input_placeholder
field means we should add a tooltip.
We should reorganize the fields in order to put them in logical order.

This commit is related to task 1837812.
Closes #24336
2018-04-30 09:50:33 +02:00
Nicolas Martinelli 48e04dcb97 [FIX] sale_payment: catch error at invoice creation
- Set up Paypal as described in
  https://www.odoo.com/documentation/user/11.0/ecommerce/shopper_experience/paypal.html
- Buy a product on the eCommerce.

The vendor might receive an email mentioning that Instant Payment
Notifications (IPN) are failing.

When completing the paypent process with Paypal, 2 confirmations of the
transaction will occur. The first one is through the route
`/payment/paypal/dpn` (Payment Data Transfer (PDT)), which takes place
right after the payment validation. The second confirmation comes
through the route `/payment/paypal/ipn` (Instant Payment Notification
(IPN)), which might arise with some delay (and potentially being run
several times).

Both confirmations will trigger the method `_generate_and_pay_invoice`,
which can raise an error if no invoiceable line is found ('There is no
invoiceable line.' in `sale` module). In this case, we should log the
error and move forward instead of crashing and stopping the workflow.

More information on PDT and IPN at
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNPDTAnAlternativetoIPN/

opw-1837196
2018-04-30 09:22:39 +02:00
Odoo Translation Bot 3596e67afb [I18N] Update translation terms from Transifex 2018-04-29 07:03:45 +02:00
Odoo Translation Bot b8112869f0 [I18N] Update translation terms from Transifex 2018-04-29 04:12:39 +02:00
Odoo Translation Bot 5ff3c03410 [I18N] Update translation terms from Transifex 2018-04-29 00:28:03 +02:00