Commit Graph
114369 Commits
Author SHA1 Message Date
Christophe Matthieu 73e2ba991c [FIX] web: add a stableSort method for sorting x2m
Issue: create 60 lines in ordered x2many with the same value (0) for the order
field and make a change ; the displayed records will be switched.

The problem appears because the sorting function is not stable and the
records with the same values can change place (hence change page), which is
quite disturbing for the user.
2018-01-05 17:34:25 +01:00
Christophe Matthieu b7ee1aa4b1 [FIX] web: sort and onchange in tabbed editable x2m
Two attempts of dealing with sorting (and resequencing) in tabbed (multi-pages)
x2many editable lists (see odoo/odoo@c2563db and odoo/odoo@983c7ae) have been
previously done, using a static attribute (`keepChangesUnsorted`) on the
datapoint.

This solution sadly only covers both cases separately, not if they are combined.
Morever, onchanges were not correctly managed in neither of these two cases.

A new approach is used here, by "freezing" and "unfreezing" the datapoint when
needed, which is more flexible.

Some modifications have been introduced:
 - when ordering a x2many, all records are now considered (and not only the
   records on the current page) ; an additional read is thus done on the sorted
   field for all records in the x2many relation
 - `setSort` is now asynchronous as a `read` might be needed
2018-01-05 17:34:25 +01:00
qsm-odoo d3cebdc4a2 [FIX] web_editor: always hide icon & video tabs when choosing bg img
This was broken in 11.0 if the media dialog was the first dialog to be
opened when using the editor. This happened for two reasons:

- Never use a widget (dialog)'s `$el` before it is started (opened).
  This was the case here. The bug is even worse in saas-11.1 as we do
  not allow to do that from there so it results in a JS crash.

- It worked in <= saas-16 because dialogs were started at once as they
  did not need to load anything. In >= 11.0, the first dialog which is
  opened in the page needs to request the main dialog template and this
  takes some time.

So, this fix makes sense in >= 9.0 but I chose to merge it in 11.0 as it
only induces a real bug from there.
2018-01-05 16:23:44 +01:00
Adrien Dieudonne 0f1832a362 [FIX] web_enterprise: chatter: remove horizontal scrollbar in mobile
Before this commit, the user had the ability to scroll horizontally
on some form views containing chatter.
This horizontal scroll only appeared in mobile (Android and iOS) but
it wasn't useful.
2018-01-05 15:22:21 +01:00
Géry Debongnie 1efc9d0b5e [FIX] web: transfer attributes to subnodes in list views
In many cases, we allow class and style attributes in the arch of a
view.  However, it did not work in a list view, and there is not really
a good reason for that (only cost is a few runtime checks).

So, with this commit, we allow those attributes in list views (and
x2manys obviously).

However, note that there is a subtle (maybe slightly confusing)
behavior: when a list renderer is in 'readonly' mode, it does not
actually instantiate any field widgets.  In that case, it optimizes the
rendering by putting only the formatted value inside a cell:

<td>some value</td>

So, in that case, the only valid target for the attributes is the td:

<td class="hello">some value</td>

But when we are in edit mode, we actually have a field widget inside a
td:

<td><input>some value</input></td>

And in that case, the natural home for the attributes is the field
widget.  This is quite important, because this is the way attributes are
done in the form view, and we do not want different behaviour.

<td><input class="hello">some value</input></td>
2018-01-05 14:42:55 +01:00
Nicolas Martinelli e8634b60c9 [FIX] purchase: almost equal
Prevent failing test.

opw-802764
2018-01-05 14:09:50 +01:00
Christophe Monniez c05ec6536b [FIX] sale_timesheet: fill customer email field
When creating an SO for a service that create a new Task in a Project, the customer
email field is left empty.
With this commit, the email field is filled with the SO customer's
email.

opw-803566
2018-01-05 13:52:42 +01:00
Lucas Perais (lpe) 47e2521d94 [FIX] delivery: reactivate update soline on shipper
install delivery
Create a SO with a shipper
Validate it
validate the delivery

Before this commit it was:
- impossible to do the setup for the delivery cost on the SO to get updated with the delivery validation
- the delivery cost on the SO did not update

This was because the stock API changed a bit a some functions were not here anymore

OPW 786500
2018-01-05 11:18:05 +01:00
Nicolas Martinelli e441f348ba [FIX] sale_stock: failing test
- Install a new db with demo data and sale_stock module
- Set rounding for product unit of measure from 3 to 5.
- Run sale_stock tests (from command line with --test-enable)

