Commit Graph
124195 Commits
Author SHA1 Message Date
Hetashree Chauhan e79b7f17cc [IMP] l10n_vn: switch account.account.template creation in csv
data creation is faster when done through a CSV file than an XML file, hence doing it through a CSV

was task# 1909961

closes odoo/odoo#28876
2019-02-08 06:13:38 +00:00
Hetashree Chauhan c6126aba8f [IMP] l10n_syscohada: switch account.account.template creation in csv
- data creation is faster when done through a CSV file than an XML file, hence doing it through a CSV
- also, created account_tax_template_data.xml file and moved account.account.tag and account.tax.template data in that file from l10n_syscohada_chart_data.xml file

was task# 1909961

closes odoo/odoo#28875
2019-02-08 06:11:19 +00:00
Hetashree Chauhan cb47cd5a77 [IMP] l10n_fr: switch account.account.template creation in csv
data creation is faster when done through a CSV file than an XML file. Hence doing it through a CSV.

was task# 1909961

closes odoo/odoo#28874
2019-02-08 06:16:48 +00:00
Hetashree Chauhan 065503bebb [IMP] l10n_pe: switch account.account.template creation in csv
data creation is faster when done through a CSV file than an XML file. Hence doing it through a CSV

was task# 1909961

closes odoo/odoo#28873
2019-02-08 06:07:07 +00:00
Hetashree Chauhan d8058ccc6a [IMP] l10n_de_skr04: switch account.account.template creation in csv
data creation is faster when done through a CSV file compared to an XML file. Hence doing it through a CSV

was task# 1909961

closes odoo/odoo#28860
2019-02-08 06:02:37 +00:00
Hetashree Chauhan fa3a1bf100 [IMP] l10n_de_skr03: switch account.account.template creation in csv
data creation is faster when done through a CSV file compared to an XML file. Hence doing it through a CSV

was task# 1909961
2019-02-08 06:02:28 +00:00
Hetashree Chauhan aa76c389cb [IMP] l10n_es: switch account.account.template creation in csv
data creation is faster when done through a CSV file compared to an XML file. Hence doing it through a CSV

This commit is related to task_id : 1909961.

closes odoo/odoo#28871
2019-02-08 06:05:51 +00:00
qdp-odoo a02e277817 [IMP] account: keep numbering of reset-to-draft payments
Was github issue #25441

opw-1935427

closes odoo/odoo#30918
2019-02-07 13:33:41 +00:00
XavierDo 5c3aaacd2e [IMP] mail: correctly patch mail status manager timers
We want to avoid that a `setTimeout` started in one test has an impact on other
tests. This is especially true with the status update loop. Since mail_service
is used in multiple tests, the safest solution is to patch timeouts everytime
we make a call to getMailServices.
There is no need for an unpatch, the patch become the default behaviour until
the page is refresh at the end of tests.

It is possible to manually add the patch after calling `getMailServices`
```
this.services = mailTestUtils.getMailServices(this);
this.timeoutMock = mailTestUtils.patchMailTimeouts();
```
This can be usefull if we want to get the timeoutMock to simulate time changes.

Task: 1856205
2019-02-07 12:53:14 +00:00
XavierDo 2d45df1081 [IMP] mail, web: Add indication abouts it's own status in user_menu.
Task: 1856205
2019-02-07 12:53:10 +00:00
XavierDo 062f748efb [IMP] mail: add a Read More on out of office message
Task: 1856205
2019-02-07 12:53:07 +00:00
XavierDo 086405344e [IMP] mail, hr_holidays: use leaves to compute im_status
When on leave, the im_status can be either leave_online or leave_offline.
This will allow to display a specific icon and a default message when the user
is not at the office.
The leave can have an out of office message. This message will be displayed
in the chat window instead of the user ooo message, and the end date of the leave will be displayed too.

Technical details.
Right now the im_status access leaves directly to know if a user is on leave or not.
An index has been added to optimise this request (thanks to rco).
A solution to optimise this would be to compute part of the information in a cron.

Task: 1856205
2019-02-07 12:53:03 +00:00
Christophe Simonis 87924cb5ad [MERGE] forward port branch 12.0 up to a46138cb01 2019-02-07 13:14:02 +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
Lucas Perais (lpe) f9a80a6e84 [FIX] web: calendar: take locale to format dates
Backport of d9fed5381a78c19ce14ddc8b9233f60d53c65453

Before this commit, when opening the calendar view with a specific locale
in the "week" view
the days were translated but the date format was wrong and fell back to english
This was because the translated terms were passed explicitly, but the locale did not
get passed

After this commit, we do what it takes to pass the locale to fullcalendar
and the dates are formatted with the right pattern

