Commit Graph
110319 Commits
Author SHA1 Message Date
Aaron Bohy 816a3cd2c1 [FIX] web: ViewManager: filter out some keys from context
A traceback occured when trying to create a BOM by going to
Inventory > Master Data > Products, on a product form view clicking
on the BOM stat button, and then on 'Create'.

This was a context problem: the context of the 'Products' action
was passed to the 'BOM' action without removing action specific
keys like 'default_*' or 'search_default_*'. For instance, it
contained a 'default_type' key, and as type is also a field of the
mrp.bom model, the python tried to interpret it, except that the
given value wasn't a correct value for mrp.bom.

When a button is clicked, we mix contexts coming from different
places to execute the new action. For some of them, we already
filtered out those action specific keys. This fix is simply to
make the piece of context adding the problematic keys pass though
the filter as well.
2017-06-27 14:12:31 +02:00
Aaron Bohy 4881f942cb [FIX] web: BasicModel: correctly eval x2manys in domains
When x2many fields have to be evaluated in domains (e.g. ['id',
'in', some_x2many_field]), they must be evaluated as the list of
ids in the relation (whereas in contexts, they are evaluated as a
list of commands). Before this rev., they were always evaluated as
a list of commands.

Note that this didn't work neither before the new views.
2017-06-27 14:12:31 +02:00
Aaron Bohy 17e198153e [FIX] web: BasicModel: store changes in x2many as operations
Datapoints of the BasicModel store the data fetched from the
server and changes done (not saved yet) by the user. For x2many
fields, datapoints are of type 'list' and have a 'res_ids' key
containing the ids of all records in the relation. They also have a
'data' key containing datapoints of type 'record', representing the
records in the relation that have been fetched (with a limit set to
40 or 80 depending on the subview used). So basically, the length
of res_ids may be different than the length of data.

Before this rev., the changes in x2manys were saved under the key
'_changes' as a duplication of the content of 'data', i.e. same
list of datapoints of type 'record', modulo the changes done (it
contained the new records added and didn't contained the removed
records, whereas the 'data' remained unchanged). This didn't worked
at all when there were more records than the limit in the relation.
Indeed, when this happened, the commands to send to the server
couldn't be generated correctly.

This rev. modifies the way changes are stored in those datapoints.
Now, each change is stored as an operation. An operation could be
of type 'ADD', 'REMOVE', 'REMOVE_ALL' or 'UPDATE'. As before,
'data' remains unchanged and always keeps the datapoints of records
that have been fetched (the ones that are currently displayed in
the list or kanban subview). This way, commands can now be properly
computed.

This had a nice side-effect of fixing two other bugs linked to
x2manys.
First, when used in a context (e.g. {some_key: some_x2many_field}),
the value of some_x2many_field (i.e. a list of commands) was always
[] if the field was invisible="1" in the view, because it's
subrecords weren't fetched, and the generated commands were based
on them. Now, they are generated from the list of res_ids in the
relation, so it works fine.
Second, the x2many records are supposed to be sorted client-side,
after being read, and after each edition. This was working in the
first case, but not in the second. Now it's working even after
a record edition.

This rev. also correctly sets the 'parentID' and 'static' keys in
datapoints.

Finally, we also fixed the pager in x2manys as it was badly
displayed (small less tweaks).
2017-06-27 14:12:31 +02:00
Christophe Simonis 278e478d55 [MERGE] forward port branch saas-15 up to b141b24706 2017-06-27 12:41:47 +02:00
Christophe Simonis b141b24706 [MERGE] forward port branch saas-14 up to b1f738d1ca 2017-06-27 12:02:56 +02:00
qdp-odoo d3ff26654a [FIX] account: max_date field of partial reconciliation is a date, not a datetime.
This field it is computing the max of 2 date fields, so it has to be a date too. This was messing in the aged receivable/payable reports.
2017-06-27 11:59:38 +02:00
Christophe Simonis b1f738d1ca [MERGE] forward port branch 10.0 up to 89a99407ce 2017-06-27 11:39:43 +02:00
Adrien Dieudonne 1e4f4299bc [FIX] *: reports: check required values for 'render_html'
Some reports require additional information to render. When
accessed in Odoo, the user has to fill a wizard to provide those
information. However, when these reports were opened in Studio,
it crashed as those information were missing (we don't pass
through the configuration wizard in this case).

