Commit Graph
117975 Commits
Author SHA1 Message Date
Martin Geubelle a7b521fe44 [MOV] web, mrp: move pdf_viewer widget
This widget is generic enough to be used in other modules than mrp so
we move it in the web module.

Closes #22569
2018-02-12 11:16:21 +01:00
Aaron Bohy c265e47a63 [FIX] web,*: tests: remove src attr from img nodes
In the tests environmnent, we don't want img and iframe nodes to
perform RPCs when they are inserted into the DOM. For img nodes,
we prefixed the src attribute by '#test: ' as soon as they were
inserted into the DOM. Unfortunately, this didn't work as expected:
an RPC was done to fetch route '/web/tests?' (i.e. the tests page),
because everything after '#' in the url isn't sent to the server.

This rev. completely removes the src attribute of img nodes, and
set a 'data-src' attribute with the original src attribute's value,
so that it can still be checked in the tests.

Tests using this attribute have been adapted accordingly.
2018-02-12 11:13:42 +01:00
Aaron Bohy 5c67abd0d3 [REF] web: tests: move calls to removeSrcAttribute
In the tests environment, we listen to the 'DOMNodeInserted' event
to remove the src attribute of img and iframe nodes as soon as they
are inserted into the DOM, so that they don't perform RPCs.

However, this listener was bound in the create(Async)View, and
createActionManager helpers only. This rev. moves it to the
addMockEnvironment helper which is more global, and basically used
by all tests.

Moreover, we now listen to the 'DOMNodeInserted' event on the body,
instead of on the widget, as it may happen that some content is
inserted into the DOM outside the widget itself (e.g. dialogs are
appended to the body).
2018-02-12 11:13:42 +01:00
Aaron Bohy 11dff2b05c [FIX] web: ListView: format footer values
Before this rev., the aggregates values displayed in the footer of
list views were formatted according to the field type, and the
field's widget was ignored, whereas it should be used by default.
For instance, if the 'float_time' widget is set on a float field,
the sum should be formatted as FloatTime as well.

Closes #22724.
2018-02-12 11:11:43 +01:00
Aaron Bohy 0982ceaa37 [FIX] web: ListView: reset selection when reloading
Before this rev., the list of selected records wasn't correctly
reset when the list was reloaded (e.g. when coming back using the
breadcrumbs). In the UI, the records weren't selected anymore, but
in javascript, the list of selected records wasn't empty. As a
consequence, the aggregates were wrongly computed, and always
displayed 0.

Closes #22725.
2018-02-12 11:11:43 +01:00
Lucas Perais (lpe) b6d156ad7a [FIX] web_planner: take 'view_type' of action into account
Before this commit, when a planner made a link from an action, the view_type was always 'list'
This prevented the view from being properly loaded, as an action of view_type form wouldn't be recognized

After this commit, such links are well formed, and form view_type actions are correctly loaded

OPW 806758
2018-02-12 11:05:30 +01:00
Christophe Simonis 851c29ce0e [MERGE] forward port branch 10.0 up to 0351677a00 2018-02-12 10:52:34 +01:00
Géry Debongnie e0cb522bf2 [FIX] web: update form widgets when state has changed
Since the <widget> tag is not used anymore in any of our views, it was
not really properly supported. In particular, the form widget was not
notified when the state of the form view has changed, which makes it
very difficult to actually do any useful work.

With this commit, we make sure that the widget method 'updateState' (if
it exists) is called with the new state whenever it changed.

This should allow developers to do useful work without having to work
around the issue. Note that this is not really a perfect solution, since
the updateState methot may or may not have been implemented.

I think that we need some kind of ViewWidget abstraction, which could be
used to have a better and more complete API for widgets in a basic view.
And AbstractField could inherit from ViewWidget.
2018-02-12 10:35:54 +01:00
Raphael Collet 107b82f6e1 [IMP] clean up use of cursors in tests 2018-02-12 10:31:59 +01:00
Raphael Collet 7ea4f13f16 [REF] tests: TestCursor is now a proxy to a real Cursor
This allows rpc requests in `HttpCase` to use the cursor `self.cr`, which is
now shared between the Python test and the rpc requests.  This simplifies code
to prepare a JS test, and code to check the result of a JS tour.

Fixes #12237
2018-02-12 10:31:59 +01:00
Raphael Collet 9e6bc391be [FIX] stock: workaround to make dp work in tests 2018-02-12 10:28:59 +01:00
Rémi Rahir 8b9bcf1b7e [FIX] crm_phone_validation: fix lead phone validation
Fixes country_id and company_id mismatch in 65832dc.

Removes the view added by said commit as it was not a true stable
fix since it required users to update the module.

This commit uses a workaround to get the missing company_id field
which is monkey-patching the fields_view_get of the model, as
suggested by rco.

This commit also removes the exception catches that were rendered
useless by the False value given to the raise_exception parameter
of phone_format, introduced in 65832dc as well.

This commits fixes the behaviour in the website form as the phone
numbers were sanitized but never saved as such on their record.