Also, there may be a bug in fullcalendar, because just passing the locale in the options
won't work, it should be instanciated first in fullcalendar's "locales cache"

OPW 1922092
OPW 1934127

closes odoo/odoo#30909
2019-02-07 09:57:32 +00:00
William Henrotin 8cc62b1a6d [FIX] stock: warning in case of duplicate serial numbers
The onchange on serial number aims to track any duplicates. The issue
comes from the fact that `.mapped()` removes the duplicates when it
returns a recordset. We use a list comprehension instead.

Opw : 1910963

closes odoo/odoo#30913
2019-02-07 09:57:08 +00:00
Arnold Moyaux c47dc928f6 [FIX] stock: warehouse_selectable skip warehouse_ids
Usecase to reproduce:
- Create a route with a warehouse_ids
- Uncheck warehouse_selectable on route
- Create a picking that use the route
It should fail since the route is not applicable.

It happens because _search_rule only check for route with warehouse_ids
but it do not check for warehouse_selectable. We can't fix _search_rule
since stock_warehouse.py creates multi step delivery and reception
routes without warehouse_selectable thus it would break existing configuration.

Instead create an onchange on warehouse_selectable that remove
warehouse_ids on route.

partial backport of commit a35df8d371

closes odoo/odoo#30844
2019-02-07 09:05:19 +00:00
XavierDo c21d200285 [IMP] mail: add ooo status in chats windows.
In a chat window with a single usert (dm_chat) the ooo status of the
other user is displayed on the top when set.

Task: 1856205
2019-02-07 08:54:33 +00:00
XavierDo b60224c41c [IMP] mail, base: add out of office status to user.
This status can be edited by user in preferences, indicates if user
is available or not.
2019-02-07 08:54:33 +00:00
XavierDo 07a261db71 [IMP] bus, mail, mail_bot: add im_status service
This commit is a refactoring of im_status management.
This commit also add im_status in two places, near the author in a mail thread and on each suggestion when using mentions.

A service to manage im_status will have multiple benefits here:
-centralise information, avoid to call the server multiple time for the same im_status
-update all im_status at once and keep consistency in display.

With this commit, the im_status updates are now done by rpc call.
Updates where previously made with the bus but this has some drawback,
since the bus will only give the information 50 seconds after the beginning of
the request, in the worst case, we van wait 2*50 seconds to get an update.

More than that, the im_status where only updates for pinned dm_chat. Dm chat
are synchronized cross tabs, making the use of the bus possible for this purpose.
Since we will need to display im_status not linked to dm_chat, the list to update
will be different from tab to tab making the use of bus difficult for this purpose.

Technical notes:
-im_search has been moved from bus to mail addons since it concerns mail.channel
-Update of an im_status should be reflected everywhere in the page.
Since im_status is a rendered template used in multiple widget, we should add
the correct logic to all concerened widget. The current solution is simple:
use a jquery selector to find every place where im_status is rendered.
-we add a new im_status: im_partner. This will indicate that that
the partner has no user linked to him, making it possible to avoid to ask
for status updates for this partner.
-The update will only be done when the tab is focused. (and will be done
asap once the tab get focus back)
2019-02-07 08:54:33 +00:00
Jorge Pinna Puissant 37220d02a4 [FIX] payment_authorize: add new card verification
In the e-comerce, when the user try to add a new card in this payment
methods.

Before this commit, to validate the card, besides of the creation of the
payment token, an amount of $1.5 id charged and refunded.
During the refunded an error was raised. This error arrives because:
payments made via Authorize.net are settled and allowed to be refunded
only on the next day.

https://account.authorize.net/help/Miscellaneous/FAQ/Frequently_Asked_Questions.htm#Refund
<quote>The original transaction that you wish to refund must have a status of Settled Successfully.
You cannot issue refunds against unsettled, voided, declined or errored transactions.</quote>

This means, we can't refund directly after the payment.

Now, we only create the payment token. As Authorize.net verify the card
during the creation of the token, a new verification is not needed.

OPW-1927754

closes odoo/odoo#30905
2019-02-07 07:40:40 +00:00
Carel 2a881865e8 [CLA] signature for Carel van Dam
closes odoo/odoo#30876
2019-02-07 04:27:37 +00:00
Lucas Perais (lpe) a46138cb01 [FIX] mail: create partner from template in right company
Before this commit, when creating a partner automatically when creating
a message with a template, the company on the partner was wrongly set

After this commit, we try to retrieve the company from the model on the template

OPW 1934392

closes odoo/odoo#30893
2019-02-06 16:48:23 +00:00
Lucas Perais (lpe) 314088a5ec [FIX] point_of_sale: resuscitate onchange amount all
Make a return on a pos_order. A new pos_order is created.
On the latter, remove a pos_orde_line.

