Commit Graph
111362 Commits
Author SHA1 Message Date
amoyaux 9054d082be [IMP] stock: picking and ml views improvements.
commit 0a960c08757a8ba5e1dc1dd36c17a35de8913975 introduced change about
reserved quantity that set it to 0 once the move is done.

This commit add views improvement. If the move lines are done
reserved quantity does not really matter and thus it is better
to not display it.

Modify the decorator on stock picking that change the font to red
if the quantity processed is greater than the reserved quantity.
This decorator does not trigger if the picking is in state done since
reserved quantity is always 0.
2017-08-17 17:16:34 +02:00
amoyaux 2a160329bb [FIX] stock : no more automatic backorder
When validating a stock picking there were 2 different cases:
(1) If all qty are equal to 0 it will display a wizard asking
if the user want to set the quantity done to the reserved quantity
for all moves. If the user accept it will automatically perform the
moves after setting the quantity done.
(2) If the user set a quantity on a move, it will check if there is
a need for a back order. If yes it will display a wizard asking if
a back order is needed or not.

However the check if a back order was needed or not was never perform
in case 1. If the quantity reserved was lower than the initial demand
a back order was automatically created.

This commit add the step 2 in the procedure of step 1 (after setting the
quantity done).
2017-08-17 17:16:21 +02:00
amoyaux 3c135d3123 [IMP] stock : reserved quantity should be 0 for done move
The quantity reserved for move was never modified once the move
is done. It is a nonsense to have a reserved quantity for a done
move.

This commit add a constraint that ensure the quantity of
move line to be 0 if it is in state done. Also it add a write
on move_line's 'action_done' function that set the reserved quantity
to 0 for all move line processed.

It does not introduce any change on the stock move itself since the
reserved quantity is the sum of all its move lines's reserved quantity.
2017-08-17 17:16:00 +02:00
amoyaux fafb0ed8c5 [IMP] mrp : Improve error message on cancel MO with consumed qty
Adding the step to do when the user want to delete the MO.
2017-08-17 16:18:18 +02:00
amoyaux 105ece056d [IMP] stock : improve immediate transfer message.
Improve the message for the end user.
2017-08-17 16:18:05 +02:00
dbh-odoo a032c6c056 [FIX] website_sale: fix issue when displaying transaction error at checkout 2017-08-17 13:52:31 +02:00
tbe-odoo 2df9c22d80 [IMP] Payments & subscriptions: Improved Payments
- When registering a payment token, validating it using a payment of a small amount (~1.50€) followed by a refund allows ensuring
    that the payment method is valid (i.e. checksumming the card number simple ensure the number is valid but not that the card exists).
    This commit introduces a generic approach that must be implemented for each acquirer that has tokenization support.
    This commit also introduces a generic payment token registration/usage template that can be adapted according to one's need.
- Introducing a new payment form that handles payment, deletion and adding payment method (only for server2server for the moment).
- On /my/payment_method, changed strings 'Payment Acquirers' to 'Payment Methods' which is more clear.
- Stripe can now be used to pay subscriptions.
2017-08-14 08:30:59 +02:00
amoyaux c089d39a66 [FIX] stock : traceback filter 'Available Products'
It happens because the function still use the old fields
utilized before refactoring introduced by commit b3180c8411