This fix checks if all the required information are given before
trying to render those reports, and it displays a warning in
the logs in they are missing, which is better than a traceback.
2017-06-27 11:15:24 +02:00
Xavier Morel 89a99407ce [FIX] website_forum: yet more untranslatable terms 2017-06-27 10:36:24 +02:00
Aaron Bohy 05282fd434 [FIX] web: pyeval_tests: typo
Introduced by forwardport 34b432d528
2017-06-27 10:22:35 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
Christophe Simonis 80775a7362 [MERGE] forward port branch 10.0 up to 4c66eae308 2017-06-26 18:38:41 +02:00
Martin Trigaux 4c66eae308 [FIX] website_sale,website_crm: untranslated term
opw-748880
2017-06-26 17:05:39 +02:00
Martin Trigaux b1a3bb7d9a [IMP] doc: warn gantt view is not available in community version
May be confusing for new users

Closes #17817
2017-06-26 16:31:48 +02:00
Goffin Simon d37ef94c4b [FIX] mrp: Post inventory button without finished product"
This fix 2e18070a66595a72a9a626a196c97a689832f667  has been done in stable and some customers
wants to keep the button "Post Inventory" available all the time.
Now the button is just visible in developper mode.

opw:748347
2017-06-26 15:18:32 +02:00
Nicolas Martinelli d6909f42ad [FIX] stock: incorrect ordered quantity
- Create a stockable product, get 61 units in stock
- Create a SO of 75 units, validate
- In the picking, transfer only 50 units, validate and create a
  backorder
- Print the Delivery Slip of the picking: it shows 61 units ordered
- Print the Delivery Slip of the backorder: it shows 61 units ordered
- Receive the 14 missing units, recheck availability on the backorder:
  it shows 25 units ordered

The quantity ordered should be recomputed from the stock moves when a
partial transfer is done.

opw-747983
2017-06-26 15:16:07 +02:00
Christophe Matthieu 4d79a1ff58 [FIX] payment: prevent access error for manual payments
Rev. cf1df16aea introduced new callback
fields with restricted access. The lazy hash generation in create() was
however causing access errors for manual transactions created by users
who are not administrators (e.g. Accountants).

Those manual transactions do not typically need a callback, but checking
the presence of the callback requires a limited sudo() context.

Similarly, the execute_callback() method may be called for a manual,
non-admin transaction, and should not do anything if there is no
callback, instead of crashing with an AccessError.

The generation of the hash and execution of the callback should be done
with a normal environment, though, as these must only be used for
transactions run by the system.

opw-747536
2017-06-26 15:09:13 +02:00
Nicolas Martinelli 831744684c [FIX] stock: empty state
- Update view with external_id=stock.view_move_picking_tree and remove
  editable attribute on the tree view.
- Create a new picking
- Add a line (form view will open) and click on "Save and close"

=> A traceback show up since 'scrapped' was not in the form view.

- The picking location fields become readonly, and the status bar
  disappears
- Save the picking

=> Error: "creation/update: a mandatory field is not correctly set :
   [object with reference: location_id - location.id]"

Courtesy of @benwillig

Closes #17738
opw-748353
2017-06-26 14:07:28 +02:00
Christophe Simonis e1c74e374c [MERGE] forward port branch saas-14 up to 3bac72ba74 2017-06-26 14:04:04 +02:00
Pieczynski Marcin d86f134abd [CLA] signature for piemar1
Done at #17817
2017-06-26 13:46:04 +02:00
Goffin Simon 51d072db44 [FIX] stock_account: Invalid product price history breaks stock valuation
Steps to reproduce:

1. Create a new Stockable Product
2. Set cost price to 2.00
3. Adjust stock to 10 pcs
4. Enable developer mode
5. Go to Inventory > Reports > Inventory at Date
6. Select current time and retrieve the inventory value

Bug:

The stock valuation for the product was 0.0.

Reason:

When creating a stockable product, Odoo creates
two price history entries with the same datetime
but different cost. The stock valuation report only
takes one of them into account.

Fixes #14889

opw:747857
2017-06-26 13:22:03 +02:00
Christophe Simonis 3bac72ba74 [MERGE] forward port branch 10.0 up to aaadb232b2 2017-06-26 13:00:18 +02:00
Christophe Simonis 75f93a9cfe Revert "[FIX] *: reports: check required values for 'render_html'"
This is not how you check that a dict contains keys.

This also break the contract of method `get_html` that may now return
`None`, which `get_pdf` does not handle.

This reverts commit 0d2fb541e8.
2017-06-26 12:43:31 +02:00
Christophe Simonis aaadb232b2 [MERGE] forward port branch saas-11 up to 459ea4ab4d 2017-06-26 11:38:54 +02:00
Martin Trigaux 790ff6d655 [I18N] pull web* translations
Some were skipped due to API limit
2017-06-26 11:25:54 +02:00
Joren Van Onder 91abcdf842 [FIX] payment_*: always read callback_eval as superuser
The callback_eval field has a groups parameter of
base.group_system. Without this patch everyone not part of that group
ends up with an access right error when the system attempts to read
that field.

Previously this was not a problem because all code reading
callback_eval was executed with the superuser already. New code has
been introduced however that does not do this (eg. paying with a
payment.token from the backend).

opw-741181
2017-06-26 11:19:46 +02:00
Christophe Simonis 459ea4ab4d [MERGE] forward port branch 9.0 up to 2b2be3caa4 2017-06-26 11:15:11 +02:00
Christophe Simonis 2b2be3caa4 [MERGE] forward port branch saas-6 up to 2ae2db175f 2017-06-26 11:13:09 +02:00
Christophe Simonis 2ae2db175f [MERGE] forward port branch 8.0 up to 6b5f3c2364 2017-06-26 11:07:20 +02:00
Odoo Translation Bot afba38b88d [I18N] Update translation terms from Transifex 2017-06-26 10:49:30 +02:00
David Arnold 1930e8dffb [I18N] remove es_CO translations
Based on analysis https://gitlab.com/snippets/1665976

Closes #17815
2017-06-26 10:13:25 +02:00
Martin Trigaux 2c96c696b1 [FIX] stock: duplicated entry in pot file 2017-06-26 09:57:41 +02:00
Odoo Translation Bot 59afea4c82 [I18N] Update translation terms from Transifex 2017-06-25 07:07:03 +02:00
Odoo Translation Bot ee3a6b6793 [I18N] Update translation terms from Transifex 2017-06-25 04:27:29 +02:00
Odoo Translation Bot ed46386436 [I18N] Update translation terms from Transifex 2017-06-25 00:27:33 +02:00
David Monjoie 99ce9e7c60 [FIX] web: fix duplicated tags at re-render 2017-06-23 16:36:38 +02:00
Martin Trigaux 4755fce915 [I18N] update source terms
Was done poncutally but no global one since the release
2017-06-23 16:34:23 +02:00
David Monjoie 378efa1444 [FIX] web: update filename correctly in binary fields
The update_field event is not used anymore so it needs to trigger
a field_changed instead.
2017-06-23 16:16:36 +02:00
JesusZapata 6a732fd2c9 [FIX] stock: Prevent to reset a 'done' picking in 'draft' state
This change will prevent the document from going from Done to Draft

In some cases a user may make that error functionally. It is only to have an additional validation

In the past, we didn't need this validations because the workflow didn't allow the use of a transition that is not defined on the correct state but since that we don't have workflow so we need manage this inconsistent action from original method in order to avoid a wrong transition.
2017-06-23 15:32:43 +02:00
Alexis de Lattre 1a57cccc0d [FIX] l10n_fr: use full account names
Use full account names
The parent accounts have been removed but the account names have not changed.

Closes #17770
2017-06-23 14:51:19 +02:00
Lucas Perais (lpe) c284f0131b [FIX] crm: crm_lead should have its email_from set when creating one opportunity from a contact
With the flow:
- create a contact with email address set
- click on smart button "opportunities"

