Commit Graph
117753 Commits
Author SHA1 Message Date
Alexandre Kühn fa2a5055e7 [FIX] im_livechat: instantly receive messages from new livechat
Before this commit, when new messages were posted in a new
livechat, the operator received them after a delay. This
may take up to a minute before receiving the notification.

This behaviour was causing a bigger issue: those notifications
may never be received by the operator. This case happened when
the operator was receiving more recent notifications while
notifications from new livechats were pending.

The delay was caused by the operator not yet subscribed to
notifications on the newly created livechat. It is only on
the next poll of longpolling that the subscription occurred,
then followed by dispatching the notifications to the operator.

This commit fixes the issue by dispatching new messages of new
livechats directly to the operator. This is done by enforcing
the operator to make another polling when a new livechat is created,
so that he is always subscribed to those livechats. As a result,
new messages are received instantaneously.

opw-1933951

closes odoo/odoo#31191
2019-02-18 12:20:40 +00:00
Xavier Morel f53ad8a4fd [FIX] search_filters: broke a thing in f1a85ba
As part of fixing the JS docs (docstrings & references & ...), the
various search filters were de-namespaced (aka
ExtendedSearchProposition.Integer = ... -> var Integer = ...).

This had the side-effect of making a `new Date` refer to the extended
search Date field instead of the global Date object, which went
unnoticed because *that* had been wrapped in a moment() call, and
moment() apparently doesn't mind being given garbage, but it would also
create an "unbound" and thus never destroyed widget.

Remove the `new Date`, calling moment directly has pretty much the same
effect, moment objects created from date objects just have an extra
field (a cache for the date object I guess).

closes odoo/odoo#30791
2019-02-04 09:17:41 +00:00
Odoo Translation Bot 9837f250d3 [I18N] Update translation terms from Transifex 2019-02-17 03:14:20 +01:00
Nicolas Lempereur d766f4f00b [FIX] crm: no context default user crm.lead
default_user_id on the crm.lead window actions is not needed since the
current user is already the default on the field.

So all it does is prevent user-defined values to work and possibly
affect custom code that may not expect the behavior.

opw-1938037
closes #31151
2019-02-15 13:29:07 +00:00
Jorge Pinna Puissant 68a37f26c6 [FIX] website_sale_delivery: wrong placement of use strict
The use strict statement was outside the odoo.define statement. The use
statement could be applied to other statements.

Now, the use strict is in the odoo.define.

closes odoo/odoo#31128
2019-02-15 08:31:17 +00:00
Jorge Pinna Puissant c117caae1b [FIX] website_sale_delivery: selection when waiting of shipper rendering
- Set up as a normal shipper and one which will cause an
error (e.g. service not available for customer address; or no price rule
matching)
- Order a product on eCommerce, go to Payment page

When changing of delivery method, from the second delivery, to the first
and to the second delivery again, the behavior of the 'Pay Now' button
is the follow:
* choose second delivery - button disabled
* choose first delivery - button enabled
* choose second delivery - button disabled

If the connection to the server is to slow, the choose of the delivery
and the state of the button are not syncronised. That means that at the
end of this changing, the button stays active long enough to click it,
and pass an order without a delivery charge.

Now, only the last request is take into account, and the false positives
are avoided.

opw-1937575

closes odoo/odoo#31127
2019-02-15 07:48:19 +00:00
Daniel Reis 84affe37a1 [FIX] stock: traceability report: performance
Replaced an inefficient domain by a filtered expression.

closes odoo/odoo#31086
2019-02-14 15:56:17 +00:00
Nicolas Martinelli 287e0507f1 [FIX] stock: incorrect forward-port
closes odoo/odoo#31126
2019-02-15 07:09:44 +00:00
Christophe Simonis b277705e52 [MERGE] forward port branch saas-15 up to c0f24d54cf 2019-02-14 18:42:19 +01:00
Christophe Simonis c0f24d54cf [MERGE] forward port branch saas-14 up to c1fe9f18d5 2019-02-14 18:14:08 +01:00
Christophe Simonis c1fe9f18d5 [MERGE] forward port branch 10.0 up to 69719f598a 2019-02-14 18:09:24 +01:00
Denis Ledoux 69719f598a [FIX] google_calendar: case insensitive attendee sync
In Odoo, create a user John@example.com (the cap is on purpose)
In Google Calendar, create an event and invite john@example.com

