Commit Graph
126133 Commits
Author SHA1 Message Date
Martin Trigaux 1a4f3114a7 [FIX] web: translate pivot value
"Variation" was not translated

opw-1940086

closes odoo/odoo#31050
2019-02-13 07:17:47 +00:00
mreficent 85110ce347 [FIX] account_voucher: correct api.multi in action_move_line_create
closes odoo/odoo#30924
2019-02-07 14:44:25 +00:00
Nicolas Martinelli 11dc4ec487 [FIX] project: default context key
- Activate Sub-tasks in projects
- Create a sub-task

An `AccessError` is raised in `check_access_rule` of `mail.message`.

The context is 'polluted' with a `default_parent_id` key, which is not
necessary anymore at this point.

opw-1924899

closes odoo/odoo#31022
2019-02-12 11:21:21 +00:00
Lucas Perais (lpe) 7afdfc5046 [FIX] mail: retrieve mail (sent by OdooBot) failure notification in multicompany
Let the database be in multi-company without a shared contact book.
Have user U in company B, OdooBot in company A.
From a record R created by U, have a message sent by OdooBot fail to be sent.
A new failure notification failure should be displayed for U in company B.
Have U switch from and to company B.
The failure notifications are fetched, with their info.
Commit 10d558ef2b made sure that the user had access to the record
before trying to display the notification.
However in that case U has access to R, but trying to access the mail sender
violates the inter-company record rule, since OdooBot is in another company (A).

opw 1928100
opw 1935303
opw 1939352

closes odoo/odoo#30364
2019-02-12 13:04:30 +00:00
mreficent 8c3fa3dd3e [FIX] website_event_track: correct api.multi in _toggle_create_website_menus
closes odoo/odoo#31023
2019-02-12 11:58:29 +00:00
Nicolas Martinelli 014d61c875 [FIX] hr_expense: multi-currency
- Set your company to USD
- Create an expense in EUR:
  Amount: 100
  Tax: 15% Excluded
- Validate, post the journal entries

It crashes because of a missing `.id`, but on top of that... not a
single AML is correct.

opw-1938570

closes odoo/odoo#30959
2019-02-12 09:08:32 +00:00
Nans Lefebvre 6af5051e29 [FIX] account: fix model security for multi-company
In multi-company, create a new company C.
Set the chart of account in settings, save.
You get an access right violation on account.reconcile.model.template
because you need account_user.
Since this group is supposedly dependent on another module,
a user is supposedly never in this group without that module.
Obviously, this should supposedly not happen.

opw 1938539

closes odoo/odoo#31003
2019-02-12 09:56:16 +00:00
Lucas Perais (lpe) 12cca6a5fd [FIX] web: timerange menu: descriptions are strings
On a view, define a timerange for fetching data
Save as favorite

Before this commit, the time range description were not transmitted as
strings for the creation of the filter
So, when loading the filter back, there was no description for column headers
resulting in displaying "Object [Object]" as their title

After this commit, we save in the context of the filter the description of the title

OPW 1930582

closes odoo/odoo#30992
2019-02-11 12:22:47 +00:00
Jose Morales 2d2fe7f555 [FIX] account: reconcile over-amount bank statements in foreign currencies
When a bank statement reconciles its lines with payment using a foreign currency,
there is a mix up of values between the currency set in bank statement and payment against the company currency.

Current Behavior

Company Currency: MXN
Bank Statement Currency: USD
Payment Currency: USD
Current Rate 0.05130836

1) Generate a bank statement with 990 USD.
2) Generate a payment with 1000 USD.
3) Reconcile the bank statement against the payment.

The reconcile process generates a payment with the difference (10 USD)
Before this commit, this automatically created payment took an erroneous amount,
Taking a currency-converted amount where it should not have

It was happening because the reconcile process uses the debit or credit value(Local Currency)
against bank statement line amount (Foreign Currency).

After this commit, the amount set in the generated payment because of the difference is 10 USD.

closed odoo#30623

closes odoo/odoo#30779
2019-02-11 17:06:14 +00:00
edy1192 2503a89e9e [I18N] web: Add new terms to .pot file
-There were two missing terms from the `.pot` file of the module web.

closes odoo/odoo#31008
2019-02-11 22:28:48 +00:00
Laurent Smet f8379352df [FIX] account_facturx: Fix partner detection / price_unit
- price_unit is wrong because Facturx only provide the price_total and then,
we need to divide this amount by the quantity.