This commit also renames the Phone Validation config setting to
suit its true functionality.
2018-02-12 09:16:17 +01:00
Barad Mahendra 459a53ddb5 [IMP] crm: Remove 'To Close Today' and 'To Close This Week' filters
Purpose
=======

They make no sense, expected closing is just a guess.
2018-02-12 07:53:02 +01:00
dbh 6666bc9f75 [IMP] crm: show currency symbol in lead quick create form
The monetary widget is missing on the view
2018-02-12 07:52:23 +01:00
Odoo Translation Bot 09923c7bf6 [I18N] Update translation terms from Transifex 2018-02-11 07:05:39 +01:00
Odoo Translation Bot 26468bfaba [I18N] Update translation terms from Transifex 2018-02-11 04:26:28 +01:00
Odoo Translation Bot 0351677a00 [I18N] Update translation terms from Transifex 2018-02-11 00:48:18 +01:00
Olivier Dony b8c8a5aef8 [FIX] l10n_fr_hr_payroll: adapt terminology for simplified payslip
Partial adaptation of terminology for simplified french payslips.
A thorough review of the current payslip is necessary and planned.

Cfr. https://www.economie.gouv.fr/entreprises/nouveau-bulletin-paie

OPW-805984
2018-02-09 18:20:57 +01:00
qdp-odoo 2aabdc00c3 [FIX] account: allow XML-RPC call to action_validate_invoice_payment on account.payment.
The method was returning no value (~None) which then blown up when serialised back to XMLRPC. Fixes #22630
2018-02-09 17:29:56 +01:00
Thibault Delavallée adea9fa6cb [IMP] mail: remove commented code
Leftover of last commit due to wrong push. My bad.
2018-02-09 16:48:08 +01:00
Thibault Delavallée e899812315 [REF] mail: reduce query count to create activities by making activity_date_deadline not stored
Activity mixin adds an activity_date_deadline field that is a related on
activity_ids. This one is a o2m using a domain based on the current record
model. Indeed activities are cross-model, like mail.message.

However as it is stored it generates are a lot of unnecessary computation
when activities are updated. Indeed when activities change the related
computation is triggered for every model inheriting from the activity
mixin. It then applies the domain in order to find record to update. This
generates a lot of void queries because only one will match the activity
model.

This commit makes the field not stored anymore. Indeed it is used mainly
in filters. Same functional result can be achieved using a computed and
searchable field.

We gain a lot of queries when creating activities as indicated by the
counter update in this commit. Creating a record inheriting from activity
mixin is a bit improved since there is less computed field to compute.
Creating an activity costs a lot less queries and we gain about 40%
in term of query required to create an activity when a lot of models are
using the mixin.

On community runbot it makes a gain of 2% when installing all modules.
This commit allows to save 13K queries on 587K (current) which is quite
good.
2018-02-09 16:45:36 +01:00
Christophe Simonis 5f3301e5cb [MERGE] forward port branch 11.0 up to 20e4cd5bcd 2018-02-09 16:13:08 +01:00
Aaron Bohy 20e4cd5bcd [FIX] web: field widget with readonly modifier
Rev. dbdd742 introduced the 'baseMode' parameter of field's nodes
in the BasicRenderer. Its purpose is to encode the generic mode
of the field, regardless of its readonly modifier (i.e. in form
views, the baseMode of all fields is the mode of the renderer and
in list views, the baseMode of all fields is 'readonly', except for
fields in the row being edited, whose baseMode is 'edit').

Unfortunately, when the value of the readonly modifier of a field
was 'readonly', its baseMode was changed from 'edit' to 'readonly',
which shouldn't, as the baseMode's value should not be affected by
the modifiers.

This produced a bug when a field had a readonly modifier, as once
its value became true, the field was rendered in 'readonly', and
whatever the value of the modifier afterwards, it always remained
in 'readonly'.

The rev. ensures that the baseMode is no longer impacted by the
value of the readonly modifier.

Closes #22729
2018-02-09 15:36:14 +01:00
Christophe Simonis 4b43803dc6 [MERGE] forward port branch saas-16 up to e2ae51c4b0 2018-02-09 15:02:31 +01:00
Lucas Perais (lpe) 89c63096cb [FIX] point_of_sale: aml from pos.order.line should have their tax group and children
Having a product on which a group of taxes apply (containing children taxes, obviously)
Make a sale
Validate the entries

Before this commit, the account_move_line created from the pos.order.line
had only the group of taxes as their tax_ids
Which is inconsistent against what account.invoice do,
and against what the generic report tax does

After this commit, we imitate what happens on invoices, and the movel line
created from the pos.order.line has the children of the group and the group as tax_ids

OPW 806089
2018-02-09 14:46:14 +01:00
Lucas Perais (lpe) e67d6f85c3 [FIX] account: event on onFilterChange
Before this commit, on the reconciliation widget in Firefox
filtering lines through the input triggered a Traceback
This was due to the use of the absence of a defined "event" parameter on the handler

After this commit, filtering does work as expected