Sync your Google calendar.

Before this revision,
the event created in Odoo did not add John@example.com,
but created a new attendee, john@example.com, because
of the sensitive casing.

Besides, give the priority to partners having
users, so if there are two partners with the same email,
one of them having a user,
e.g. John@example.com (with user) & john@example.com (without user),
set the partner having the user as attendee,
as its the one with the user who use the Odoo calendar,
and potentially the Google sync as well.

opw-1925592

closes odoo/odoo#31111
2019-02-14 11:07:25 +00:00
Nathan de Pryck db691dbebf [FIX] account: reverse entry when account move line contains 0 in credit or debit
In some case, when the user enter by mistake an account move line
 with an amount of 0,the reverse operation does not works properly.
The issue happenned during the reverse operation because it tries to
reconcile a 0 account move line with no matches (credit or debit).

See opw-1931961
2019-02-14 09:13:24 +01:00
Raphael Collet cd3790c4ea [FIX] models: check groups on inverse fields
Before this, groups on non-stored inverse fields were not checked upon write.
The impact on existing fields is pretty small, since the inverse methods of
those fields are subject to access rights on the records they use.

closes odoo/odoo#30356
2019-02-13 10:35:09 +00:00
Jorge Pinna Puissant 38be857b40 [FIX] account: rounding error with multi-currency payment
Steps to reproduce:

- activate the multi-currency option in the Accounting App
- activate the EUR currency (USD being the base currency)
- create a EUR Bank Journal with an EUR account
- rate = 1.4
- create a vendor bill for Asustek for 1000,10 EUR
- create a vendor bill for Asustek for 500,00 USD
- create a supplier payment for Asustek for 1000,00 EUR
- use the payment matching smart button
- match the vendro bill of 1000,10 with the payment;

Bug:
Odoo says that the total amount in EUR matches.

Expected Behavior: An open-balance to write-off and prevent from
reconciling.

opw-1935414

closes odoo/odoo#31055
2019-02-13 09:37:31 +00:00
Hugo Adan a9fa46fdc8 [FIX] mass_mailing: make retry failed mail work with keep archive set to False
Let M be a mass_mailing.
For all messages m related to M, retry_failed_mail removes the mail
statistics
of m before putting M 'in_queue'.
Since there are no statistics on m, its recipient is returned by the
function
get_remaining_recipients when called by send_mail once M is processed.
However when keep archive is set to False, the 'mail.mail' records
are automatically removed. As a results their statistics are not
removed,
and thus these mails are not retried.

closes odoo/odoo#30158
2019-02-13 14:55:29 +00:00
Julien (juc) Castiaux 090c3a06c8 [FIX] base_automation: remove unnecessary button
Fine tunning of c12a0f5a

opw-1937928

closes odoo/odoo#31065
2019-02-13 12:51:56 +00:00
Nicolas Martinelli 3dbf51babe [FIX] sale_timesheet: cost with different UOM
- Create a Service article:
  UoM = Day(s)
  Invoicing policy = on ordered quantity
  Tracking = Task in project
- Create a SO: 10 days, unit price = $100 and validate.
- On the task created, the initially planned hours is equal to
  80 (10 * 8h).
- On this task, timesheet some hours with several employees:
  15 hours
  10 hours
  10 hours

The `timesheet_revenue` on analytic lines is incorrect:
  1000
  0
  0

It should be:
  187.5
  125
  125

The unit conversion between days and hours is not performed...

opw-1925320

closes odoo/odoo#31062
2019-02-13 11:18:55 +00:00
Lucas Perais (lpe) 61623bd17c [FIX] fields: read/write company-dependent fields without ir.property access
This is the first step to a more comprehensive handling of company-dependent
fields which are ir_properties.

With model-specific access rights, users should be able to read/update a
company-dependent field no matter their access rights on ir_property.

Before this commit, a user having access to res.partner, but not to ir.property
couldn't write on property_account_receivable/payable just because he couldn't
write the corresponding ir.property.  After this commit, he can.