Current behavior:

> FAIL: test_02_sale_stock_return (odoo.addons.sale_stock.tests.test_sale_stock.TestSaleStock)
>
> AssertionError: 3.0000000000000004 != 3.0 : Sale Stock: delivered quantity should be 3.0 instead of "3.0000000000000004" after picking return
>

Fixes #21246
opw-803837
2018-01-04 16:17:01 +01:00
Nicolas Martinelli 6a481dce1f [FIX] stock_account: cost price digits
Complement of cf32a23b92

Closes #21686
opw-800279
2018-01-04 15:03:03 +01:00
Simon Lejeune 5f3255be7f [FIX] stock: _free_reservation
to reproduce:
- have 4 units of product 1 in stock
- create a move for a dozen, reserve it
- try to scrap a single unit
- an exception "cannot reserve more than available" is raised

To reflect the change of reservation after scrapping the quantity, we
have to update the reserved quantity on the move line.
When updating the quantity on the move line, "quantity_split" is in the
quant uom, so it should be converted to the uom of the move line.
2018-01-04 12:48:15 +01:00
Nicolas Martinelli cf32a23b92 [FIX] product: price precision
- Set a decimal precision for 'Product Price' = 6
- Set a currency precision = 2
- In the product for view, set a 'Sales Price' = 0.123456

The price is rounded to 0.12, while one would expect it to be 0.123456.

We use the decimal precision of the field rather than the default
currency precision.

Fixes #21686
opw-800279
2018-01-04 11:32:04 +01:00
Nicolas Martinelli 38e73da092 [IMP] web: support variable digits
In v10, a `Float` field with `widget="monetary"` option uses the decimal
precision of the field. In v11, however, it uses the decimal precision
of the currency. However, in many cases `widget="monetary"` is used in
the sole purpose of displaying the currency symbol. The precision of the
field sould be kept.

This commit introduces the support of the decimal precision of the field
for this specific use case thanks to the `field_digits` option:

```
<field name="pouet" widget="monetary" options="{'field_digits': True}" />
```
If such an option is used, the field precision will prevail over the
currency precision.

Related to #21686
opw-800279
2018-01-04 11:32:04 +01:00
Jeremy Kersten 8e181c99c2 [FIX] portal: show connected user in top menu.
Before this commit, if the username was smaller than 25 chars,
it was not displayed.

