Commit Graph
115639 Commits
Author SHA1 Message Date
Nicolas Martinelli 620a6f4557 [FIX] stock: change product on S/N
Do not allow to change the product on a serial/lot number for a product
which has existing stock moves. Doing so would screw up the traceability
report.

opw-1832452
2018-04-16 14:20:44 +02:00
Martin Trigaux a87dc3111c [IMP] doc: specify the API examples are in python2
Odoo 11 is python 3 but the xmlrpc interface works with python 2 too.
The example should probably be migrated to use python 3.
In the meantime specify exactly these examples are python 2 to avoid the
confusion.

Fixes #24232
2018-04-17 13:59:50 +02:00
Simon Lejeune b8133aa64b [REM] stock_account: valuation stat button
Remove the valuation stat button as we say that from now on, to
understand the current value of a product, you should go through the
valuation ation and its stat button.
2018-04-16 11:26:49 +02:00
Simon Lejeune 352875a5a0 [REF] stock_account: valuation at date wizard
We add the valuation at date wizard by re-using the quantity at date
wizard and adding a context key to separate the both.

The same view/action is used when openning the current or at date
valuation, only the `to_date` context key is changed.
2018-04-16 11:26:49 +02:00
Simon Lejeune 3a8281175d [REF] stock_account: support valuation at date
For the standard and average cost method, we use `qty_available` at date
and the `product.price.history` table.

For FIFO, the normal way would have been to get the `qty_available` at
date and value this quantity with the more recent IN moves at this date.

But there's two main obstacles preventing to use this solution:
- when editing a done move to change the quantity, the change is
  reflected at the date, the `qty_available` at date will be incremented
- in the same usecase, the remaining_qty and remaining_value is
  incremented in place, which mean that even if the layer was already
  consumed, it's now appearing again at the bottom of the fifo layer

Fixing this issue by adding a stock move at the date of today instead of
editing in place in v11 and adding a proper "cost layer" model in master
was deemed too complex as well as unnecessary by our bosses

So we now say we continue to update in place, and when looking at the
quantity at date
- if periodic, we sum the value of the move since the beginning of times
- if perpetual, we sum the balance of the account move lines since the
  beginning of times. Also, in this case, the quantity at date is
  computed across account move lines too, via the "quantity" field on
  aml.

This commit adds three non stored computed field:
- qty_at_date: will be computed across stock moves if fifo periodic and
  across account move line if fifo perpetual to reflect the design
  choice: if periodic, we *really* edit in the past ; if perpetual, no,
  the change is done at today's date
- stock_fifo_real_time_aml_ids: the used aml to compute qty_at_date
- stock_fifo_manual_move_ids: the used move to compute qty_at_date
2018-04-16 11:26:49 +02:00
Simon Lejeune 0eec54cae0 [FIX] stock_account: stock_value and depends
stock value should be recomputed when the standard price change

it is not optimal since it is updated in fifo after a delivery but
needed when working with standard cost method

remaining_value should also be part of the depends since the current
value depends on it
2018-04-16 11:26:49 +02:00
Simon Lejeune 348c371ee8 [REF] stock_account, stock_landed_costs: quantity field on account.move.line
Properly set the quantity field on the account move lines when
exceptions happen (unlock and edit: only the difference is set as
quantity, negative stock and vacuum: no quantity should be set).

When applying a landed cost, no quantty should be set neither.

This is a preliminary work to bring the valuation at date wizard to v11.
2018-04-16 11:26:49 +02:00
Simon Lejeune 704f5c9e00 [REF] stock_account: move's value and exceptions
Update the value on the moves when exceptions happen (unlock and edit,
negative stock).

This is a preliminary work to bring the valuation at date wizard to v11.

We also update the value on moves in the standard cost method to stay
consistent.

- `_run_fifo` now returns the used value in the negative stock case
- we simplify the `_fifo_vacuum` method so that the `remaining_value`
  always represent the not yet compensated value
- we adapt the tests to reflect theses changes ; the value is not the
  initial valued amount but is updated upon exceptions
