Commit Graph
133 Commits
Author SHA1 Message Date
04c44c479d [IMP] base(_import),web: mute Add/Create button in x2m
... by setting it 'btn-default', because users hesitate between
that button, and those in the control panel.

Task 32950

Co-authored-by: dbh <dbh@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2018-04-25 15:09:35 +02:00
qsm-odoo fbfd011904 [REF] *: get rid of introduced @​extend
During first scss convertion, classes called as mixins were changed to
an @​extend instruction which was the best approximation given the fact
there is no equivalent in sass to do that. The problem is that the
instruction is slowing the scss computation a lot and might also break
the style in unexpected ways because of the complex unwanted selectors
the instruction induces.

This commit removes the need of extends. This is done case per case.
Sometimes this involves adding classes in xml, sometimes to change the
style a little, ... The button rendering refactoring which was made
at the start of the LESS to SASS merge was also done in prevision of
this.

After this commit, sass computation is like 5-6 times faster than less
computation while it was like 10 times *slower* before this commit.
2018-04-18 15:59:18 +02:00
qsm-odoo 97aa0a8dec [REF] *: convert less content to scss content
Convert content so that the assets compile on app installation. The
style is still broken after this as the variables/mixins/... are not
defined in the right order (as it did not matter in LESS but does in
SCSS).

This commit basically changes:
- Variables: @​var_hello -> $var-hello
- Mixins: .mixin_world() {} -> @​mixin mixin-world {}
- Classes used as mixin: .my_class() -> @​extend .my_class
    - Here there were no other solution than to convert the use of
      a mixin call by the use of an extend as a first approximation
- LESS functions -> SCSS functions (e.g. fade -> rgba)
- Move first variable definition before the variable is used
    - Still need to make sure last variable definition is at the
      right place
2018-04-18 15:59:16 +02:00
qsm-odoo b04dec4025 [REF] *: rename all LESS files to SCSS
This is a simple renaming without adaptation.
2018-04-18 15:59:15 +02:00
Christophe Simonis 74033eb007 [MERGE] forward port branch saas-11.2 up to 90f8f17fb4 2018-04-16 19:50:50 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +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
Géry Debongnie b17ba359db [REF] web,*: introduce the concept of AbstractAction
Before this commit, a client action was simply a subclass of Widget.
This is quite simple, but not really enough for the ActionManager. The
ActionManager needs to handle client actions in a different way that
view actions. Sometimes, it needs to check if a method exists before
calling it.

With this commit, we introduce a new abstraction: the AbstractAction
class, which defines a common API for all actions managed by the web
client.

Note that the API proposed in this commit is just the beginning. We will
introduce other methods in the future, to manage the focus, or the
scroll position, for example.
2018-03-08 16:48:54 +01:00
Christophe Simonis eefca5d492 [MERGE] forward port branch saas-11.1 up to 73610ff992 2018-02-05 16:20:48 +01:00
Christophe Simonis 33bf2fe922 [MERGE] forward port branch 11.0 up to aed8f45346 2018-02-05 15:06:55 +01:00
Martin Trigaux 56a25e5f0c [FIX] base_import: translate column name
The labels of the imported columns were untranslated, displaying the name of
the field in English

opw-813996
Fixes #22703
Closes #22717
2018-02-02 10:16:38 +01:00
Aaron Bohy 32b8cec536 [REF] web,*: ActionManager/ViewManager refactoring
This rev. is the first part (out of 3) of the refactoring of the
ActionManager and ViewManager layer of the webclient.

The main changes are:
  - there is no ViewManager anymore, its work is now handled by the
    ActionManager itself, but isolated in a specific file ; this
    eases a lot of things, as the breadcrumbs handling for example.
  - the ActionManager code is converted to the new coding principles
    and guidelines ; mainly, children widgets communicate with it by
    triggering events up, and not by function calls anymore.
  - the ActionManager layer is now testable, and a lot of tests have
    already been written.
  - the code in other addons has been adapted consequently.

What's coming next:
  - introduce the 'AbstractAction' Widget, and make client actions
    and view controllers inherit from it ; this widget will
    implement a common API that could be used uniformly by the
    ActionManager (e.g. restore(), canBeLeft(), renderButtons(),
    getTitle()...).
  - move the ControlPanel handling from the ActionManager to the
    AbstractAction.
2018-01-16 20:49:19 +01:00
Christophe Simonis 55b810dc70 [MERGE] forward port branch saas-11.1 up to 726b91b9fb 2018-01-03 14:05:48 +01:00
Aaron Bohy 7f467d2346 [FIX] base_import: don't reload twice when leaving
The 'on_reverse_breadcrumbs' option of do_action() allows to
define an handler to execute when coming back to the previous
action by clicking on the breadcrumbs.