OPW 1923345
2019-02-13 09:34:08 +00:00
Lucas Perais (lpe) b62d720c85 [FIX] l10n_it: change website in manifest
openerp-italia.org or odoo-italia.org are not valid websites

changing it to odoo.com

OPW 1940848

closes odoo/odoo#31110
2019-02-14 10:55:36 +00:00
Nicolas Lempereur 0857737f8c [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

note: backport of 11.0's 7a453b0b7a

In 10.0 this trigger could cause a "blur" which in some instance is not
wanted (eg. inside a newline of a list view).

opw-1906581
closes #31078
2019-02-13 17:21:19 +00:00
Nicolas Lempereur 1e43c73a99 [FIX] web_editor: html widget empty value stay empty
The html widget automatically replace an empty field value by
`<p><br></p>` to be able to add content.

But this may cause unintended "onchange", since the value has "changed"
and the onchange themself could cause error when triggered at the wrong
time (eg. inside a list view with required fields).

With this changeset, the onchange is averted when the value was false
and is now `<p><br></p>`.

opw-1906581
closes #31078
2019-02-13 17:11:13 +00:00
Invitu 56631c86c6 [CLA] Add contributors to INVITU
closes odoo/odoo#31040
2019-02-12 17:00:43 +00:00
Gabriela Mogollon a703d9f7c6 [FIX] l10n_mx: add new taxes for 8% sale/purchase
The tax for 8% is used in the northern border zone of Mexico

Is a new tax and must be used in the DIOT report and in the CFDI for
sales.

closes odoo/odoo#31046
2019-02-13 07:02:46 +00:00
Yannick Vaucher f610a28670 [IMP] models: more meaningful comment for the ensure_one implementation
See discussion comment
https://github.com/odoo/odoo/pull/30817#discussion_r255899919

This revision is related to
ce0575ef27
2019-02-13 11:01:30 +01:00
Lucas Perais (lpe) 5b37c40cac [FIX] point_of_sale: reconcile cash returns rather than freight returns
Revert commit 296c5a2106
which was half-right: the accounting logic is correct but it overlooked
that it broke the reconciliation of cash returns
i.e. the client gives more money, and you return the change

Given that this latter use case may occur more frequently we focus on that
while we break freight returns
i.e. the client returns a product, and you give the money back

It is not possible to support both use cases because
ultimately we don't know from which order an account.move.line comes

the related PR #23356 should support both use cases
but adds a field on account.move.line

OPW 1925607

closes odoo/odoo#31037
2019-02-12 16:27:51 +00:00
Moens Alexandre 7dea5c418b [IMP] base_import_module: tell user what they actually can import
This commits adds a message to the module import wizard to make it more
clear what kind of modules can be imported through the front end.

project : RD feedback
task : [base_import_module] what it is not for.
opw-1939967

closes odoo/odoo#31057
2019-02-13 11:50:51 +00:00
Denis Ledoux 5ebcd188f3 [FIX] stock: improve performance of product quantity search
Calling `search` on `product.product` without specifying an order
will sort the products by name.

As the product name is a translatable field,
it requires to make a join on the translation table to sort
the product by their translated name.

This join is costly, and in this case it was completely
irelevant to do it, as the goal was simply to compute
a domain with only a list of product ids, for which
the order simply did not matter.

By forcing the order on the id,
we avoid the sort on the product name,
and therefore the join on the translation.
The performance is therefore improved.

opw-1930010

closes odoo/odoo#31066
2019-02-13 12:52:48 +00:00
Nicolas Martinelli f221936f8b [FIX] stock: location company
Force the location and destination location's company to match with the
picking and picking type company. This is to prevent users to move
products between companies without using a transit location, since stock
valuation is not supported.

The record rule `stock_location_comp_rule` gives access to children
companies. The domain added in the view is more restrictive, and allows,
for a company A, transfers from locations:
Company A -> Company A
Company A -> No Company
No Company -> Company A

opw-1893276

closes odoo/odoo#30952
2019-02-11 11:14:26 +00:00
Naglis Jonaitis af95efcfd6 [CLA] signature for naglis
closes odoo/odoo#30978
2019-02-11 07:05:59 +00:00
Christophe Simonis 9773be345e [MERGE] forward port branch saas-14 up to 18228f9c4e 2019-02-08 13:28:46 +01:00
Christophe Simonis 18228f9c4e [MERGE] forward port branch 10.0 up to be689c53c1 2019-02-08 11:40:01 +01:00
qsm-odoo be689c53c1 [FIX] web_editor: review drag and drop in the editor
When dropping a snippet into a page, it is dropped in the drop-zone
which is the nearest of the user cursor. When moving a snippet, that
condition did not apply and the user was required to put the cursor at
the exact location of the drop-zone.

Also, for both drag and drop features, the drop zones which appeared
were not displayed correctly for full width columns, which made dropping
sometimes impossible when multiple col-*-12 were below each other.

task-1937758

closes odoo/odoo#30899
2019-02-07 11:12:36 +00:00
RomainLibert 0757ba3c63 [FIX] fleet: fix _get_default_state method
If fleet.vehicle_state_active is not found in the system then the method
will raise an error, hence it won't allow creating any fleet.vehicle

closes odoo/odoo#30925
2019-02-07 15:25:13 +00:00
Nicolas Martinelli fa97d6ab15 [FIX] purchase: supplier on parent company
- Create a product and set a contact as the vendor (for instance, Arthur
  Gomez from Asustek in the runbot)
- Set a specific name and code for the supplier
- Create a RFQ for this vendor (Arthur Gomez - the contact person)
- Add the product, confirm the RFQ

On the product, the company (Asustek) is automatically added as vendor,
but there is no vendor name and code.

opw-1929745

closes odoo/odoo#30891
2019-02-06 14:17:45 +00:00
Josse Colpaert 845a6a9e08 [FIX] stock: lot in multiple locations
- Activate:
  'Track lots or serial numbers'
  'Manage several Warehouses, each one composed by several stock locations'
  'Advanced routing of products using rules'
- In the main warehouse, activate Pick + Ship
- In Stock Locations, create 'WH/Stock/Shelf 3' and 'WH/Stock/Shelf 4'
  (1 and 2 already exist, use the same config)
- Create a new product 'Foo', activate Tracking By Lots
- On Foo, use 4 times the "Update Qty on Hand" (order is important):
  Add 1 on Shelf 2, create a lot
  Add 1 on Shelf 1, use the same lot
  Add 3 on Shelf 4, use the same lot
  Add 1 on Shelf 3, use the same lot
- Create a SO, set a partner
- Ensure that YourCompany is used as warehouse
- Add several SO lines (order is important)
  a line with 1 product Foo
  a second line with 1 product Foo
  a third line with 4 products Foo
- Confirm the SO, you now have 2 deliveries, 1 Pick, 1 Out
- Open the Pick, all moves should be available, you should have:
  4 operations:
    Shelf 2, quantity 1
    Shelf 4, quantity 3
    Shelf 1, quantity 1
    Shelf 3, quantity 1
  3 moves:
    A, quantity 1
    B, quantity 1
    C, quantity 4
- On each operation, select the lot created before and set the quantity
  to be fully done
- Validate the Pick

The moves end up like this:
- Move A with qty 1: is done and linked with a quant of 1
- Move B with qty 1: is done and linked with no quant
- Move C with qty 4: is done and linked with a quant of 1, a quant of 3,
  a quant of 1 (sum is 5)

In the Out picking, the move linked with the source move (B) with no
quant stays in "Waiting another move" even if the source move is done.
This outgoing move will never be available.

In the method `recompute_remaining_qty`, we loop on operations, and
match them wih the moves. However, the operation with the largest
quantity (Shelf 4, quantity 3) is processed before the move with the
highest quantity (C, quantity 4). Therefore, when we later loop on move
C, `qty_assign_cmp` is larger than zero, which sets `need_rereserve` and
ultimately triggers `rereserve_quants` in `do_transfer`.

A first part of the fix is to check for the location of the quants when
matching moves and operations. This fixes the original issue, but
inconsistencies can still arise since a quant which is taken partially.
therefore, we make sure to never take more than the quantity on the
link.

opw-1932624

closes odoo/odoo#30857
2019-02-06 08:55:56 +00:00
Nicolas Martinelli c7c938996f [FIX] account: analytic cost
- Set a cost of 12.34 for product P
- Create manually a new analytic entry
- Choose product P
- Set desired quantity

The analytic amount is set to 12.00.

This is because `move_id` is empty, therefore `currency_id` is empty as
well and `decimal_places` is zero

opw-1924184

closes odoo/odoo#30869
2019-02-06 10:27:59 +00:00
Atchuthan, Sodexis d89f4d6ec2 [FIX] stock: set picking_type_id to readonly except in draft state
Before this commit, the customer is allowed to change picking type after the
stock.picking record is moved from draft.
But it doesn't make the changes in the stock moves and operations as the
procurements are already created for initial demand.

To avoid confusing the user, it can now only be modified in draft state.

Authored by SodexisTeam

opw 1848252
opw-1934814

closes odoo/odoo#30865
2019-02-06 09:50:35 +00:00
Christophe Simonis 66efbf2b5b [MERGE] forward port branch saas-14 up to 53ba83579b 2019-02-05 12:36:15 +01:00
Christophe Simonis 53ba83579b [MERGE] forward port branch 10.0 up to 8cb2965e23 2019-02-05 11:41:23 +01:00
Nicolas Martinelli 8cb2965e23 [FIX] stock_account: AVCO with MRP
- Create a product P with:
  Costing Method       Average Price
  Inventory Valuation  Perpetual (automated)
- Create a component C with, costing 10.
- Create a BOM for P:
  1 Unit of C
- Create a MO for P, validate
  => a journal entry of 10 is created
- Modify the BOM for P:
  2 Units of C
- Create a MO for P, validate
  => a journal entry of 15 is created

The journal entry should be 20.

opw-1928342

closes odoo/odoo#30766
2019-02-01 13:22:32 +00:00
Raphael Collet 266f99f545 [FIX] tools: use of savepoints in TestCursor
closes odoo/odoo#30768
2019-02-01 14:09:38 +00:00
Odoo Translation Bot 8d9b196145 [I18N] Update translation terms from Transifex 2019-02-01 02:44:47 +01:00
Olivier Colson 5a8e35dc7a [FIX] account: properly manage multi currencies in invoices' outstanding payments
Before that, having a payment with amount_residual=0, but amount_residual_currency!=0 did not display it.

Also, 'outstanding credits/debits' label was displayed in case amount_residual was != 0 with an amount_currency=0 (and of course, a currency_id value was set on the aml). This could for example happen in case of partial reconciliation, were the amount_residual field is used to keep track of what will have to be written in the exchange rate difference entry when the reconciliation becomes full.

closes odoo/odoo#30362
2019-01-31 12:16:34 +00:00
Moens Alexandre 877fe07f74 [FIX] base: optimize the reading of many2one property fields
back port of commit 9820191d33f773ae21ca405da0e1226b6657ef5b
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)