2018-04-16 11:26:49 +02:00
Kiril Vangelovski ff07f078fa [FIX] base: reason json payload using get_data
Replace `httprequest.stream.read()` by `httprequest.get_data()` so the
payload content remains available: get_data stores the request body (by
default) so it remains available for alternative processing or checks
(MAC checks for webhook validations for instance). With `stream.read()`,
once the data is read if it's not stored separately it is lost.
2018-04-16 10:29:13 +02:00
Lucas Perais (lpe) 7a2cba3c89 [FIX] project: subtasks should be taken into account even if archived
Have a task (A) with two subtasks (B and C)
Archive C

Before this commit, when using timesheets, the task A hours was misconputed and did not take C's timesheet into account

After this commit, hours are accounted for even if their task is archived

OPW 1829658
closes #23920
2018-04-16 10:03:08 +02:00
Aaron Bohy 71087021f7 [FIX] web: DatePicker: open when clicking on caret
Before this rev., the datepicker could only be opened by clicking
on the input, not on its caret.

OPW 1836520
2018-04-16 08:35:47 +02:00
Odoo Translation Bot 4bc2581521 [I18N] Update translation terms from Transifex 2018-04-15 04:12:33 +02:00
Xavier Morel 1e6da402d7 [FIX] export performance regression from d28f8f7
d28f8f704f carefully clears only the
relevant bit of the cache (only the top-level object which we're
exporting), however the commit did not considert that _export_rows
calls itself recursively for relational fields, and thus when
exporting relational fields the relation would become the new
top-level and get cache-cleared on every iteration, significantly
slowing down cases where such records are shared and would need to be
re-fetched every iteration, even more so if they're somewhat/somehow
expensive.

OPW-1833545
OPW-1836361
2018-04-13 17:42:52 +02:00
Xavier Morel 115fa8f2d7 [FIX] export time regression by b5c660d8
While c059e7b93c64b9dd9bc96eeb6ee5cadf significantly lowers the cost
of generating xids, a safety invalidate cache can regress cases
significantly e.g. 18s -> 430s (7mn) for some recursive exports of
xids as the cache would be completely cleared *after each record*
requiring complete fetching & recomputation of the following records.

Fix by only clearing the cache if we've actually had to create
xids *and* only for ir.model.data records.

It's possible that clearing the cache isn't even necessary at all (?),
check with @rco-odoo

OPW-1835226
2018-04-13 17:42:52 +02:00
qdp-odoo 0800942078 [FIX] l10n_do: adapt to Norma 07-2018
Was PR #24123 and #24124. Courtesy of Gustavo Valverde (Iterativo)
2018-04-13 16:03:55 +02:00
Nicolas Lempereur b8b0f947bf [FIX] web: remove ­ when saving phone number
When Odoo display a phone number number, on phone or if VOIP is
installed a invisible `­` character was added from 9.0 up to
saas-11.2 so an applications such as skype would not be concerned with
the number.

But if someone copy-pasted from this to somewhere else in Odoo, we would
get incorrect number with this invisible caracter. So this change make a
special case for the "FieldPhone" so the character is removed from data
saved.

opw-1834858
closes #24223
2018-04-13 15:35:33 +02:00
Aaron Bohy 52cd52e624 [FIX] web: BasicModel: default_get on o2m with date field
Before this rev., a crash occured when a default_get returned a
command 0 (CREATE) for a one2many, with a value for a date(time)
field (e.g. [0, false, {some_date_field: '2018-12-08'}]). This
was because the related values (inside the commands) weren't
parsed. This only impacted date and datetime fields, for which the
parsing converts the string into a moment instance.

Fixes #23672
2018-04-13 14:59:48 +02:00
William Henrotin baeb743251 [IMP] doc: add profiler example
The built-in Odoo profiler can be used directly into the logs. This
information was not given in the documentation. This commit add it. An
example on how to use is shown as well as the produced result.
2018-04-13 13:59:12 +02:00
Lucas Perais (lpe) 8e5156938a [FIX] web: o2m list with field datetime from server
Have the create_date field displays on a one2many list
Try to add a record onto the list

Before this commit, when the virtual record is added onto the list
it crashes because the datetime field is undefined and cannot be parsed

After this commit, It doesn't crash though the value would have to wait the save on the main record
to be updated (because it is the create_date)

