Commit Graph
126133 Commits
Author SHA1 Message Date
Christophe Monniez 07b855fccf [FIX] tests: remove chrome sandboxing
It appears that chrome headless with sandboxing is failing when running
containerized because it tries to use Linux namespaces.

With this commit, the no-sanbox optional arg is used to avoid this
issue.

Closes #26456
Closes #28053
2018-10-26 11:26:18 +02:00
Yannick Vaucher e968d1de7e [FIX] web: typo in docstring
The parameter would not be correctly detected by doc extractors

closes odoo/odoo#28169
2018-10-26 07:56:50 +00:00
David Arnold 1bf58d282f [IMP] db: set default user tz through country code
Given a country code is specified and the country only has one timezone, it is
safe to assume that the admin user is operating from that timezone.

Set the default timezone to simplify the onboarding in such particular case.

If a country has more than one timezone, we can not make safe assumptions and
don't provide a default tz.

closes odoo/odoo#26365
2018-10-26 07:21:47 +00:00
Robot Odoo 653b4289c6 [MERGE][FIX] purchase: include refunds in invoice count
If a supplier had a refund, it was not included in the supplier invoice count
nor in the results in the statbutton

On the customer side, fields like total_invoiced works on both the out_invoice
and out_refund

closes odoo/odoo#28161
2018-10-26 09:21:05 +02:00
Olivier Colson e6228402e7 [FIX] purchase: fix anglosaxon valuation
Before that, when receiving, then invoicing with price diff, the value in interim account corresponded to the price on the invoice instead of the original valuation one.

Scenario to reproduce the issue:

* create PO with 1 product, FIFO valuation, price=10
* receive PO: the entry in stock interim account has debit=credit=10
* create invoice, with price=15 instead of 10
* the invoice entry should be: payable: C=15 ; price diff: D=5 ; interim account: D=10
  ==> Instead, we had payable: C=20 ; price diff: D=5 ; interim account: D=15 => this was wrong

Also added a test case for the same scenario, verifying the amounts written in the different accounts (and refactored a bit ValuationReconciliationTestCase for easiness)

Closes #27394
2018-10-25 18:03:27 +02:00
Christophe Simonis 78d5941d50 [MERGE] forward port branch 11.0 up to aace8470b8e 2018-10-25 17:44:56 +02:00
Christophe Monniez f9ee8cff14 [FIX] tests: avoid remaining requests
From times to times, warning are seen on the runbot during HttpCase
tests with the chrome headless browser.

Those warning are about Odoo trying to join remaining requests threads.
In the dumpstack, the thread seems blocked in the werkzeug
handle_one_request method, when trying to read the HTTP request line.

One explanation could be that Chrome opens a pre-connect socket for
a future use. When the HttpTest cleans the browser, the page stops
loading but (probably) keeps the socket open for a while.

That could explain the problem.

With this commit, a timeout is set on the request handler,
in the hope that it closes the pre-connect socket too.
2018-10-25 17:16:34 +02:00
Cas Vissers 43edf08b26 [FIX] purchase: include refunds in invoice count
If a supplier had a refund, it was not included in the supplier invoice count
nor in the results in the statbutton

On the customer side, fields like total_invoiced works on both the out_invoice
and out_refund
2018-10-25 14:41:14 +00:00
Cas Vissers 3f6deb24ee [CLA] Brahoo signs Odoo CCLA 2018-10-25 14:39:21 +00:00
Josse Colpaert 9647620a91 [FIX] mrp: workorders of sub-BOMs
- Create the following BOM structure:
```
  Prod 1 (Manufacture)
  |
  --- Prod 2
      Prod 3 (Kit)
      |
      --- Prod 4
	  Prod 5
```
- The BOMs for Prod 1 & 3 must have a routing set, to generate
  workorders
- Create a MO for 1 unit of Prod 1, process to the end

2 units of Prod 1 are created instead of 1.

This is due to the WO for Prod 3 not having a `next_work_order_id`.
Therefore, `record_production` adds an extra quantity at:
```
production_move.quantity_done += self.qty_producing
```

To prevent this, we set as `next_work_order_id` of the BOM of Prod 3 the
WO of Prod 1.

Closes #19527
opw-1817398
opw-1883693
2018-10-25 14:58:43 +02:00
Nicolas Martinelli 7718811809 [FIX] mrp: unbuild of tracked products
- Create 2 Products A and B, tracked by serial number
- Create a BOM for A:
  1 Unit of B
- Create a MO for 2 Units of A
- Validate:
  Product with S/N A1 consumes B1
  Product with S/N A2 consumes B2
- Unbuild A2

If A1 was created before A2, B1 will used as a component of A2 at
unbuild.

When going through the stock move lines, we don't verify that the lot
produced matches the lot we unbuild.

opw-1889002