- the partner detection using its name was buggy due to the 'elements' variable
that was overrided.

-opw: 1938648

closes odoo/odoo#30998
2019-02-11 14:02:10 +00:00
Martin Trigaux 3915c2d236 [I18N] point_of_sale: export source terms
Following changes made at #29269
2019-02-11 11:25:15 +00:00
Mohammed Shekha 675c26587c [FIX] point_of_sale: do not load chat windows on the POS
When the mail_service is started, if there are any running chat sessions,
Chat_windows are created and opened on the point_of_sale frontend.
They also appear in the printed receipt.

To remove them from display we create a new pos_assets_backend template,
which inherits the web.assets_backend and removes the odoobot related assets.

opw 1878185
2019-02-11 11:25:15 +00:00
Dhaval Panchal ef59e59aeb [IMP] point_of_sale: raise error instead of traceback when no journal is set
If no journal is set for the POS, the session creation would crash.
We add raise an explicit error asking the user to configure either the payment
method or the chart of accounts.

opw 1878185
2019-02-11 11:25:15 +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
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
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
Géry Debongnie 1f5807f1c8 [FIX] web: allow user to move cursor in search bar
With the control panel refactoring, the auto_complete widget was set on
a different target, which caused issues with the search bar: the event
handlers for the search bar were triggered before the handlers for the
auto_complete widget.

With this commit, we make sure they are handled in the proper order.

Also, a small piece of code that was supposed to check the position of
the cursor was lost.

closes odoo/odoo#30795
2019-02-04 08:22:34 +00:00
Aurélien Warnon dcd79a543a [FIX] survey: fix empty date in survey could not be submitted
Purpose
=======

A date field not marked as "mandatory" could not be left blank in the survey.

That was caused by the form returning "Invalid date" instead of an
empty value when submitting.

closes odoo/odoo#30788
2019-02-04 07:53:47 +00:00
Rishabh Jadia 13e058c573 [FIX] web: prevent footer linebreak.
The purpose is, prevent the linebreak in the phone when using the
document layouts 'background' in the footer.

opw-1920752

closes odoo/odoo#30812
2019-02-05 10:37:01 +00:00
Robot Odoo b13a220295 [FIX] hr_holidays: fasten creation of leaves by company
When creating a leave, we usually check/create activities for the
concerned users, this is fine when creating one leave.
However it starts to become a problem when trying to create leaves in
batch using the by company or by department holiday_type as the number
of leaves created in batch can become quite big.

Now when we create leaves in batch, we do not check for the activities,
which will fasten a lot the creation.

Another problem is that when someone defined a leave on the very day you
want to create such a request, then it will crash, this can lead to
waste of time and resources.

Now we raise an error before trying to create the leaves in case of
conflict.

NB: Tested with +- 320 records, took 20 seconds instead of more than 10 minutes.

Task: 1934383

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#30625
2019-02-05 10:36:34 +01:00
RomainLibert 9c1b932489 [IMP] hr_holidays: improve performances
going from 3X seconds for 320 leaves to 20 seconds for 320 leaves
2019-02-05 10:06:55 +01:00
RomainLibert 8ab8881167 [FIX] hr_holidays: fasten creation of leaves by company
When creating a leave, we usually check/create activities for the
concerned users, this is fine when creating one leave.
However it starts to become a problem when trying to create leaves in
batch using the by company or by department holiday_type as the number
of leaves created in batch can become quite big.

Now when we create leaves in batch, we do not check for the activities,
which will fasten a lot the creation.

Another problem is that when someone defined a leave on the very day you
want to create such a request, then it will crash, this can lead to
waste of time and resources.

Now we raise an error before trying to create the leaves in case of
conflict.

Task: 1934383
2019-02-05 10:06:55 +01:00
Julien (juc) Castiaux 262e001086 [FIX] mail: delete messages on module uninstallation
When uninstalling a module, the messages linked to the records
of that module are not deleted leading to ghost messages when
reinstalling the module.

This is due to the lack of foreign keys in the definition of the
chatter making it impossible to cascade delete.

opw-1928208

closes odoo/odoo#30798
2019-02-04 14:16:47 +00:00
Nans Lefebvre 1746112794 [FIX] purchase: fix mail templates for multi-company use
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.

We add a sudo in the template so that it works as intended.

