Commit Graph
108743 Commits
Author SHA1 Message Date
Aaron Bohy cbfdc36ad0 [REF] account_asset,sale: invisible attr in form view
When the invisible attr doesn't need to be evaluated (e.g. = "1"),
it is better not to specify it within the attrs as they are
automacally re-evaluted at each field changed.

We directly write "invisible=1" instead.

The JS framework supports both, but we encourage the later one.
2017-04-11 19:44:38 +02:00
Christophe Matthieu 53e4765765 [FIX] web: catch image in unit test and convert into performRPC
avoid image not found error in console
2017-04-11 19:44:38 +02:00
Christophe Matthieu 04f1e50ff3 [FIX] web: date value must be parsed to moment object 2017-04-11 19:44:38 +02:00
Christophe Matthieu a9475e14af [FIX] web: basic_model: try to call name_search without name value 2017-04-11 19:44:38 +02:00
Christophe Matthieu ed9f34018a [IMP] account: usability of bank statement reconciliation widget
* add a link to create bank reconciliation model if none is defined yet
2017-04-11 19:44:38 +02:00
Christophe Matthieu 09731b7860 [IMP] calendar change view grammar.
* Remove filter tag
* Use color attribute on the view who add a filter/legend
* Filter is automatically added when 'avatar_field' option is used on a
field tag, and the default template display the avatar.
* Can overwrite the template (add tag template who contains qweb with
<t t-name="calendar-box">...</t>
2017-04-11 19:44:38 +02:00
Aaron Bohy bf320d2a0d [REF] web_tour: use rpc.query helper
+ linting pass
2017-04-11 19:44:38 +02:00
Géry Debongnie 25fecd932a [REF] web, *: remove calls to performmodelrpc
The this.performModelRPc method is deprecated, so with this commit, we
remove some calls.
2017-04-11 19:44:38 +02:00
Aaron Bohy 47ec89d7fa [FIX] point_of_sale: missing return 2017-04-11 19:44:38 +02:00
Géry Debongnie d6089b6b69 [FIX] website_sale_wishlist: remove use of Model
The new way of doing rpc is through the rpc function, the web.Model
module is deprecated, so we need to update all calls.
2017-04-11 19:44:38 +02:00
qsm-odoo 5804ed100e [IMP] web, *: compute contexts and domains from datapoint
This commit tries to refactore the management of contexts and domains
in the webclient.

- Get rid of CompoundDomain: use standard array manipulation to
join multiple domains or use the Domain class (to be improved)
- Get rid of data.js build_domain and build_context methods
- Link this.record to the data point from the basic model for all
fields (not only relational fields)
- Add a getContext and a getDomain function to the basic model
data point (localData element) so that AbstractField implementations
can use them thanks to their this.record element.
- Remove the autocontext binding for field RPCs (see FieldManagerMixin)
2017-04-11 19:44:38 +02:00
Géry Debongnie e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
2017-04-11 19:44:38 +02:00
Géry Debongnie 0df9968433 [ADD] web: introduce new RPC framework
With this commit, we introduce a new way to perform a RPC.  During the
history of the Odoo web client, many ways to do a rpc have been
introduced, for various reasons.  Let us mention the Model class (to
perform a call on a specific method from a model, the web.ajax module
(low level primitive), the dataset.call method, the this.rpc method (was
removed at some point), the session.rpc method and maybe some others.

With this commit, we reintroduce the this.rpc method, with  a
'mid-level'  API: not really high level (not automatic domain/context
calculations), but still higher level than direct web.ajax calls.

This new method is intended to replace all other RPCs in Odoo web
client.  Of course, web.ajax will still be available, but it is
discouraged to use it directly.  Using the rpc method means that the
rpcs are done through an event bubbling up, which means that the call is
testable.
2017-04-11 19:44:38 +02:00
Aaron Bohy 00a172b40d [FIX] web: adapt 1a9a082d to new fields 2017-04-11 19:44:38 +02:00
Aaron Bohy 722cb7cd83 [FIX] web: priority widget
Widget has been broken by a rebase, making its test fail.
2017-04-11 19:44:38 +02:00
Aaron Bohy 2e540eb3c1 [FIX] *: apply changes from web_studio
The new views and widgets (at least some of them) first landed
in web_studio (v10), and they we moved later to web, so changes
in web_studio need to be applied in web.
2017-04-11 19:44:38 +02:00
Aaron Bohy 8d2336abb3 [FIX] web: default_get on x2many may return a list of ids 2017-04-11 19:44:38 +02:00
Aaron Bohy 928af2b51f [IMP] web: ajax service: ensure widget is alive
... before resolving/rejecting the deferred once the RPC is done.
Doing this in the ajax service is equal to wrap every rpc with
this.alive() in the former versions.
2017-04-11 19:44:38 +02:00
Aaron Bohy 979d82abe8 [FIX] report: use this.performRPC 2017-04-11 19:44:38 +02:00
Aaron Bohy 5a604cde53 [FIX] web: typo in the event data
With this commit, the handler to call after a do_execute_action
is now correctly executed.
2017-04-11 19:44:38 +02:00
Aaron Bohy d97c50148b [REF] web: less: form view's statusbar
Move the statusbar rules to community as both webclient now
share the same js basecode for the statusbar.
2017-04-11 19:44:38 +02:00
Aaron Bohy 39ac2dd9bf [FIX] sale: adapt sale tour to new views 2017-04-11 19:44:38 +02:00
Aaron Bohy b1bba768f2 [FIX] web: correctly apply changes on relational fields
The relational record may contain relational fields as well.
2017-04-11 19:44:38 +02:00
Aaron Bohy 95c33aee1c [REF] web: add fixme note 2017-04-11 19:44:38 +02:00
Aaron Bohy 362dea675a [REF] test_new_api: convert widget_x2many tour 2017-04-11 19:44:38 +02:00
Géry Debongnie e357e26735 [FIX] web: fix FieldDate widget default value
The FieldDate widget did not properly select the correct default value
when opening the datepicker.  We did not notice it, because the test
hardcoded the february month.
2017-04-11 19:44:38 +02:00
Aaron Bohy 60a518dcce [REF] web: add name attribute on field widgets 2017-04-11 19:44:38 +02:00
Géry Debongnie 206453c836 [FIX] web: various fixes with one2many/formviewdialogs
We share the basic model record between views, and we have to make sure
that everything is properly coordinated.  The main issue solved by this
commit is the fact that we can now edit a one2many record, then close
the dialog, then edit it again and finally cancel the changes, which
bring us to the previous step.

Also, we had to slightly improve the AbstractView API
2017-04-11 19:44:38 +02:00
Aaron Bohy f79399bf77 [FIX] web: parse date(time) values after onchange
Date and Datetime values are stored as moment instances, not
strings. This wasn't the case after an onchange, and it thus
produced a crash as we tried to call the format method on a string.
2017-04-11 19:44:38 +02:00
Aaron Bohy 2bd4497b49 [FIX] web: apply onchange even if warning
The onchange route returns field values, but it can also return
a warning, that needs to be displayed in a dialog. When it does,
the new values must be applied anyway, which wasn't the case
before this rev.

We generalized the 'warning' custom event handled by the webclient
so that it can display a warning in a dialog (and not only through
the NotificationManager).
2017-04-11 19:44:38 +02:00
Aaron Bohy 1163bab5c6 [FIX] report: this.session is undefined
It is now available with the Service mixin via this.getSession().
2017-04-11 19:44:38 +02:00
Aaron Bohy 9b14290b2a [FIX] web: execute WebSuite tests post install
So that tests written in addons are executed as well.
2017-04-11 19:44:38 +02:00
Aaron Bohy 52d88e77d4 [FIX] account: don't use Math.sign which is ES6 2017-04-11 19:44:38 +02:00
Aaron Bohy abce447401 [FIX] mail: use _.str.startsWith (startsWith is ES6) 2017-04-11 19:44:38 +02:00
Géry Debongnie d7eb116fa8 [FIX] web: properly compute contexts in some cases
When we have a many2one widget in a one2many, editable, the context was
not properly computed: it expected the parent to be a record object, but
in that case, it is a list object.
2017-04-11 19:44:38 +02:00
Christophe Matthieu 7465798ccd [FIX] web: field_utils date
* list view must use stringtify value for py eval comparaison
* use utc to parse database value (avoid timezone error)
2017-04-11 19:44:38 +02:00
qsm-odoo b34279c89a [IMP] web, *: let kanban column and record know about modelName
* hr_attendance, hr_gamification, hr_recruitment, mass_mailing,
  project, sales_team

Before this commit, the kanban column did not know about the model
name which make customization impossible without a getParent. Kanban
records were supposed to know about this thanks to the options
parameter but this was broken. Now the model name is automatically
initialized from the given state.

Adapt all extensions which relied on this.
2017-04-11 19:44:38 +02:00
qsm-odoo c08aa7f9b3 [FIX] web: KanbanColumn start() was not returning a deferred 2017-04-11 19:44:38 +02:00
qsm-odoo 19e86c8388 [IMP] *: remove deprecated view extensions
* account, mass_mailing, sales_team

These view extensions have already been ignored for around two years.
The new views development is a great opportunity to remove them.
2017-04-11 19:44:38 +02:00
qsm-odoo 41162190a6 [IMP] web: lint the pyeval.js file 2017-04-11 19:44:38 +02:00
Aaron Bohy e07f27d45e [FIX] web: kanban: conditions on relational fields
This commit aims to correctly fill in the raw_value of each
field in the qweb_context use to render the kanban templates.
For relational fields, the absence of value should be false,
instead of an empty array. Moreover, the Many2One case is
different from the x2Many cases as in the first case the
datapoint is a record, and it the last ones it is a list.
2017-04-11 19:44:38 +02:00
Aaron Bohy a1f4fe8616 [FIX] web: basic_model: no res_id on new records
We remove the res_id when exporting new records, as it is
meaningless outside the model (it's like "virtual_something").
This fixes a bug as the button box is now correctly hidden in
'create' mode.
2017-04-11 19:44:38 +02:00
Aaron Bohy 95cbf1d37b [FIX] web: list_editable_renderer: don't instantiate widgets twice
In an editable list view, if there was a readonly field in the table,
positionned before editable fields, clicking on that readonly field
resulted in the editable field widgets being re-instantiated and
appended to the DOM (so there were several widgets per fields/cells).
2017-04-11 19:44:38 +02:00
Aaron Bohy b997309cf6 [FIX] web: abstract_view: don't override shared config variable
The method 'setController' allows to change the default Controller
Widget used by the view. However, before this fix, calling it
changed the default Controller of all other Controller instances.
2017-04-11 19:44:38 +02:00
Aaron Bohy 386820abbe [FIX] web: basic_model: apply onchanges on many2many fields
Before this commit, the many2many fields were handled like basic
fields, which is obviously wrong.
2017-04-11 19:44:38 +02:00
Géry Debongnie 1a0702f1e2 [FIX] web: properly handles dirty data in form views
Before this commit, we only consider the BasicModel point of view to
determine if a record is dirty.  It is good when we want to determine if
it is actually necessary to save the data, but not correct when we want
to know if some changes can be discarded.

With this commit, the form controller keeps track of its 'dirty' state,
coming from user interactions.  It uses this flag to determine if
changes can be discarded.
2017-04-11 19:44:38 +02:00
Martin Geubelle 4d12ec87bc [ADD] web: StandaloneFieldManagerMixin
This mixin is meant to be used by widgets that instanciate
standalone field widgets.
2017-04-11 19:44:38 +02:00
Géry Debongnie dde1223a14 [REF] *: remove manualDestroy options for tests
With the new JS test framework, we had experimented with an autodestroy
feature, meaning that all views/widgets are automatically destroyed
after a while.  By default, it was 50ms, because we could not hook some
code to run after the end of the current test.

For various reasons, this was not a good idea: some side effects, such
as modifications of the session or of the DOM (with modals) could
interfere with other tests.  This commit disable the feature.

From now on, we will have to destroy each widgets created in a test.
2017-04-11 19:44:38 +02:00
Géry Debongnie 086a04fdec [FIX] web: avoid calling getContext twice
Also, slightly improve the style...
2017-04-11 19:44:38 +02:00
Géry Debongnie ecceee639e [FIX] web: formview dialog can now properly evaluate context
For this change, I had to pass the handle to the parent datapoint all
the way from the controller to the new form view.
2017-04-11 19:44:38 +02:00