closes odoo/odoo#28154
2018-10-25 12:25:45 +00:00
Christophe Simonis cc8e8237bf [MERGE] forward port branch 11.0 up to 84500c27b1 2018-10-25 13:59:45 +02:00
Gert Pellin 299c6dd3b4 [FIX] point_of_sale: alignment note textarea
before fix:
in firefox the textarea of note modal has a overflow
textarea can be expanded outside borders modal in all browsers

closes #25199
closes #25215

issue 1895298
2018-10-25 13:22:02 +02:00
Martin Trigaux bfbaa09268 [FIX] hr_attendance: allow multiple attendances
If the search returns more than one result, the rendering of the message would
crash (SingletonError when accessing check_in field value).

Use the same order and limit as both search before and after

Courtesy of David Tran

Closes odoo/odoo#28055
2018-10-25 11:49:15 +02:00
Gert Pellin 8e63bcb47c [FIX] point_of_sale: IoT https in pos
before this fix it was not possible to connect to the pos/iot-box using
https on the pos. By checking if the pos is http or https this is now
possible after accepting the certificate.
if https scanning for proxy is disabled, the user should always give a
    ip in the configuration
2018-10-25 11:33:32 +02:00
jem-odoo 3baf8c41e9 [FIX] website_sale: change invoice_policy of a demo data
Otherwise, the product is a service based on delivered
quantity which is not a covered case by the service_policy
field on product form view (the selection will be empty).

Asked in Task-1859308

closes odoo/odoo#28162
2018-10-25 09:28:51 +00:00
xmo-odoo 84500c27b1 [P3] payment_stripe: Exception.message removed
Apparently missed in 07ab8b6cd2

In Python 3, there is no Exception.message attribute anymore, this would
lead to cascading exceptions in the stripe_s2s_create handler.

closes odoo/odoo#28141
2018-10-25 09:13:17 +00:00
xmo-odoo 71cb425d00 [FIX] doc: translator under Sphinx 1.5
In Sphinx 1.5 (fairly specifically), the warner thing takes a `type` kw,
and building the doc blows up if that parameter is not provided.
2018-10-25 11:08:35 +02:00
Nicolas Martinelli a4059804cc [FIX] stock: run scheduler on partially available moves
1. Product A - on stock 5 pcs.
2. SO - 7 pcs. of A
3. Generated picking has reserved 5 pcs.
4. Increase stock to 7 pcs. (Update qty on Hand)
5. Run procurement scheduler
6. Picking still has reserved 5 pcs.

The scheduler should take into account the moves partially available.

Fixes #27874

opw-1895622

closes odoo/odoo#28136
2018-10-25 08:35:42 +00:00
Géry Debongnie 5ab5ccba40 [REF] web: remove useless code
The utility function xml_to_json, which is mainly used by the views to
parse their arch (from string to xml tree) had a peculiar behaviour: it
tried to process some attributes as json.  If by chance, these
attributes are valid json, then they are replaced by their parsed value.

It is difficult to say why it could be useful.  Maybe this was done to
prevent using pyeval many times later on.  But if that is the case, it
should be done by the view code and not the utility function (the view
can precompute all attributes once).

Also, this behaviour is annoying for code later in the chain, which
needs to check if what it gets is an object or a string.  With this
change, attributes are always returned as string (at this point).

closes odoo/odoo#28133
2018-10-25 07:56:30 +00:00
Luis Guzman d6a074b832 [CLA] signature for Ark74
Closes #28126
2018-10-25 08:46:48 +02:00
mreficent 2924b77b6f [REF] website: rename website.redirect,type to redirect_type
Part of odoo/odoo#27599 to rename fields named 'type' which may conflict

closes odoo/odoo#28112
2018-10-24 14:32:49 +00:00
Anil Kesariya 5f44f9a843 [CLA] signature for AnilKesariya
Closes odoo/odoo#27024
2018-10-24 16:26:58 +02:00
Marius Žilėnas 3f89774ed0 [FIX] cli: fix broken link
The master file no longer exists

Closes odoo/odoo#26623
2018-10-24 16:15:02 +02:00
Christophe Simonis da08a9e986 [FIX] base: don't ignore new uninstallable modules
When updating the module list (`ir.module.module.update_list()`), new
modules that are not installable were ignored.
This behavior was not consistent with the database initialization [1]
which creates all modules.

[1] https://github.com/odoo/odoo/blob/5d932e5db164fe80fd7c011ddd53f3494ef89ef5/odoo/modules/db.py#L51-L54
2018-10-24 15:36:55 +02:00
Christophe Simonis bff43f0aa1 [MERGE] forward port branch saas-14 up to 29e36457b2 2018-10-24 14:19:44 +02:00
Christophe Simonis 29e36457b2 [FIX] account: don't enforce test journal currency
It was causing some tests failure due to 22f0da809e
2018-10-24 11:57:42 +02:00
Julien (juc) Castiaux 5d932e5db1 [FIX] delivery: wrong currency conversion
In a multi-currency company, the delivery price of a quotation was
wrongly converted when the currency used by the pricelist was not
the same as the currency used by the company.