opw 813791
2018-02-09 14:42:57 +01:00
Christophe Simonis e2ae51c4b0 [MERGE] forward port branch saas-15 up to 6d0f63ec4e 2018-02-09 12:41:15 +01:00
Christophe Simonis 6d0f63ec4e [MERGE] forward port branch saas-14 up to 9b2d3b19a6 2018-02-09 12:40:16 +01:00
Christophe Simonis 9b2d3b19a6 [MERGE] forward port branch 10.0 up to df3fb9f85a 2018-02-09 12:39:43 +01:00
Christophe Simonis 5cf12bfba4 [FIX] sale_timesheet: extract theoritical revenue values computation
This allow easier potential overwrite and ease migration.
2018-02-09 11:55:08 +01:00
Jeremy Kersten df3fb9f85a [FIX] calendar: fix partners_to_notify to have flat list of ids
Before this commit, user see a traceback:
(res_users.partner_id in (3,ARRA.. ...
operator does not exist: integer = integer[]

After update from initial commit
After append from commit 1bb74b7588
Now,  extend to allow [1].extend([2,3])

This commit closes #22944

Courtesy of @paulius-sladkevicius for reporting
2018-02-09 10:54:54 +01:00
qdp-odoo 4a3df5256a [FIX] *: fixed decorators on copy() 2018-02-09 10:32:23 +01:00
William Henrotin 6718de5393 [FIX] i18n: correct two traduction in tax names 2018-02-09 10:00:18 +01:00
mreficent aac8f9730e [FIX] base: on_change_country() on res.company should return an ID
Previously, the return value was sometimes an int and sometimes a browse record.
Was PR #22810. Courtesy of Miquel Raïch (Eficent)
2018-02-09 09:53:57 +01:00
jpr-odoo cfef0ad480 [IMP] expense: Highlight 'Submit to Manager' when there's an attachment
Purpose
=======

Only highlight the button when there's an attachment on the expense.
2018-02-09 07:31:38 +01:00
jpr-odoo ba892f7811 [IMP] hr_expense: Add 'Activities' on expenses
Add the "log activity" in the expense/report chatter
2018-02-09 07:01:02 +01:00
jpr-odoo 60d50dc0ec [IMP] hr_expense: Add an 'Attach Document' action button on expenses
Purpose
=======

Ease the process to add receipt from the mobile app

Specification
=============

Add an "Attach Document" action button.

On mobile, it should open the camera app + have a link to choose a photo from the gallery
2018-02-09 06:59:56 +01:00
jpr-odoo b7aa439826 [ADD] web: Add a new widget to attach documents on a record
Purpose
=======

Add the possibility to easily attach a document on a record. That could be used for to attach receipts on expense for example.

Specification
=============

Add a new widget (AttachDocument) to allow attach document from mobile/web directly on record form

After attaching document it will call action given on widget, that action will be a method name on given model
2018-02-09 06:59:56 +01:00
Christophe Simonis 047796817c [MERGE] forward port branch saas-14 up to 3a1df2cf22 2018-02-08 18:08:52 +01:00
Christophe Simonis 3a1df2cf22 [MERGE] forward port branch 10.0 up to 1b5ecbb047 2018-02-08 17:30:08 +01:00
Christophe Simonis 1b5ecbb047 [MERGE] forward port branch 9.0 up to ce51ad7e69 2018-02-08 16:43:44 +01:00
Christophe Matthieu 715e602bf0 [IMP] web: use patch for object in tests to avoid edge effects 2018-02-08 15:46:41 +01:00
Christophe Matthieu 3b2127c690 [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:46:41 +01:00
Christophe Matthieu 3b9dda6106 [FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
2018-02-08 15:46:41 +01:00
Christophe Matthieu d288b33648 [IMP] web: use patch for object in tests to avoid edge effects 2018-02-08 15:46:00 +01:00
Christophe Matthieu 1d49d52b3a [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:46:00 +01:00
Christophe Matthieu b28ceec009 [FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
2018-02-08 15:46:00 +01:00
Christophe Matthieu 4f5fc6ee55 [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:45:30 +01:00
Christophe Matthieu 83795d37f3 [FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
2018-02-08 15:45:30 +01:00
Simon Lejeune 625a648f22 [FIX] stock, mrp: untracked quants and unreservation
- create a product comp1 tracked by lot
- make an inventory adjustment for comp1 ; 1 quant with lot1 and 1 quant
  without lot
- create a bom for product finished1 composed by 1 comp1
- create a mo for 1 finished1, reserve it
- the mo reserved the quant with lot1
- produce finished 1
- unlock the mo
- change the component from lot1 to lot2 (that do not exist)
- the write on a move line will trigger a re-reservation that will
  fallback on the quant without a lot (that's how untracked quant for
  tracked products are handled)
- delete the move line, it'll unreserve with lot2 and fail

We fix the issue by applying the same logic of fallback on the untracked
quants in the unreserve of a move line.

We add a test for the unreserve of a move, as it simply unlink the move
lines.

opw-814914
2018-02-08 12:58:47 +01:00