OPW 1834250
closes #24097
2018-04-13 13:41:39 +02:00
stefanorigano 6fb59b2337 [IMP] mail: followup of 2157540768
Properly change the color of the note using variables and avoid getting
50 shades of grey in the less variables.

Increase a bit the border bottom to mark the difference.

The note vs message rendering should still probably be improved as changign the
background is a bit confusing but in the meantime, the difference is visual
enough.
2018-04-12 01:25:00 +02:00
celm1990 2157540768 [FIX] point_of_sale: set the payment date based on TZ
If a user is in an early timezone (e.g. UTC-5), an order made on the
...-01 19:15:00 or, converted to UTC, as ...-02 00:15:00
fields.Date.today() returns the days ...-02 instead of ...-01
Use context_today to convert in the right timezone.

This slightly change the return format of _payment_fields to return a date
instead of a datetime.

Followup of 7272abe0e3 that was adding the timezone in the context

Closes #22651
2018-04-12 01:17:47 +02:00
Rémi Rahir fe7b9ab709 [FIX] sale: missing field in quotation report
Before this commit, the field validity_date was missing from the
default quotation report. Historically this field was added in
module website_quote but it was then moved to sale in
77bd5181f7

The modification on the quotation report related to validity_date
were missed at that time.

This commit adds validity_date to the default quotation report.
2018-04-12 15:04:47 +02:00
Nicolas Martinelli 7242544506 [FIX] base_import: activate advanced mode
The commit 1ba4fbe640 did not match the specs of the task, but
was merged anyway. Reverting the commit, and check by default so the
user is not confused with missing fields.

opw-1824074
2018-04-12 14:54:25 +02:00
Aaron Bohy 9c1c2c55c2 [FIX] web: one2many: add new record with 'Save & New'
Consider the following scenario involving a one2many list (non
editable) inside a form view:
 - click on 'Add an item', a model opens,
 - fill the fields and click on 'Save & Close',
 - reopen the freshly created record,
 - maybe make some changes (this is optional, but makes sense),
 - click on 'Save & New',
 - fill the fields and click on 'Save & Close',
 -> the second created record isn't added to the list.

The problem comes from the fact that when the dialog is opened for
the second time (in this case by clicking on a record), the 'save'
handler registers an 'UPDATE' command. While this is correct for
the 'Save & New' click (as we update an existing record), this
isn't for the second record which doesn't exist yet, and thus
requires an 'ADD' command.

This rev. ensures that the two cases are handled in the 'save'
handler given to the dialog.

OPW 1829723
2018-04-12 14:37:35 +02:00
Nicolas Martinelli 9353fa1ede [FIX] stock: trigger warning
Do not trigger warning if `qty_done` is not yet set, since it is
automatically set to 1.0 in `onchange_serial_number`.
2018-04-12 13:55:10 +02:00
Nicolas Martinelli dc5dfa0430 [FIX] stock: S/N in mobile view
In mobile view, it is impossible to add serial numbers on pickings,
because the button is not on the kanban view.