This PR correct that behavior by correcly compute the delivery
price according to the pricelist currency.

To reproduce:
1) Install the accounting, sales and delivery modules
2) Set the company as a multi-currency company in the accounting
   settings
3) Change the currency rate so the one used by the company is 1
   and the other one (the one that will be used on the pricelist)
   is anything else than 1
4) Create a pricelist with that other currency
5) Create a quotation using the new pricelist, select a deliver
6) Click "Set Price", the delivery price shown on the form isn't
   the same as the price on the quotation.

opw-1894422
2018-10-24 11:55:32 +02:00
Arnold Moyaux 0ff1e5fab5 [FIX] mrp_bom_cost: bom cost / bom quantity
Use case to reproduce:
- create a BoM of 50 finished products:
- Add a routing with an operation time of 1h
- Set a 1$/h cost on workcenter
- Set unit price from BoM

It will be 1$ for one product. It should be 0.02$
since it will take 1h for 50 products, so the price
should be 1/50

It happens because the system add the operation time by unit instead
of adding it only once.

related to commit 17b6256955

opw-1890005
2018-10-24 11:10:29 +02:00
Yenthe V.G b6c3ad1b8d [IMP] sale_management: allow easy xpath on tab
closes odoo/odoo#27771
2018-10-24 08:21:29 +00:00
David BeguinandFMDL 0b1a3da01f [IMP] base : adds direct access to groups, record rules and access rights from user form
Adds 3 smart buttons with count to see :
- Groups
- Access Controls
- Record Rules
Buttons available in debug mode only
Every user that have access to user form has at least admin / Settings or Admin / Access rights.
Admin / Settings includes Admin / Access Rights

Create and delete are not allowed for those views.
Indeed users may think they are modifying current user's access
whereas they are modifying the whole group access.
To avoid confusion, the user's access rights list is now not editable.
Clicking on a row redirects to form view that can be edited.
A warning has been added on access rights form to be sure the user
is aware of what he is doing.

Task ID : 1830142
Closes PR #25587

Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: FMDL <florent.mirieu@gmail.com>
2018-10-24 07:31:06 +00:00
Pedro M. Baeza c0e35f84e2 [FIX] migration: use correct migration prefix in docstring
Migration files must contain `-` in its name for being executed
2018-10-23 18:43:59 +02:00
Christophe Simonis 416ed10b7b [MERGE] forward port branch saas-14 up to ce2eb8464b 2018-10-23 18:04:26 +02:00
Christophe Simonis ce2eb8464b [MERGE] forward port branch 10.0 up to d5cc05c994 2018-10-23 18:02:45 +02:00
Christophe Simonis 3a61254d0e [MERGE] forward port branch 12.0 up to 97a0de12f96 2018-10-23 17:52:50 +02:00
Martin Trigaux d5cc05c994 [FIX] doc: correct reference to the line in the file
Introduced at 94e82753ac
2018-10-23 16:17:58 +02:00
Martin Trigaux a0050c323c [FIX] doc: backport of ac37ca39ea to 10.0
To be compatible with sphinx >= 1.8
2018-10-23 16:17:58 +02:00
Martin Trigaux 27cc2ae3a9 [FIX] doc: backport of 9a07a4599c to 10.0
To be compatible with sphinx >= 1.6
2018-10-23 16:17:58 +02:00
Romain Derie ef48b81ab1 [FIX] website_sale: prevent other sessions to crash after checkout
Before this commit:
If an user has multiple session on a database (eg: he is connected both on his
smartphone and his laptop on the ecommerce), and there is a cart in these
session, confirming the cart on one of the session will make other sessions
unable to use the checkout anymore.

This is because other sessions will still contains the Sale Order that is now
'sent' and updating the cart will raise an error:
`It is forbidden to modify a sales order which is not in draft status.`

Now:
If the SO to be updated is not in `draft` anymore, we create a new one.

Step to reproduce:
  - Login on ecommerce from device A
  - Add product in cart, the SO will be added on session
  - Login on ecommerce from device B
  - Pay the cart (it will retrieve the SO from device A)
  - At that point, the cart is paid and the SO is removed from session on
    device B but other devices won't be able to use the checkout anymore
    as they still have the SO in session which is in `sent` state.
    Thus, any action on cart will raise the error

Note:
1. We can't implement that behavior in `sale_get_order()` as it is supposed to
   return SO in `sent` state after checkout.
2. We can't implement that behavior in `_cart_update()` as it is inherited in
   some module. Thus, implementing that behavior in `cart_update()` would change
   `self = order` but inherited methods would still have initial `self`.