This option was set when executing the Import client action, to
ensure that the previous view was reloaded when the client action
was left. However, the view to restore is always reloaded, so
specifying the option in this case produces a double reload.
2017-12-15 13:07:34 +01:00
Christophe Simonis 4708812b6c [MERGE] forward port branch 11.0 up to b37cc1f9b7 2017-12-12 18:50:59 +01:00
Miquel Raïch a578531ca3 [FIX] v11 urls
Was still pointing to old links

Closes #21590
2017-12-12 17:19:01 +01:00
Nicolas Seinlet 68cb2ade09 [IMP] base_import: defer parent store
Makes possible to choose `defer_parent_store_computation` in UI.

Closes #21320
2017-12-12 12:05:51 +01:00
Rohan Patel e2342a562d [IMP, ADD] base_import,account,...: Provide import templates to ease the import process
PURPOSE
=======

Provide import templates to ease the import process

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

SPECIFICATION
==============

1/ Add specific templates to import screens: e.g. for product.template, res.partner and bank statements

2/ Replace import files suggested in planners (sales & website) by those ones.

3/ Add import template to bank statement import wizard for CSV, OFX, QIF and CODA files
2017-10-24 10:37:35 +02:00
Akash Bhavsar 049cf42639 [IMP] base_import: improve import action
- Rename "Validate" button to "Test Import"
- unmatched columns are marked in red
- better column matching (show suggestions of the char field even if the imported values are of int type)

PR  #16881, close task 32894
2017-05-23 10:00:48 +02:00
Mehul Patel 47305199a8 [FIX] base_import: fix broken rpc calls
PR #16762
2017-05-05 12:55:55 +02:00
Géry Debongnie 03fabb0c4a [REF] base_import: split import button code out of action 2017-04-11 19:44:38 +02:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly.  This commit introduces the new rpc
system, which replace the previous new one.  We now simply have a
method, this._rpc, which takes a dictionary of parameters.  The idea is
that depending on the parameters, it is able to add correct default
value when necessary.

For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
2017-04-11 19:44:38 +02:00
Christophe Matthieu eaa66d1156 [REF] web: change internal representation of fields and view meta datas
* Data manager load_view returns a viewInfo object
* ViewInfo contains: the arch, fields and fieldsInfo objects, and some extra informations
* The fields come from the server and are frozen, without any view attributes (depend of the model).
* The fieldsInfo contains every view attributes and informations.
2017-04-11 19:44:38 +02:00
Aaron Bohy d2f6e705a0 [IMP] base_import,web: enable 'Import' feature in Kanban
Applies commit odoo/odoo@dba53fb117 in the new views.

The import feature was only available in List views before this
commit.
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
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 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Siddharth Gajjar dba53fb117 [IMP] base_import: show import button on kanban view.
PURPOSE
=======

Import button in list view only, its confusing for first time user.
When people start using Odoo first thing they try to import contacts or products.

Specificaion
============

Import button should be display in kanban view also
2017-03-09 12:09:09 +01:00
joe1981alAPR 286aecea7c [ADD] base_import: allow to import XLSM file types in open dialog
XLSM are parsed as MS Office Excel files using xlrd

Closes #14137
2016-12-07 16:10:15 +01:00
Haresh Shyara 1ba4fbe640 [IMP] base_import: Improve import preview for related fields
normal mode: Importing only regular/basic fields from source file
advanced mode: Importing any related fields from source file(i.e. if detected pattern in header like '<relational_fieldname>/<fname>')

- Rename following checkbox "Show all fields for completion (advanced)" in "Show fields of relation fields (advanced)"
- If the import file contains a column with a field of a relation field, show the column label in the preview, even if "Show fields of relation fields (advanced)" is not checked > to make it less confusing when importing advanced files (e.g. products with attributes)
2016-11-10 09:44:20 +01:00
Jeremy Kersten c73f7ce358 [FIX] base_import: typo in url for help
This commit closes #13903
2016-10-20 10:44:09 +02:00
Jeremy Kersten 7a7723eacf [FIX] base_import: allow to specify datetime format, fix encoding, add test date, fix translation
After this commit,
 - chinese custom date are supported
 - Possibility to specify the custom datetime format and not only dateformat.
   Withtout it, impossible to import a date column and datetime column at
   sametime with custom format.
 - Add test to check import date with custom format
 - Fix translation where error messages was in the source.

This commit fixes #13783 and closes #13803

Courtesy of @odony for the review ;)
2016-10-14 12:36:04 +02:00
Olivier Dony 2054337199 [FIX] base_import: spellchecking in import dialog options
Excel uses "Text Qualifier" while LibreOffice uses
"Text Delimiter". The latter seems more intuitive.
2016-10-14 11:53:45 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Christophe Simonis 3a2147d95c [MERGE] forward port branch saas-10 up to bc1a0a3 2016-08-20 16:57:36 +02:00
Nicolas Martinelli 717ca3390f [FIX] base_import: error message
During the import of a file, if the connection is closed (timeout,
server shutdown...), a traceback appears.

This is because `error.data.arguments` is not defined in this case.