Before this commit, there was a traceback, due to a KeyError
It was introduced by 5f6a491265
which intended to optimize migration process

We keep the logic of that commit here, in a new helper method
while restoring the original onchange,
since it wasn't compliant with onchange specs

OPW 1934129

closes odoo/odoo#30897
2019-02-06 15:11:48 +00:00
qsm-odoo 1a299e8833 [FIX] auth_signup: properly disable sign up button on click
The feature introduced with https://github.com/odoo/odoo/commit/67d1173bf381befc136d840e232514c2c9ef7e1b
was broken by https://github.com/odoo/odoo/commit/b78b9c87c95acdf6fcf4f4eb3a80efa0e90eae09#diff-2d8ecbf95567bb339109e9552cbc68a3
because a class was removed by mistake.

This commit does not reintroduce the class so that no view is modified
in stable versions but rather review the JS to target the same button
another way.

Bug revealed while working on https://github.com/odoo/odoo/pull/29442

closes odoo/odoo#30896
2019-02-06 15:03:04 +00:00
Toufik Ben Jaa fe03f7b6b8 [FIX] crm: avoid crash when merging leads
- When merging leads that creates a partner, an error could be thrown
  due to the `res.partner` `default_get` method that reads values from the
  lead that creates the partner.
  The issue is due to the fact that the `crm.lead` record is merged (and
  unlinked), trying to read it will cause an error since the records
  doesn't exists anymore.

  This fix checks that the `crm.lead` we are trying to read from exists.

closes odoo/odoo#30895
2019-02-06 14:54:25 +00:00
Nans Lefebvre 98d0424848 [FIX] survey: support custom server date format in (frontend) surveys
The library moment.js does not support custom date formats anymore.
The following warning is given:
Deprecation warning: value provided is not in a recognized ISO format.
As a result, the moment contains 'Invalid Date',
which would remove possibility to complete a survey containing a date
in any format different than the default.

opw 1930152

closes odoo/odoo#30894
2019-02-06 14:39:04 +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
Aaron Bohy 495d475d1d [FIX] web: only call name_get when necessary
For many2one fields, 'default_get' only returns the id, whereas
'onchange' (like 'read') returns an array with id and display_name.

Before this rev., when creating a new record, we always called
'name_get' for all many2ones, whether or not their value was
obtained by 'default_get' or 'onchange', i.e. even if their
display_name was already known.

It may just look like unnecessary RPCs, but those RPCs could
actually cause a crash when the user has access to the main model
(and thus can access the display_name of the many2one thanks to
related sudo), but doesn't have access to the many2one comodel.

closes odoo/odoo#30892
2019-02-06 14:03:25 +00:00
RomainLibert 5fcf891e07 [IMP] various: optimize _name_search
In the overrides of _name_search we should avoid creating domains with
huge lists of ids as it is inefficient.
We can also make sure that we optimize the empty search as in this case
the custom domain doesn't make sense, we can simply search on an empty
domain and, thanks to the limit argument, still keep a fast query.

Linked to task 1918906

Thanks to @odony and @nseinlet

closes odoo/odoo#30155

closes odoo/odoo#30887
2019-02-06 13:26:33 +00:00
Nans Lefebvre c0ffeeb417 [FIX] website_sale: select cart recovery mail template in action
Fine-tuning of commit 50217184d2
The selection of the cart recovery mail template would fail if there was more
than one sale order selected.

opw 1921714

closes odoo/odoo#30885
2019-02-06 14:51:44 +00:00
Vincent Schippefilt 7d1957da8f [FIX] web: hang when saving then discarding
When editing a record, if it cannot be saved (b.e. due to required
fields) and the user clicks on save, then on discard

Before this fix, the window did nothing (seems like it is unresponsive)

After this fix, the user is able to discard the form.

task-id: 1937142

closes odoo/odoo#30871
2019-02-06 11:57:58 +00:00
Lucas Perais (lpe) 80460c40d9 [FIX] account, purchase, sale: notification with right lang
Have a partner in French while you operate in English
Click on 'send by email' on a invoice/sale order/purchase order

Before this commit:
- The body of the mail is translated in the partner's language
- but the notification header/footer surrounding the body was not

This is because:
- mail templates apply to a model
- in the case of the notification header/footer, this model is 'mail.message'
- mail.message doesn't have a lang field
- at the notification rendering time, we don't have easy (and generic) access
to the "real" model or to the lang (let alone to which lang to apply) that we need

After this commit, the notification is translated but:
the lang to get is hardcoded, and is the one on the partner of the inv/so/po
and is un-coupled from the dynamic lang on the proper inv/so/po template

This patch is hackish at several levels, I suggest that a generic solution is found in master
If no other solution is found until then, then the patch may be forward-ported