When creating opportunity with the plain "create button", the opportunity gets its email_from correctly
whereas
when creating an opportunity from a kanban state's quick create, only the partner is set, and not the email_from

This commit aims at setting the email_from using either way of creating an opportunity

OPW 743698

Closes #17664
2017-06-23 14:44:41 +02:00
Cedric Snauwaert e3d5176a41 [FIX] rating: after posting a rate, don't redirect to backend
Some user might be logged but not have the right to access issue or task.
Plus it does not make any sense to redirect to backend after rating a task or an issue.

OPW: 748579
2017-06-23 11:48:44 +02:00
Jérome Maes 7c0fed48a1 [FIX] product: name_create for product category
`name_get` has changed with b1a8cf2e27
So, `name_create` is required since `name` is required field, and
rec_name refered to `complete_name`.
2017-06-23 11:31:18 +02:00
Jérome Maes 39bf31ef75 [FIX] lunch: don't break lunch widget
In order to sort lunch order by date desc, the commit
9ab9da235f modified the
json structure (dict to array) of serialized 'previous_order'
field, without changing js code.
The previous order field should respect the new order, so
using OrderedDict does the job !
2017-06-23 11:31:08 +02:00
Leonardo Rochael Almeida bbc47177ce [IMP] base: drop unused onchange_state
It calls `onchange_state()` on `res.partner` which was removed on
(24aba60).

It was added to `res.users` long ago (009ea40) to support a `state_id`
field on the view `res.users.simplified.form` that is no longer there
since v8.0.

The method is then never called and was crashing if called.

Closes #17772
2017-06-23 10:12:48 +02:00
David Monjoie 9d1744b797 [FIX] web: fix kanban view grouped on unset m2o
The previous code loading the tooltip data was sending a null value
to read as id, which resulted in an access error. This behavior was
not observable in the tests because of b8c1571 which was meant to
allow giving inexistant ids to mockRead but also ended up accepting
falsy values, which was not true to the actual server.

In addition, the title of the column was wrong for unset m2o, it
displayed false, the value of the field when unset, rather than
the default "Undefined" title.
2017-06-23 09:58:46 +02:00
David Monjoie 0236ac510b [FIX] web: update buttons in editable list view when no changes
When I introduced this line in 374295b, I was working on the form
view and didn't realize I would be breaking the editable list view.

The _setMode function only updates the buttons when given the id of
a record. Since I was working on a form view at the time, I didn't
need to give a recordID to make it work since the default ID of a
form view is the id of the record itself. However, in editable list
view, the id of the view is a list of ids, so the buttons would not
be updated in this case.
2017-06-23 09:58:45 +02:00
David Monjoie 3cbfc40303 [FIX] web: fix m2o with show_address
When the show_address option is enabled, the display_name of a
partner becomes a newline concatenated version of his name and his
address, so the internal value of the widget is this conglomerate.

However, if one uses a keypress that does not change the value of
the input in edit mode, say ESC for example, the keyup handler of
this widget will compare the value in the input with its internal
value. If the internal value is still the conglomerate, which is
the case if the user hasn't changed the input content since
switching in edit mode, we need to trim it to compare it to the
actual input value, which is the "standard" display_name, ignoring
the magic show_address feature which is only used in readonly.
2017-06-23 09:58:43 +02:00
David Monjoie 1192ca1048 [FIX] web: fix searching on datetime fields
Previously, one could not create a custom filter on a datetime
field without encountering a crash.
2017-06-23 09:58:42 +02:00
Nicolas Martinelli c82ec7a6fd [FIX] purchase: cancelled procurement
If two MOs are using the same PO, when we cancel the first MO, the
check availability of second MO is not working.

The incoming shipment of the Purchase Order has the first MO's move_id
as the destination move. When we cancel the first MO, the incoming
shipment of Purchase Order still holds the first MO's move. Because of
that reason, the check availability is not working for the second MO.

While setting the destination move for the stock moves of the incoming
shipment, it should ignore the cancelled procurements.

Closes #17701
opw-748074

Courtesy of @suganthikarunanithi
2017-06-23 09:05:45 +02:00