3. Implementing the behavior in the controller it is already done (differently)
   in `cart_update_json()`.

Fixes #27508, closes #27794
2018-10-23 15:58:48 +02:00
Martin Trigaux 1ee180ee0d [FIX] doc: do not duplicate header
And use tabs instead of spaces
Otherwise it looks for the file named "__manifest__.py 2014-..."
2018-10-23 15:47:12 +02:00
Christophe Simonis 570e381fcc [MERGE] forward port branch saas-11.4 up to 5999fd47c43 2018-10-23 15:18:46 +02:00
Christophe Simonis eb902f8b39 [MERGE] forward port branch saas-11.4 up to 5999fd47c43 2018-10-23 15:18:46 +02:00
Christophe Simonis 072fe9bdba [FIX] web: rpc queries should always be shorted out when the widget is destroyed 2018-10-23 14:03:09 +02:00
Julien (juc) Castiaux 3008f7d254 [FIX] point_of_sale: Button spamming create duplicates
Spamming the save button when creating a new custommer in point-
of-sale create duplicate users. This PR disable the button once
clicked and re-enable it when all the processing is done.

opw-1895302

close #23919
2018-10-23 12:56:44 +02:00
qsm-odoo 4f9a0cb4fc [FIX] website: add some compatibility for old BS3
This commit adds a compatibility file which can be added on demand by
enabling its associated view. This will basically map old BS3 classes
and structures to the related style with BS4.

closes odoo/odoo#27981
2018-10-23 08:53:19 +00:00
qsm-odoo 517d184107 [FIX] website: no text-primary in accordion snippet
For some unknown reasons, the text-primary class was added on each
card-header of that snippet... while the default link color is already
primary by default.

This was however breaking some themes whose primary color would not fit
in card-header while the link color (different from the primary one)
would.

closes odoo/odoo#28627
2018-11-13 13:06:42 +00:00
qsm-odoo f16bd3edca [FIX] website: restore theme contact us page
The page appeared broken in some themes as the "contact us" button was
against the bottom of the #wrap element.

closes odoo/odoo#28623
2018-11-13 12:29:12 +00:00
Goffin Simon b879dca025 [FIX] sale: Payment terms from SO
Let's consider a customer C with payment terms P1 set on it

Steps to reproduce the bug:

- Create a SO for C with payment terms P2
- Confirm the SO and generate the invoice

Bug:

The payment terms on the invoice was P1 instead of P2
This fix allows to keep the same behavior as in 11.0
Introduced by: f1b2d165fb

opw:1905710

closes odoo/odoo#28585
2018-11-13 10:36:58 +00:00
RomainLibert 58e4db6433 [FIX] hr_holidays: use department members as employees
In https://github.com/odoo/odoo/commit/04250cff1be32c115804dd2a55eb0242df6abf52 a typo was introduced, this commit
aims at fixing it.

closes odoo/odoo#28609
2018-11-13 10:06:09 +00:00
Nicolas Martinelli 22b979533a [FIX] product: dynamic variant creation
The new product configurator introduces the possibility to create
variants dynamically. One of the main goal is to be able to create
product templates with **many** attributes and values, but not generate
all variants automatically. Only the necessary variants are created
on-the-fly.

However, it turns out that **many** dynamic attributes and values still
fails. For example, create a product with 10 attributes, 10 values for
each. This allows 10^10 theoretical combinations; although the variants
are not created, the creation of the product template fails.

The reason is that the `variant_matrix` contains the list of all
combinations, which causes a `MemoryError`.

An easy modification to improve the process is to keep an iterator
instead of generating the list. This avoids the `MemoryError`, but it
remains necessary to go through all combinations three times, which
would take too much time.

Therefore, some refactoring is necessary in order to keep the same
logic, but avoid going through any huge list. Here are the improvements:

1. Skip the creation part if nothing will be created.
   If any attribute is dynamic, no variant is created. Therefore, we can
   perform the check upfront and skip the variant creation part if
   possible.

2. Stop the creation loop as soon as possible.
   There is an hardcoded limit of maximum 1000 variants to create. We
   can perform this check along with the list creation instead of
   checking at the end.

3. Determine if a product has valid attributes in a different way.
   The existing logic is safe but expensive: we check that all attribute
   values of a product are part of the possible combinations. This can
   be simplified by checking if (1) all attribute values of a variant
   are part of the accepted attribute values of the template and (2) a
   variant uses all attributes of the template. The second check is
   mandatory to delete existing variants when an attribute is added to
   the template.

Thanks to these modifications, we at worst go through 1000 possible
attribute values combinations. It might still be possible to optimize
step 3 with a fancy SQL query which would retrieve all (in)valid
products at once. Hopefully this won't be necessary and the optimized
logic will be enough.

opw-1902392

closes odoo/odoo#28530
2018-11-13 08:10:18 +00:00