closes odoo/odoo#29689
2019-01-29 13:12:49 +00:00
Moens Alexandre 917127ff70 [FIX] product: batch process _compute_product_pricelist
back port of commit 961a171341dabf428d5e86753b520481fd194558
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)
2019-01-29 13:12:21 +00:00
Moens Alexandre 26e5d0f219 [FIX]performance issue: _compute_sale_order_count
This commit simplifies the code and improves the performance
of _compute_sale_order_count.

execution time from O(n^2) to pretty close to O(n)

Project : Performance Issues
Task : Geostaff : Success Pack 5 (100h)  (opw-1912303)
2019-01-29 13:08:43 +00:00
qsm-odoo cc4d57ff14 [FIX] website_event: restore country events option
With https://github.com/odoo/odoo/commit/ac8b0fcfc5299b5ea62543b8382cb419fed4868e,
the 'country_events' class was renamed to 'oe_country_events'. This was
done correctly for JS animations and snippets but not for the 'Country
Events' option in the customize menu. This made the option useless.

This commit solves the problem by supporting the two classes (as it
is a stable fix).

closes odoo/odoo#30662
2019-01-29 15:50:07 +00:00
Christophe Simonis 788684a5dd [MERGE] forward port branch saas-14 up to aaa2035bcf 2019-01-28 19:45:46 +01:00
Christophe Simonis aaa2035bcf [MERGE] forward port branch 10.0 up to 4a5862a492 2019-01-28 19:45:04 +01:00