opw 1930521

closes odoo/odoo#30789
2019-02-04 09:09:49 +00:00
Martin Trigaux c189a7c37e [FIX] base: correct case in Swedish language
Was with a lowercase S while it should be uppercase

closes odoo/odoo#30814
2019-02-04 13:34:28 +00:00
Christophe Simonis 5244a6cf48 [MERGE] forward port branch 12.0 up to ff147a08761 2019-02-03 10:42:29 +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
Lucas Perais (lpe) 97ad37439d [FIX] website_crm_partner_assign: portal url
With a portal user, receive an email that says "Go to lead/opportunity"
and click on the link

The link's url is /mail/view which is the generic access controller

Before this commit, the user is redirected to the backend,
with fireworks of access errors

After this commit, the portal url is opened

As a side note, in master crm.lead should implement portal.mixin

OPW 193509

closes odoo/odoo#30762

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-02-01 11:18:30 +00:00
Nicolas Martinelli 05905abb0d [FIX] note: user on stage
Set the user as admin instead of root, othrewise the stage list looks
empty.

opw-1963212

closes odoo/odoo#32361

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 06:34:40 +00:00
Robot Odoo a8fd02209a [IMP] hw_*: IoT refactoring - With longpolling
Improve the implementation of IoT.
Allow both-direction communication between iot box and devices.

task: 1906910

closes odoo/odoo#30440

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-02 16:05:05 +02:00
Antoine Prieels 7c2ba9dc30 [IMP] point_of_sale: Do not share printers to the network
Add Cups configuration to not share printers to the network by default.
When multiple IoTBoxes were on the same network they would share printers
with each other, creating multiple duplicates of the same printer.
2019-04-02 15:53:02 +02:00
lejeune quentin ae35e16093 [IMP] IoT : Automatic registration of the IoT Box in HTTPS without certificate
When we are on HTTPS and we want to connect a box with the scan
we need to accept manually the certificate of the box.
With this commit we don't need to accept manually the certificate.
We don't have problem of mixed content if we use the onload method of Image object
So we load a image and put on parameter the token of the odoo DB to make a connection.
2019-04-02 15:53:02 +02:00
lejeune quentin 61c824764c [FIX] IoT : Variable name correction
This commit replace "data" by "iot_box" which is more representative
of the values it contains
2019-04-02 15:53:02 +02:00
lejeune quentin db9385b708 [FIX] IoT : Waiting for wifi connection
This loop try to get "screen_url" from "URL_SERVER"
So IoT Box need to be connected to the same network as "URL_SERVER". ( Inetrnet or locally )
If can not reach "URL_SERVER" he return a default screen_url
When IoT Box is wired connected there are no problem.
But with Wifi the wireless service take some time to by enabled.
With this fix the loop wait 1 second on every loop.
So if can not reach "URL_SERVER" in 30 seconds he return a default screen_url
2019-04-02 15:53:02 +02:00
lejeune quentin 1f845e9110 [IMP] IoT : IoT refactoring - With longpolling
Improve the implementation of IoT.
Allow both-direction communication between iot box and devices.

Now a device can send its value / status as soon as it changes. Not only when he receives a request.

Now the box have only 3 routes:

/hw_drivers/action
parameter: session_id, device_id, data
used to ask at a device to make a action (take picture, make print, ect...)

/hw_drivers/event
parameter: listener
listener is a dict where you have the session_id and a list of device_id to listen
this route wait to answer that we call device_changed for a device_id with data or value

/hw_drivers/box/connect
parameter: token
used to register the box to a Odoo database
token contain the url of Odoo database and a unique number that allow the IoT Box
to connect box in the hour

task : 1906910
2019-04-02 15:53:01 +02:00
Goffin Simon fced5d1e95 [FIX] web: Wrong comparison in invoice analyes
Steps to reproduce the bug:
Let's consider that we are in 2019

- Create two customer invoices: I1 and I2
- I1 with invoice date = 2 april 2019 and amount = 100€
- I2 with invoice date = 2 april 2018 and amount = 1000€
- Go to Reporting > Invoices
- Click on widget "Time Ranges" and set "Based on" Invoice Date and "Range" This Year "Compare To" Previous Year

Bug:

The untaxed total for previous year was 1100€ instead of 1000€ because it counted previous year and this year.

opw:1962027

closes odoo/odoo#32331

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-02 09:27:49 +00:00