opw-1816837
2018-04-12 13:55:10 +02:00
Martin Trigaux 43e0518833 [FIX] mail: restore pre v11 note color
The gray-lighter was modified at 88881e9f to make it lighter (#F9F9 instead of
Restore the previous grey and increase contrast.

To quote "The Non-Designer's Design Book by Robin Williams":

> Contrast is created when two elements are different. If the two elements are
> sort of different, but not really, then you don't have contrast, you have
> conflict. That's the key–the principle of contrast states that if two items
> are not exactly the same, then make them different. Really different.

opw-1835722
2018-04-12 13:34:00 +02:00
Lucas Perais (lpe) 7b49f5836c [FIX] account: partner's fiscal position chosen within its company
Before this commit, a partner in a company could have a fiscal position belonging
to another company
Namely, the search view on the field property account position displayed every fiscal position

This could create problems afterwards, when managing an invoice from a restricted rights user
(with an access right error raising)

After this commit, we soflty constrain the choice of the fiscal position to the ones
belonging to the same company of the partner

OPW 1833848
OPW 1827831
closes #24056
2018-04-12 11:10:51 +02:00
Lucas Perais (lpe) 0b1b860d97 [FIX] stock_account: display to_refund on return picking as toggle
When clicking on a stock.picking form
a modal appeared,

Before this commit a checkbox on the lines was present to update the PO
Since one needed to click on span to put the line in edit mode and edit the boolean
It seemed that the boolean was not editable.

After this commit, we add the toggle_boolean widget to handle the field
It is interactive even if the line is not in edit mode.

OPW 1818700
closes #24138
2018-04-12 11:04:21 +02:00
Martin Geubelle 729ff2d35e [FIX] web: update column in grouped kanban
In a kanban grouped by many2one with a progressbar, after emptying a column
by moving all records, the column wasn't correctly updated. This was causing,
in the best case, a record duplication or, in the worst case, a traceback.

This issue comes from the fact that, with a progressbar, a read_group is
performed each time a record is moved. When the group (column) becomes empty,
the read_group won't return this group even though the group still appears in
the kankan. When moving back the record in this empty column, there is a
desynchronization between the kanban controller data and the model.

To fix this issue, an option `keepEmptyGroups` is passed when performing the
mentioned read_group ; this mimics the kanban display that keeps empty groups
displayed and there is no desync anymore.

Fixes #23982
2018-04-12 10:10:08 +02:00
Jeremy Kersten 73425edfe9 [FIX] website_sale_wishlist: remove wait in tour
Don't wait 1 sec by step for pleasure, correct trigger/extra_trigger
make it useless.
2018-04-11 20:59:51 +02:00
Valentin Löfberg 80029cae36 [FIX] website_sale_wishlist: allow deletion of wishlist item when not connected
Add controller to remove (archive) an item from the wishlist.
Rpc cannot be used because user can be public

Adding tour test

task-1834888
This commit closes #24135
2018-04-11 20:54:55 +02:00
Martin Trigaux 8b8815f44c [FIX] http_routing: translate without website
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).