opw-682104
2016-08-17 11:43:17 +02:00
Hitesh Trivedi cf3e8324f1 [MOV] base_import: module directory organization
Note: move test models file in models to not import tests
directory, which breaks the mute_logger of test cases
2016-07-07 14:44:10 +02:00
Cedric Snauwaert 2f3b32c676 [FIX] base_import: fix error when trying to load a file and then clicking on cancel while file opener is opened 2016-07-01 16:57:27 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis bfbe2d6e6d [MERGE] forward port of branch saas-6 up to df95b1f
The changes in `l10n_es` [1] have been ignored. They will be ported to
the new accouting later.

[1] See 730890f369 and e3e5cfe82c
2016-06-14 19:22:21 +02:00
Olivier Dony 285deb9a14 [FIX] base_import: handle other cases of wrong CVS mime types
Improves 8049d1e855 for other detected
cases, e.g. on Firefox + OSX.

opw-680347
2016-06-14 12:35:59 +02:00
Christophe Simonis e35b57d6f5 [MERGE] forward port of branch 8.0 up to 26b3501
# Conflicts:
#	addons/procurement/procurement.py
2016-06-10 12:23:34 +02:00
Nicolas Martinelli 8049d1e855 [FIX] base_import: file type on Windows
When a user imports a CSV file on Windows, the "CSV Format Options…"
field does not appear. This is an issue since it might be necessary to
tune these options depending on the file, e.g. change the encoding.

For some unknown reason, on Windows, the file type is empty whatever the
browser used. Therefore, we fall back on the extension of the file.

opw-680347
2016-06-09 15:09:22 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Martin Trigaux f307e36e66 [FIX] base_import: disable tracking during validation
Force the value tracking_disable to be make sure that the validation (which is
supposed to have no impact), will not send any email.

Fixes #3173
2016-06-08 11:37:03 +02:00
Xudong Yang f558c049d0 [FIX] base_import: t-if does not work with t-jquery
Not evaluated, move the condition to the button
Closes #12230
2016-06-02 17:56:23 +02:00
Cedric Snauwaert 841f208b22 [REF] base_import: simplify import by reducing choice for the columns based on heuristic
automatically try to detect type of columns from the first 10 rows of file:
If column only contains integer, only show, int, float, monetary, m2o, o2m, m2m fields in wizard
If column only contains true/false values, only show boolean fields in wizard
etc

add an advanced mode which is the same as previous import (show all fields)

Support different date format and float value with currency as well as float value with parenthesis to reprensent negative value.
2016-04-07 09:42:23 +02:00
Xavier Morel d1dea6119f [IMP] base_import: add FAQ entry about CSV date formats
task 21446
2015-12-18 14:42:54 +01:00
Xavier Morel cea29e0c01 [ADD] client-side CSRF support
* add CSRF token as core.csrf_token
* add CSRF tokens to client-generated and/or JS-submitted forms
* remove broken "compatibility" mode of web.ajax.post

  /cc @dmo-odoo I've no idea how that was supposed to work, from looking
  things up all modern browsers seem to support FormData, and old IEs
  which don't don't support fallbacks either and would require
  submitting an actual form as fallback so...
2015-10-01 01:36:50 +02:00
Xavier Morel f5a1693f06 [ADD] base_import: support for XLS and ODS files
* added intermediate ``_read_file`` step dispatching between CSV, ODS
  and XLS(X) parsing
  - primary dispatch on mime type, secondary on file extension:
    + OS may not provide a relevant mime type if no software locally
      installed for the filetype (e.g. Windows sends excel files as
      application/octet-stream if excel is not installed, and ODS files as
      zip if OpenOffice/LibreOffice isn't installed)
    + applications may re-register extensions to non-standard mimetypes
      breaking the dispatcher

    So if the mimetype is found trust it, otherwise try with the
    filename's extension (if any)
  - all readers skip lines with only empty cells in their output
  - ODS and XLS content are "CSVified", rows are converted to arrays of
    unicode strings
* UI altered to not assume CSV files everywhere, and avoid returning
  garbage preview data for non-CSV imports

Various:
* added a ``can_import`` utility function to tests.common, can be used
  to skip tests if an optional Python dependency is not installed (but
  one would like tests to run if the dependency is available)
* fixed datetime issue in ir_fields
* added converter for monetary fields (iso float)
* spreadsheet don't have integers, twiddling required to ensure integral
  values won't be serialized as floats (breaking conversion back to
  Python)
* improved some tests by asserting no error is generated (bonus: logs
  the error message if there is one, rather than just saying the result
  is blown)
* because some systems only provide elderly versions of
  XLRD (e.g. current debian stable provides 0.9.2 from April 2013)
  - keep using xldate_as_tuple instead of 0.9.3's xldate_as_datetime,
    workaround is simple
  - check for xlrd.xlsx in case of pre-0.8 XLRD

Authorship:
Ronak Baxi <rba@odoo.com>
Mohammed Shekha <msh@openerp.com>

Task 10792
Closes #7285
2015-08-26 16:50:09 +02:00