Bug introduced by commit 483c9bb
2018-01-03 16:16:57 +01:00
Yoshi Tashiro 95376cd6a3 [REF] l10n_jp: author company name changed
Company name of the author has been changed from Rooms For (Hong Kong) Limited to Quartile Limited.  See https://github.com/odoo/odoo/pull/19516.
2018-01-03 15:58:58 +01:00
Yoshi Tashiro 5e9ebe86ba [FIX] l10n_jp: wrong assignments of tax accounts 2018-01-03 15:58:38 +01:00
Adrian Torres 2bedd640db [FIX] ir_model: ignore monetary fields during install (#21789)
Previous to this commit, we try to load as many fields as possible
during module installation, however sometimes some fields are not ready
to be loaded, which is the case for custom monetary fields, thus when
trying to find the current model's currency_id field it would not find
it at all, generating an assertion error.

This commit changes this by completely skipping monetary fields if they
are not ready to be loaded.

OPW 787223
2018-01-03 14:35:54 +00:00
Adrian Torres 9f583717e5 [FIX] website: unlink website_id (#21972)
In the module website, the relational field website_id is defined twice,
once for ir_ui_view and a second time for res_config_settings, for the
former we perform an ondelete='cascade', which means that when the
website model is unlinked, the field is unlinked as well.

This is not done for the website_id field in res_config_settings, which
instead defaults to setting the field to NULL, which violates a not-null
constraint and therefore causes issues when trying to modify/save
settings.

To solve this, a hard delete of the ir_model_field website_id is
performed during the uninstall process of the website module.

Fixes #21905
OPW 803018
2018-01-03 13:53:44 +00:00
Andrea fe22a0f9ca [FIX] website_sale_management: Fix auto_install typo in manifest 2018-01-03 12:03:04 +01:00
Martin Trigaux cab7e0d204 [FIX] *: add missing space in multilines messages
Courtesy of @Yenthe666
2018-01-03 11:09:09 +01:00
Rémi Rahir 076821fed1 [IMP] doc: In-App Purchase
Added informations on packs and updated screenshots.
2018-01-03 09:44:29 +01:00
Nicolas Martinelli aa65a46fc5 [FIX] auth_signup, crm, project_timesheet_holidays, sales_team, website_sale: settings access error
The new settings model loads by default all settings. In the case of
non-admin user having the 'Settings' access rights this can lead to
access errors.

This commit deals with the multi-company issues on a standard
installation. If the admin is in Company A and the other user in Company
B, accessing the settings is pretty much impossible because of records
rules.

This fixes the master or demo data to avoid setting a company by
default. Note that it only fixes a standard installation: if the
settings are later customized, there is no guarantee that it will still
work.

Problematic fields:
`auth_signup_template_user_id`
`crm_default_team_id`
`leave_timesheet_task_id`

opw-801210
2018-01-03 08:49:32 +01:00
Adrian Torres 864ca5075f [FIX] authorize: add error-checking
Previous to this commit, if a user hadn't properly set up his
Authorize.net credentials, when getting a response from Authorize.net's
servers, we would expect some attributes to be in the response's body,
but this is not the case if the credentials are wrong, thus we would
have an unexpected error like "NoneType object has no attribute text"
which is only a sympton of the real error (bad credentials and no
error-checking).

This is fixed by checking if the response body contains an error
message, if it is the case we raise an UserError with the error code and
the error message (which is only shown if debug mode is activated).

OPW 788261
2018-01-03 08:39:28 +01:00
Christophe Simonis 3fe94628f6 [FIX] test_performance: bump query count for tracking fields (bis) 2018-01-02 18:31:02 +01:00
Martin Trigaux f8e38a6a0c [FIX] website_s{ale,lide}: no more Frenglish
Authentified is not proper English
Should be authenticated instead

Courtesy of Ray Carnes, #18995
2018-01-02 18:24:18 +01:00
Christophe Simonis 82c3d92971 [FIX] test_performance: bump query count for tracking fields 2018-01-02 18:11:25 +01:00
Martin Trigaux abf0e35522 [FIX] base_address_city: bad label name
Fixes  #21870
2018-01-02 17:48:25 +01:00
Christophe Simonis f1bdb459b8 [FIX] mail: use defined variable
Oversight of previous forward-port
2018-01-02 17:41:25 +01:00
Christophe Simonis 715fda1239 [FIX] web_editor: define variable before use
Oversight of previous forward-port
2018-01-02 17:24:11 +01:00
Christophe Simonis f02ed9ab9a [MERGE] forward port branch saas-16 up to 0af13af5de 2018-01-02 16:54:38 +01:00
Sanjay Jamod a8527a16b6 [FIX] web: Fix column_invisible issue (#21693)
[FIX] web: Fix column_invisible issue

This commit fixes an issue with the column_invisible attribute.

When we choose product variant for BOM for any particular product, 
at that time from the BOM Lines column "Apply on Variants" is hidden,
but when we unset product variant from BOM Form, 
at that time the column 'Variants" set to visible. but in this case, it is set to hidden always.

PR 21693, OPW 779555
2018-01-02 16:37:35 +01:00
Christophe Simonis 0af13af5de [MERGE] forward port branch saas-15 up to ddd293065e 2018-01-02 15:36:25 +01:00
Christophe Simonis ddd293065e [MERGE] forward port branch saas-14 up to ba2a83ddfa 2018-01-02 15:02:26 +01:00
Wolfgang Taferner 211226a725 [FIX] purchase: test rounding issue 2018-01-02 14:54:34 +01:00
Christophe Simonis ba2a83ddfa [MERGE] forward port branch 10.0 up to e336dc38ca 2018-01-02 13:56:49 +01:00
Christophe Simonis e336dc38ca [MERGE] forward port branch 9.0 up to 62aa3be24c 2018-01-02 13:20:04 +01:00
Lucas Perais (lpe) cd5dcb8f98 [FIX] mail: notify 'inbox' partners
When
- a user A had set 'notifications handled by Odoo'
- a user B sent a @userA message

Before this commit, the user wasn't notified in the inbox needaction

After this commit, he is

OPW 801315
2018-01-02 09:20:50 +01:00
Odoo Translation Bot 62aa3be24c [I18N] Update translation terms from Transifex 2018-01-01 02:40:01 +01:00
Odoo Translation Bot f60948d55c [I18N] Update translation terms from Transifex 2017-12-31 04:14:26 +01:00
Odoo Translation Bot 43487b73d6 [I18N] Update translation terms from Transifex 2017-12-31 00:42:46 +01:00
Simon Lejeune 652f8746d6 [FIX] stock: state of DO for an MTO product
When confirming a quotation for an MTO product, the state of the
delivery order goes from draft to waiting another operation to waiting
while it should stays in waiting another operation.

If procurement_jit is enabled, confirming a sale order line will
unreserve and rereserve the pickings associated (see
`action_launch_procurement_rule` override). Unreserving a picking will
always set its state to "confirmed", which is wrong if it should be in
"waiting another operation". Not writing on state (which is a computed
field) and let the depends call _compute_state fixes the issue.

The unreserve/rereserve thing is probably useless and is a remain of the
previous stock implementation where it was not possible to complete the
reservation of a move without wiping all its current reservation.
Another commit will improve this part of the code.

opw-801588
2017-12-29 15:56:30 +01:00
Nicolas Martinelli 88afd055cf [FIX] web: currency digits
- Set the currency rounding to 0.001 (3 digits)
- Create an account move
- Add an account move line, set an account

When switching from edit/read-only mode, the rounding switches from 2 to
3 digits.

This is because, in edit mode, the format method is the method of the
float widget. Therefore, in this case, the formatting doesn't take into
account the currency rounding.

To avoid this, we simply use a `noSymbol` flag to avoid adding the
currency symbol, while keeping the monetary rounding.

opw-800279
2017-12-29 09:20:18 +01:00
Simon Lejeune 0126823f98 [FIX] mrp: don't copy locked state
When copying a done MO that is unlocked, the new MO is also unlocked and
the buttons to produce/check availability aren't displayed and it is
confusing to the user.

Fixes #20119
2017-12-28 15:31:55 +01:00
Simon Lejeune 7862ce4d5d [FIX] mrp: mo: state and optional bom line
Optional bom line havea default `product_qty` of 0. As the "check
availability" button is displayed if the MO is not available and
the `_compute_availability` method considers all move of 0 `product_qty`
as unassiged, the "check availability" button was always displayed and
it was confusing.

Do not consider move with a 0 product_qty in the `_compute_availability`
method to fix the display of the button.
2017-12-28 15:30:13 +01:00
Christophe Matthieu 091c86c21b [FIX] web: unselect row before resequencing in editable list
If a row is being edited, this row will be refocused when performing changes
(i.e. resequencing records). It can cause an issue if an onchange modifies the
record being focused.

To avoid this issue, the row is unselected before resequencing records. The row
isn't selected anymore but this behaviour wasn't expected anyway.
2017-12-28 12:08:12 +01:00
Christophe Matthieu 1c7e0df5a5 [FIX] web: deal with same sequence in editable list
Resequencing records with the same sequence wasn't correctly working in the
editable list because we only care about the range between the swapped ids. In
some cases, this isn't good enough.

For example, if we have the records 1,2,3 with sequence field = 10,10,10, then,
swapping records 1 and 2 should lead to resequencing 3 with the sequence values
11,10,12 (to guarantee that the third item is after the previous 2).

Resequence now checks if the list increases or decreases without interruption
to create the subset that must be changed ; otherwise the whole list is changed.
2017-12-28 12:05:25 +01:00
Lucas Perais (lpe) cad10e6b78 [FIX] website_slides: typo in route definition pager
Before this commit, the route to the pager couldn't be resolved
because the <model("xxx.xxx") was having a typo

Now it doesn't, no traceback nor 500 error

OPW 801651
2017-12-27 16:34:44 +01:00
Nicolas Martinelli 3a79d2cf2e [FIX] hr_payroll: salary structure
- Create payslip
- Add a contract with any structure
- Add a structure in payslip, different from the one defined in step 2
- Confirm or compute sheet

Payslip is computed using the contract structure, while it should be
computed using the payslip structure.

Closes #21567
opw-787671
2017-12-27 14:48:25 +01:00
Nicolas Martinelli d12bbb0933 [FIX] account_budget: make analytic account mandatory
If no analytic account is set, the practical amount is always zero.

opw-802807
2017-12-27 14:15:17 +01:00
Nicolas Martinelli 4e2ce33f87 [FIX] hr_expense: set to paid
Filter out expenses which are already paid when set to paid.

opw-787874
2017-12-27 13:55:49 +01:00