In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`

This commit fixes two bugs:

1. Install `website_sale`, activate discussion on products
  -> the chatter is not translated as the portal translations not loaded in the
     `/website/translations` controller

2. Install `helpdesk` but not `website`, go to portal view of a ticket
   -> the heldesk chatter is not translated as the `/website/translations`
      controller is not called (only provided by the website module)

This patch implements a modular approach to translate the web resources of the
right modules only.

The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module

Closes #23618
Fixes #23610
2018-04-11 16:55:14 +02:00
Martin Trigaux 7272abe0e3 [FIX] point_of_sale: create orders with the correct context
The timezone of the user was not passed and preventing the use of context_today
as showed at #22651
2018-04-11 16:31:34 +02:00
Martin Trigaux fcd81acaea [FIX] l10n_ch: remove hardcoded translations
These translations were for the first company only ('1_' part)
The process_translation part in l10n_multilang is enough to propagate the
translations of the templates to the accounts
2018-04-11 16:19:41 +02:00
Martin Trigaux ea747d23e4 [IMP] l10n_ch: translate CoA in de and de_CH
de_CH was not available before, people migrating will not get their CoA
translated.
Rename the translation file so it is loaded by any de_* language
Add multiple spoken_languages to be sure to load each one via the
process_translation mechanism.

Fixes #24037
2018-04-11 16:19:37 +02:00
Martin Geubelle 0d46c0b91d [FIX] web: correctly position carret in list
In list view, the carret was not correctly positioned in empty cells (i.e.
handle widget in readonly).

This rev. ensures that the position rules are only applied if the cell is not
empty.

Fixes #23984
2018-04-11 15:54:06 +02:00
stefanorigano b3ad32f45b [FIX] web: fixes some design alignements
- Use 'baseline' to ensure that the priority icon will align to the
  parent's baseline
- Align the favorite icon in dashboards
- Align the statusbar's caret in form views
2018-04-11 15:36:11 +02:00
Arnold Moyaux c04119fc4f [FIX] purchase : be able to use it with MPS
Since procurement group is passed by the optional values
in the procurement proccess it should be considered as optional

MPS do not use procurement group because they will add the
planification in an existing RFQ it will fail because purchase search
for the key 'group_id' in values

opw-1833060
2018-04-11 15:09:59 +02:00
qsm-odoo ad46adcfc7 [FIX] web: stop wrapping kanban counter over multiple lines
Note: this should normally not be the case by design as for most
values there is enough space for the numbers not to wrap. While
waiting for a better implementation, the white-space:nowrap CSS
rule will enforce the behavior.

Thank you to @Jerther for the original commit.

Closes https://github.com/odoo/odoo/pull/24100
2018-04-11 15:04:40 +02:00
Alexandre Kühn ea25036c14 [FIX] web: graph rendering when in DOM
Backported fixes:

    1. [IMP] web: GraphView: remove hack to render in DOM

        - ref. 166319fa4a
        - fully backported.

This commit backports the fix that removes the hack for rendering graphs
(delay in a setTimeout), so that the graph is rendered when it is in the DOM.

    2. [IMP] web: restore scroll position

        - ref. 4e204ed223
        - partially backported: only keeps `on_attach_callback`
          and `on_detach_callback` in the abstract_controller
          and in the abstract_renderer.

This commit backports the use of the hooks methods `on_attach_callback` and
`on_detach_callback` in abstract controller and renderer, so that the
controller of any view warns the renderer when it has been attached in
(or detach from) the DOM.

Also, this commit adds `on_attach_callback` and `on_detach_callback` for the
dashboard app, so that the graph view is correctly rendered.

Fixes #24092
2018-04-11 14:52:56 +02:00
Goffin Simon c471ca22be [FIX] purchase: Procurement rule Buy missing when installing Purchase
When installing Purchase, the procurement rule Buy for My Company, Chicago
was missing.

opw:1835411
2018-04-11 14:28:09 +02:00
Richard Mathot 79447255f4 [FIX] google_calendar: broken link to docs 2018-04-11 13:51:17 +02:00
Toufik Benjaa 0c9eabb0a9 Revert "[FIX] account_payment: Restrain access to invoice's partner"
This reverts commit 55878df5ff.
2018-04-11 12:26:41 +02:00
Parth Patel 7516d9bb7f [FIX] website_sale: make shipping address group-option valid for all user groups
Indeed in website_sale this option is used in templates, meaning public and
portal users should be added or removed from that group accordingly.

This commit is related to task ID 1746668. Closes #22753.
2018-04-11 12:18:53 +02:00
Nicolas Martinelli 33ba61bfdb [FIX] web: domain evaluation
To reproduce the error, go to Accounting > Import Statement, then
Cancel. An error occurs because `belongs_to_company` is not in the data.
Indeed, it is directly set on the action
`open_account_journal_dashboard_kanban`.

Commit 9961bbf4eb re-evaluates if a record should be displayed in the
Kanban view after applying an action (in particular, archive a record).
However, the domain evaluated might contain values which are not in the
data. This is for example the case if there is a domain on an action.

Fixes #24142
opw-1835216
opw-1835123
2018-04-11 11:24:02 +02:00
Goffin Simon 5bb6517072 [FIX] purchase: Wrong Fiscal position in multicompany
Steps to reproduce:

 -Create company A
 -Create company B
 -Admin user with both companies but currently in company B
 -Create Demo user only with company B
 -Create fiscal position A to company A
 -Create fiscal position B to company B
 -Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
 -Create product and add the vendor created before
 -Set like Create a draft purchase order
 -Logging with Demo user
 -Create sale order with one sale order line with route make to order
 -Validate sale order

Bug:

 The purchase order created by sale order had the fiscal position company A.

Closes #23561
opw:1825098
2018-04-11 09:11:55 +02:00
Nicolas Lempereur b79d8b99ff [FIX] base: amount_to_text possible difference
In 79038055 amount_to_text was refactored and improved, but there is a
drawback.

ie. if we have .29 cents with two decimals, `Twenty-Eight` was displayed
because `int(0.29 * 100) == 28` due to floating-point representation.

This commit keeps the improvements and fix this issue by using string
formatting of float as was done before.

opw-1829924
closes #24161
2018-04-11 08:57:20 +02:00
Goffin Simon 8d851e4a17 [FIX] mrp_repair: repair fee lines without product_id filled
It's impossible to add a repair fee line without a product because the
product uom is required.

opw:1833233
2018-04-10 16:47:26 +02:00
Swapnesh Shah d805354123 [FIX] google_calendar: redirect to proper setting
Added the context key in action to open the General Setting menu instead of the
first configuration page (e.g. CRM)

Closes #24144
2018-04-10 16:43:30 +02:00