This commit adapt the function by using quantity instead of qty.
2017-08-11 09:43:07 +02:00
Christophe Simonis 48b2ce60ed [MERGE] forward port branch saas-16 up to 85571bb78c 2017-08-10 17:01:05 +02:00
Christophe Simonis 85571bb78c [MERGE] forward port branch saas-15 up to dde62073ba 2017-08-10 16:22:36 +02:00
Christophe Simonis dde62073ba [MERGE] forward port branch saas-14 up to a2361e23ea 2017-08-10 16:17:28 +02:00
Christophe Simonis a2361e23ea [MERGE] forward port branch 10.0 up to 544aa9b04a 2017-08-10 15:45:07 +02:00
Christophe Simonis 544aa9b04a [MERGE] forward port branch saas-11 up to cfbac106b4 2017-08-10 15:00:33 +02:00
Christophe Simonis cfbac106b4 [MERGE] forward port branch 9.0 up to 1aed433f54 2017-08-10 14:58:24 +02:00
xmo-odoo d140f0ef0e [FIX] prefetch issues on computed/related fields (#18644)
When deciding to prefetch records (getting records from the cache with
no value for the field being fetched), if the field was computed
`determine_value` would just get all records, not limited by the normal
prefetch limit; for large recordsets this would generate gigantic
prefetch lists for records we may not need at all.

Fix by applying the `PREFETCH_MAX` limit to records from the cache as is
done in `_prefetch_field`.

Complementarily, when traversing related fields the prefetch
environment would be lost and every record would get an empty prefetch
environment, so the values would ultimately be read one by one.

Example: select (search) 1000 product.product records, access a
related field (e.g. categ_id) in a loop, on the first iteration the
system would first read 1000 templates, then it would read each
categ_id individually, resulting in >1000 SQL queries rather than the
~2 we would expect.

Fixes #18511
2017-08-10 14:51:27 +02:00
Aaron Bohy deba788b4c [FIX] web_editor: html_frame: saving in readonly
A form view record may be saved even if the record is displayed in
readonly (e.g. when a button in the form view is clicked). When
this happened, if there were an html field with html_frame widget
in the form, it crashed (e.g. in Email Marketing > Mass Mailings >
open one > click on Test Mailing).
2017-08-10 13:56:22 +02:00
Aaron Bohy 87133a8235 [FIX] web: BasicModel: correctly reload new records
Commit 7cd2f6370 (in 10.0) recently added attribute special='cancel'
on the 'Cancel' buttons of the Settings views in Odoo. The attribute
wasn't really supported in this case by the old web framework, so
this commit also slightly adapted it, and made it reload the whole
webclient when such a button is clicked.

This commit now needs to be forwardported in saas-16, so we have to
handle the case in the new views as well. Before this rev., it
crashed, because the BasicModel tried to reload a new record (the
one of the Settings form view), so basically it performed a 'read'
RPC on a virtual ID like 'virtual_123', and the server didn't really
appreciate.

This rev. handles the case where a new record is reloaded, and
simply performs a 'default_get' instead of a read. Bonus point:
with the new views, we don't have to reload the whole webclient.
2017-08-10 13:56:22 +02:00
Nicolas Lempereur 354539942d [FIX] website_sale: no-cache IE11 cached cart XHR
IE11 seems to be always using cache when doin an XHR request with the
same GET request.

It can be changed in several ways:

- returning a header: "Cache-Control: no-cache"
- altering the GET request with a nonce
- using the POST method instead of GET

to solve it, in this change the HTTP header is added on the response.

opw-752270
closes #18787
2017-08-10 13:41:37 +02:00
Jérome Maes 9b4c8a4e31 [IMP] hr_timesheet: default employee
'default_get' should return a value for employee
 when asked, even if it is not a timesheet.
2017-08-10 11:29:36 +02:00
Pierre Masereel 298eaca4d1 [FIX] point_of_sale: traceback when printing invoice from POS
When we try to print an invoice from POS, this is cause by changing
method signature and that we cannot choos the report template anymore.

Refactoring in rev: https://github.com/odoo/odoo/commit/e80238042c9d93d492ea8b06b0041aced0d81dcd
2017-08-10 10:42:19 +02:00
Pierre Masereel b15918416a [FIX] mrp: traceback on bom structure and cost reports
Since the refactoring of report in rev: https://github.com/odoo/odoo/commit/e80238042c9d93d492ea8b06b0041aced0d81dcd
2017-08-10 10:42:19 +02:00
Adrien Dieudonne 3a886327a6 [FIX] pad: don't consider record as dirty
Before this rev., when the user opened a form view
containing a pad widget, with a pad url already configured,
a dialog directly popped asking "The record has been
modified, your changes will be discarded. Are you sure you
want to ?".

This is because of an unconventional behavior of this
widget: the field actually encodes an url, the one of the pad
to display. When the user saves, a write is forced so that
the server can retrieve the pad's content and store it in DB.
To force the write, the widget always notifies a fake change
on the url. However, we don't want this change to trigger
the confirm dialog. With this rev., this fake change doesn't
make the record 'dirty'.
2017-08-10 10:33:05 +02:00
qdp-odoo 35b3617667 [FIX] account: payment onchange in multi currencies
Computation of the field 'Difference amount' was wrong as it was converting amounts in base currency in the following use case:
- company currency USD
- invoice currency EUR
- payment's journal currency USD but payment's currency EUR
- invoice of 100€, payment of 20€: difference was not 80€ because it was converting to USD
2017-08-10 10:31:51 +02:00
qdp-odoo 5641372532 [FIX] account: show payments in multi currencies with the rate of the invoice date instead of the payment date (so that we can see a meaningful residual)
Without this patch, the residual of the invoice doesn't correspond to the real residual of the invoice's receivable/payable line(s)
2017-08-10 10:29:38 +02:00
Goffin Simon 1aed433f54 [FIX] website_event: Website Event Error when you encode a 0 value in the registration
The function registration_new must return a type json.

opw:765643
2017-08-10 09:27:05 +02:00
Nicolas Martinelli ac392096d8 [FIX] stock: recompute display name
The display name of a location should be recomputed when the name of the
parent location is changed.

opw-761463
2017-08-10 09:00:59 +02:00
Aaron Bohy 1e8f6d01ff [FIX] web,*: send correct context on button clicked
*account_asset

When a button of type 'action' is clicked (execute a given action),
special keys must be set in the context (active_id, active_ids and
active_model). They must be computed regarding the record containing
the clicked button, i.e. if we are in a modal, it must be the id
and model of the record displayed in the modal.

Before this rev., we always sent the id and model of the record
displayed in the background (i.e. the id and model of the url).

This caused a bug in MRP that could be reproduced as follows:
- open a manufacturing order in form view
- click on edit
- click on one of the line of the one2many, and click on the green
  icon to edit a product
- click on the update product quantity button on top of it
- the product field must be correctly filled, which was not the
  case before this rev.
2017-08-10 08:48:32 +02:00
David Monjoie 50957038b9 [FIX] web: fix magic grouping on date fields
Date fields have magic grouping methods to specify how to group on
them like date:month, date:weeks, date:days for example. It needs
to be handled properly since date:month is not a valid field name
but date is.

Steps to reproduce the issue:
- Go to Sales/Dashboard
- Click on My Pipeline
- Group by "Creation Month"

Basically, this can be triggred from any view which has a search
view which defines a group using the magic date grouping methods.
2017-08-10 08:48:30 +02:00
Olivier Dony 08b75b7bcb [FIX] pad: do not crash during record creation
Backport of 0de067cae9
(and 9b8bc5e5a1)

Rev. c5bd509274 attempted to improve the
pad sync mechanism when merging records (tasks), but failed to consider
the case where the pad_url field is not set yet.
This happens at create(), due to the chicken-and-egg problem with the
pad URL depending on the record ID, and therefore set *after* creation.

Ignoring the sync when the URL is not yet set should be enough, as the
URL generation method also takes care of that first sync.
2017-08-09 18:51:16 +02:00
Christophe Simonis 3e54d9b56d [FIX] event_sale: SyntaxError
oversight of previous forward-port
2017-08-09 17:29:27 +02:00
Simon Lejeune dda4491461 [REF] stock: action_assign performance
Also remo `_check_entire_pack` logic, as all moves run it
on their picking it's useless to use it on picking himself.
2017-08-09 17:18:35 +02:00
Christophe Simonis c3d710d2f6 [MERGE] forward port branch saas-14 up to 80ac087d6e 2017-08-09 17:11:10 +02:00
Olivier Dony 0de067cae9 [FIX] pad: do not crash during record creation
Rev. c5bd509274 attempted to improve the
pad sync mechanism when merging records (tasks), but failed to consider
the case where the pad_url field is not set yet.
This happens at create(), due to the chicken-and-egg problem with the
pad URL depending on the record ID, and therefore set *after* creation.

Ignoring the sync when the URL is not yet set should be enough, as the
URL generation method also takes care of that first sync.
2017-08-09 16:38:56 +02:00
Christophe Simonis 80ac087d6e [MERGE] forward port branch 10.0 up to f69655829a 2017-08-09 15:53:37 +02:00
Christophe Simonis f69655829a [MERGE] forward port branch saas-11 up to acbcfa3703 2017-08-09 14:43:39 +02:00
amoyaux 4b72966ea8 [FIX] stock : Stock user should be able to create a picking.
A stock user is not allowed to save a picking. It happens
because the picking view use the field show_operations that is
a related to stock.picking.type.show_operations. Since stock user
do not have right to write on picking type it will fail.

This commit add a readonly on show_operation on the picking view
(already invisible). With that change the field will not be send
to the server and thus not writed.
2017-08-09 14:31:33 +02:00
Christophe Simonis 6554d95ed0 Revert "[FIX] crm, sale_crm, sales_team, website_crm_partner_assign: change context key"
This commit is not retro-compatible with existing database.
Moreover, the underlying issue (opw-757039) has been fixed via commit
baca743cc0.

This reverts commit 8510c0ce37.
2017-08-09 14:20:54 +02:00
Christophe Simonis acbcfa3703 [MERGE] forward port branch 9.0 up to baca743cc0 2017-08-09 14:14:44 +02:00
Christophe Simonis baca743cc0 [FIX] mail: force attachment type
Do not rely on default value. The context can contains a `default_type`
value intended for another model.
2017-08-09 14:06:13 +02:00
Christophe Simonis 6a767a8900 [MERGE] forward port branch 9.0 up to 3d119c44f3 2017-08-09 13:57:30 +02:00
Pierre Masereel fa9ad1563a [FIX] stock: traceability order of quant and move lines
When a mix of quants and move lines is displayed in traceability report,
they are not correctly ordered by date.

To fix this we sort them after having all quants and move lines
2017-08-09 13:31:23 +02:00
Pierre Masereel 783f5f54da [FIX] mrp, stock: adapt traceability for mrp unbuild 2017-08-09 13:31:23 +02:00
Christophe Simonis 0c13beb0cc [FIX] mail: check alias contact
Correctly verify method existance before calling it.
2017-08-09 12:44:13 +02:00
Nicolas Martinelli 0c92b616e8 [FIX] website_sale: mandatory fields
All fields appears in bold (= mandatory) in the checkout form, while ony
some of them are.

opw-760328
2017-08-09 11:21:17 +02:00
Lucas Perais (lpe) 3d119c44f3 [FIX] point_of_sale: correct inheriting from pos_order_line being an issue
Before this commit, when creating a pos_order_line_pro_forma, which inherits from pos_order_line but in a different table, the create confused an overriden field (order_id)
When pos_blackbox was installed, pro forma lines would search for an pos_order instead of a pos_order_proforma upon their creation

This commit allows an inheritant of pos_order_line to use the super.create function

OPW 745685

Closes #18755
2017-08-09 11:09:35 +02:00
amoyaux 0c8ebe05d7 [REF] stock : remove old/useless function
This commit remove the _filter_closed_move function that is no
more used since the refactoring introduced in saas-17
2017-08-09 11:08:51 +02:00
amoyaux f438a11099 [FIX] stock : return serial number
When an operation has the check for create new lots/serial numbers
activated and it exists a return that use this operation. The return
with serial number is not possible since it will display the view for
creating new serial number while we are returning some of them.

Trying to add the serial number name will fail due to the constraint
that ensure maximum one specific serial number by product.

This commit change the context before calling the view in order to
always display the many2one lot_id if the move is a return.
2017-08-09 11:08:25 +02:00
Jerther 64190abec5 [FIX] web: display full error message
Add missing parenthesis, fixes ebc23b5
2017-08-09 09:53:26 +02:00
Sylvain GARANCHER c29ac80c11 [FIX] product: Avoid browsing on product.product when using product.template
Steps to reproduce the bug:

On an empty database, install the sale module
-Activate product variants : Sales > Settings > Check Products can have
several attributes, defining variants (Example: size, color,...)
-Activate advanced pricelists : Sales > Settings > Check Advanced pricing based
on formulas (discounts, margins, rounding)
-Activate the developer mode
-Go to the product.templates list : Sales > Products
-Go to the debug menu > Edit TreeView and add the price field in the view
-Go to the debug menu > Edit Action and add the value 'uom': 1 in the context field
-Search for a pricelist : Type the name of an existing pricelist, then go to the pricelists
proposal, open the list of proposed pricelists, and select the pricelist

Bug:

The wrong value was sometimes displayed in the price field. To be more exact, the displayed
value for each product.template was the price of the product.product that has the same id.
If a product.template has an id which doesn't exist in the product_product table,
this product disapears from the list.

opw:762663
2017-08-09 09:13:50 +02:00
Sylvain GARANCHER 10f6e145dd [FIX] product: The pricelist variable must be a recordset, not a list
Steps to reproduce the bug:

-On an empty database, install the sale module
-Activate product variants : Sales > Settings > Check Products can have several attributes, defining variants (Example: size, color,...)
-Activate advanced pricelists : Sales > Settings > Check Advanced pricing based on formulas (discounts, margins, rounding)
-Activate the developer mode
-Go to the product.templates list : Sales > Products
-Go to the debug menu > Edit TreeView and add the price field in the view
-Search for a pricelist : Type the name of an existing pricelist, then go to the pricelists proposal,
open the list of proposed pricelists, and select the pricelist

Bug:

A traceback was raised.

opw:762663
2017-08-09 09:13:50 +02:00