OPW 1935091

closes odoo/odoo#30873
2019-02-06 11:07:33 +00:00
qsm-odoo 930839c76b [FIX] website: remove data-editor-message attributes on save
When the edit mode is entered, some elements receive
data-editor-message attributes. These were not removed on save which
could in some cases make the attributes be saved in the database. For
this to happen it would require an `.oe_structure.oe_empty` element to
be put *inside* an editable element (instead of being the one which is
editable). In that case the `.oe_structure` content would be saved in an
inheriting view but the parent view would also be COW'd for no reason
because of that attribute.

Difficult to say if such a case exist in the current views but as it
technically possible and that some of our tests use that configuration,
it is worth fixing.
Note: this fix was in fact done in the new editor in master and allowed
to detect that one of our test was not testing a feature correctly
because of that. This will be adapted in a different commit of this PR.

closes odoo/odoo#30834
2019-02-06 09:49:11 +00:00
Romain Derie aef6a5aaed [FIX] website: specific view ID might also change on save
Commit https://github.com/odoo/odoo/commit/29075a8e2c734624cec4f6009185616634f70dea
was written while there was an incorrect behavior related to
multi-website, oe_structure_ID and edit mode in a rare specific case
(see the second commit from this PR for detailed explanation
https://github.com/odoo/odoo/pull/30834).

That rare case was detected in 12.0 since the tour did not work on
master with the new editor (that fixed the incorrect behavior).
Basically, it was COWing the edited view even if only an oe_structure_ID
was touched.

Indeed, when saving a specific view in the HTML editor, we should also
search for its possible new ID as it could change if we also edited its
generic parent. In that case, the view will be copied and then unlinked
to preserve inherit order on the new specific tree.
2019-02-06 09:49:11 +00:00
Christophe Simonis 530f364547 [MERGE] forward port branch saas-11.3 up to 0c42a607ec 2019-02-06 11:59:44 +01: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
Nans Lefebvre a21864c36c [FIX] purchase: fix mail templates
Activate multi-company, deactivate the common contact book.
Create a PO P with user U1 in company A. Switch to company B.
User U2 in company A tries to send P by email.
Rendering of the template fails, because it tries to access object.create_uid,
which breaks multi-company record rules.

The signature was not working because it used user_id, a non-existing field,
instead of create_uid.

opw 1930521

closes odoo/odoo#30868
2019-02-06 08:33:25 +00:00
Jorge Pinna Puissant 4f9fc188d3 [FIX] stock: Warning in picking on product with serial number
In stock.picking, in mode show detailed operation, add a product with
unique serial number tracking.

Before this commit, a warning about the qty is raised. This warning,
must be raised only if the qty is different from 1.
However this is not the case,
the warning is raised at each modification of the line.
This issue occurs since the rounding given to the float_compare is 0.0,
because self.move_id.product_id is not set.
Float_compare with a 0.0 rounding always return different, hence the bug.

Now, the warning is only raised when the qty is different from 1.

OPW-1932044
OPW-1931378

closes odoo/odoo#30651

closes odoo/odoo#30851
2019-02-06 07:31:12 +00:00
Christophe Simonis 0c42a607ec [FIX] base: correct TestCursor test to explicitly close the cursor 2019-02-05 18:38:19 +01:00
Christophe Simonis 9c6acbaaa0 [MERGE] forward port branch 11.0 up to e0b14bf9a7 2019-02-05 17:53:35 +01:00
Nicolas Seinlet aa9fb85102 [FIX] hr_holidays: cache direct access
Sometimes, cache returns an empty tuple, which makes
the .get hit and the [0] to miss, which leads to a
traceback.

closes odoo/odoo#30843
2019-02-05 15:08:33 +00:00
Simon Lejeune e0b14bf9a7 [REF] stock: allow returns in another warehouse
Previously, it was only possible to make a return in
- the location the move was coming
- a return location that is child of the parent_location, actually
  meaning a return location in the warehouse

This commit now allows making return in all return location, even one
located in another warehouses.

closes odoo/odoo#30836
2019-02-05 12:13:57 +00:00
Christophe Simonis 8263547468 [MERGE] forward port branch saas-15 up to 66efbf2b5b 2019-02-05 15:22:04 +01: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
Lucas Lefèvre 3e9ec9aac6 [IMP] hr_payroll: improve benefits error managment
Purpose
=======

When a lot of benefits are generated (for Odoo: ~1200 benefits/month), it can be
difficult to manage conflicts and errors.

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

Add a filter to display only benefits with errors.

In the list view:
- sort by error,status
- show Name| benefits Type | Beginning | Duration | Status | Error

closes odoo/odoo#30339
2019-02-05 09:30:32 +00:00