Commit Graph
3175 Commits
Author SHA1 Message Date
Aaron Bohy 39ab5712ed [FIX] test_new_api: enable deactivated steps of x2many tour
Those steps had been deactivated because the onchanges didn't
work well back then. Now, everything that is tested by the tour
works fine, so we can re-enable it entirely.
2017-04-11 19:44:38 +02:00
Aaron Bohy 97b4da489d [FIX] test_new_api: adapt tour to new onchange semantics
Onchanges triggered in a relational fields are now directly
triggered on the main form view as well. This was not the case
before and there were some steps (or parts of steps) checking
that.
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 362dea675a [REF] test_new_api: convert widget_x2many tour 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
Xavier Morel f1168d06c0 [#8530] fix octal literals (and remove unwittingly octals)
For readability and coherence, in Python 3 the prefix for octal
literal becomes ``0o`` (rather than just ``0``). This new version was
also added to Python 2 as of 2.6.

Convert all octal literals in file-manipulation code (POSIX ACL), and
fix a few integers which were unwittingly octal.

(lib2to3.fixes.fix_numliterals)
2017-04-11 17:29:18 +02:00
Xavier Morel 0b3ea57e61 [#8530] remove uses of tuple parameter unpacking
While sometimes convenient, the ability to unpack tuple parameters (to
lambdas and functions) was removed from Python 3. Either use the tuple
directly or unpack it in the function body.

(lib2to3.fixes.fix_tuple_params)
2017-04-11 17:15:01 +02:00
Xavier Morel 578b0ef2fd [#8530] convert dict.has_key
Redundant with `in` and removed from Python 3.

Removed odd, old and long-unused UpdatableDict (which defines and uses
has_key) and UpdatableStr (which was nearby and caught in the blast),
validated with al.

(lib2to3.fixes.fix_has_key)
2017-04-11 17:04:45 +02:00
Odoo Translation Bot bb5e0a3cfa [I18N] Update translation terms from Transifex 2017-04-11 16:11:23 +02:00
Raphael Collet 3481f0faff [FIX] fields: recompute recursive stored fields 2017-04-11 15:34:34 +02:00
Xavier Morel 3979f6802e [#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
2017-04-11 14:53:29 +02:00
xmo-odoo ca74b5e1c8 [IMP] convert PG errors through pg93 diag info
Previously availability of meta-information (failing constraint,
impacted table and column, …) in pg errors (e.g. constraint check
failure) was limited and only available through formatted error
messages, which could be localised (by PG itself) so not did getting
that information require string extraction it was brittle in the face of
localised instances.

Postgres 9.3 adds this meta-information to error diagnostic data
(`PQresultErrorField`), allowing easy programmatic access to it.
Psycopg2 [added a Diagnostic
object](http://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.Diagnostics)
around the time pg9.3 was itself released.

Assuming Odoo now requires pg >= 9.3 we can remove the old string
munging extraction for diagnostic.

* funny story, the handling of 23505 didn't actually work because
  "duplicate key value violates unique constraint" is a literal part
  of the error message, I'd misunderstood "value" as a field name
  because my test model's field was called "value". Makes sense too
  since you can set UNIQUE constraints on multiple fields (and UNIQUE
  indices on expressions)
* for both errors, it should be possible to use the table_name or
  constraint metadata to provide messages about sub-model issues (a
  constraint on an m2o), but that's not currently handled

Fixes #15323
2017-04-11 14:51:53 +02:00
Odoo Translation Bot 69b45530dc [I18N] Update translation terms from Transifex 2017-04-11 10:37:54 +02:00
qdp-odoo 84e4f6b08c [FIX] base: fixing test_new_api after previous commit.
New test introduced at https://github.com/odoo/odoo/commit/3214ca98206e5f99e2ab1d471ce1ef543057c9f6 tested the type of a column we changed from datetime to date in https://github.com/odoo/odoo/commit/01142701cc566b3084326af9649fd85db02b4220. Picked another datetime field to do the test
2017-04-11 08:39:34 +02:00
qdp-odoo 01142701cc [REF] res_currency: res.currency.rate name is now a date instead of a datetime
Since we only uses date fields in accounting, it does not have any sense to have a datetime for currency rate:
 - it is error prone for the users as the timezone they're in will affect the rate (and possibly take yesterday's rate).
 - it involved the possibility to create several rates per day, which was not fully supported and might give undeterministic results (so we also add a constraint in order to only have one rate per day)
2017-04-10 16:08:07 +02:00
Christophe Simonis 2c897d4199 [FIX] base: allow users to delete own filters, even if not creator 2017-04-10 15:17:49 +02:00
Fabien Pinckaers 525d094ef6 [IMP] account: misc UX improvements
Allow to configure the bank statement import mode from kanban
    When doing a manual journal entry, don't show the maturity date
    Removing Issued total, using credit instead (less code, more
    useful to have due amounts, instead of overdue)
    Creating a bank, set a name 'BofA Current' and an
    account number (that way, the account.account is based
    on name)
    Settings Wizard & menus: better sentences
    Statement CSV Import: installed by default (it
    does not add any menu)
    remove use_in_payment: complex field, only
    used for a default value
    Small code cleanup
[IMP] sale: moving order date to secondary tab (strange on a quotation)
2017-04-08 16:52:05 +02:00
Levent Karakaş 7e8d37462b [ADD[ base: address format for Turkey
Closes #16304
2017-04-07 14:13:37 +02:00
Goffin Simon 428d9e8177 [FIX] odoo: Copy a record in other language than US
When copying a record in an other language L than US, first a translation
was created for L by the create called in the copy function and afterwards,
a second translation was created by the function copy_translations

So there were two duplicated translations for L instead of one.

opw:706865
2017-04-06 17:13:15 +02:00
Raphael Collet 5219dcbae3 [FIX] base: malformed base.pot 2017-04-06 16:30:29 +02:00
Raphael Collet 6621ade382 [FIX] ir_model: prevent renaming/removing fields that are used in views 2017-04-06 15:06:06 +02:00
Raphael Collet 5a1672fab8 [FIX] ir_model: field names must be unique per model 2017-04-06 15:05:52 +02:00
Raphael Collet 6b48098c81 [FIX] ir_model: field names must be valid pg identifiers 2017-04-06 15:05:52 +02:00
Christophe Simonis 6afea0b96a [FIX] base: allow non instanciation of manual fields in partial loading 2017-04-06 12:31:02 +02:00
Odoo Translation Bot e08590320d [I18N] Update translation terms from Transifex 2017-04-06 11:41:10 +02:00
Raphael Collet 6498f35145 [IMP] base: add individual module exclusions 2017-04-06 11:17:58 +02:00
Raphael Collet c29cac23fb [IMP] base: add boolean field 'exclusive' on module categories
When set, this flag restricts the installation of several modules
from the same category.
2017-04-06 11:17:58 +02:00
Nicolas Lempereur dff2cf3ca1 [FIX] base: field monetary lose context of t-lang
In monetary field refactoring (3407fb70e4) there was a small issue that
made context lost so the language use to render the field could be
different from the one to render the view.

For example: if the user has english, and print a report using the lang
of a partner in language spanish, the report would use spanish to format
number for all fields but monetary (which would use english).

opw-708197
2017-04-05 14:49:03 +02:00
Denis Vermylen 7787e91d68 [FIX] models: don't call name_get on falsy records
The call of the name_get on records with falsy ids was unnecessary
as it wasn't used afterwards and could lead to errors if a name_get
doesn't handle falsy records.

solves https://github.com/odoo/odoo/pull/16244
2017-04-05 11:24:02 +02:00
Martin Trigaux 4b432d169d [FIX] base: the doctstring is a lie 2017-04-03 14:37:02 +02:00
Odoo Translation Bot de1226011b [I18N] Update translation terms from Transifex 2017-04-02 07:13:42 +02:00
Odoo Translation Bot 48bf1bc863 [I18N] Update translation terms from Transifex 2017-04-02 04:32:01 +02:00
Martin Trigaux d84b795b0a [ADD] test_translation_import: new no update test
To verify the translations are indeed not overwritten
2017-03-29 13:41:09 +02:00
Martin Trigaux 1703a2f806 [FIX] base: do not overwrite noupdate translations
If a record is tagged with no update, the translations must not be replaced,
even if the "overwrite translation" checkbox is checked.

If somebody renames a noupdate and translated record, updating the translations
must keep the new translations.

Closes #14768
2017-03-29 13:41:09 +02:00
Christophe Simonis fb2504b24c [MERGE] forward port branch saas-15 up to aebd043662 2017-03-28 18:38:49 +02:00
Christophe Simonis 2df5faa551 [MERGE] forward port branch saas-14 up to 2f68e9e93a 2017-03-28 18:05:31 +02:00
Christophe Simonis 2f68e9e93a [MERGE] forward port branch 10.0 up to 72fa3e8bda 2017-03-28 17:27:19 +02:00
Christophe Simonis 27496730d8 [MERGE] forward port branch saas-11 up to c2569b9df1 2017-03-28 14:51:14 +02:00
Odoo Translation Bot 87caeb3605 [I18N] Update translation terms from Transifex 2017-03-28 14:17:22 +02:00
Raphael Collet 48c773de1d [FIX] base: do not create field x_name when importing a model definition (#16039) 2017-03-27 17:28:23 +02:00
Martin Trigaux 4d7d234ed5 [I18N] base: export master translations
Was not containing the description of all enterprise modules
2017-03-27 13:58:45 +02:00
Odoo Translation Bot 4c772faf12 [I18N] Update translation terms from Transifex 2017-03-26 07:12:58 +02:00
Odoo Translation Bot a18c453dd5 [I18N] Update translation terms from Transifex 2017-03-26 04:30:35 +02:00
Jeremy Kersten 33069e6c02 [IMP] ir.values: make order deterministic: per-company > global
Refine the priorities of ir.values entries to make the result
deterministic in the presence of multiple matching default
values. We now give the priority to company-specific defaults,
before global defaults.

Before this change, the default value would be random when
both a per-company and global default value existed for the same
field (with no per-user default).

The priorities are now defined as follows (smaller number = higher prio):

 1. Per-user default (user_id is set, company_id is set)
 2. Per-user global default (user_id is set, company_id not set)
 3. Per-company default (user_id not set, company_id set)
 4. Global defaults (user_id not set, company_id not set)

The final "id" order spec ensures that the order is total.

Also added the corresponding regression test.

Closes #16038
2017-03-24 11:39:38 +01:00
Raphael Collet 9e23458d40 [FIX] models: ensure recomputation after inversing fields (#15683)
When updating record using "record.field = value", we need to ensure that
all fields in cache depending on "record.field" will be recomputed.
2017-03-23 17:11:00 +01:00
Martin Trigaux 71d86afb58 [FIX] base: deactivate default language
When a language is deactivated, it may still be referred to in a default value.
A ir.value is created at the database setup to specify the default language.
If a user deactivate the default language but not the ir.value, the creation of
a res.partner would fail as trying to set an unknown value to a selection field.

This commit removes the default value when deactivating the linked language.

The patch is minimal for the bug. A more generic solution would be to verify the
ir.value when calling the default_get method.
This is however a risk of performance degradation (e.g. during a csv import) for
a rare scenario.
The dynamic selection scenario is probably on relevant to res.lang.
A similar problem can occur with many2one fields but is difficult to fix without
performance degradation.

Closes #16009
Fixes #15979
Fixes #3854
2017-03-23 14:38:05 +01:00
Jérome Maes 48f5c81755 [IMP] base,website_portal: webclient forbidden for portal user
About a `sudo` on ir.ui.menu, this commit (3649b7f359) removed it,
this commit (3d0cc2d6d2) re-added it.
Since portal user can not go on /web anymore, I think portal does not need to read ir.ui.menu.

Here some news scenario:
- if website is not installed, portal can log in, but will be redirected to login page
with an error message 'only employee can access'. Indeed, there is no page to display for
such user.
- if website is installed, but not website_portal, portal user can log in and will be
redirected to homepage. If he tries to manually access to /web, he will be redirect to
login page with access error (even if he will still be logged).
- if website_portal is installed, the portal user can fully enjoy its features.
2017-03-23 10:16:28 +01:00
Jérome Maes 3e3105151b [REM] portal: kill the module
All portal features were moved into base
and website_portal, portal module is obsolete.
This commit remove its code, and modify the modules
dependencies accordingly. website_portal now depends
on auth_signup.
2017-03-23 10:00:51 +01:00
Jérome Maes 1f3da58cfe [MOV] base,portal: make portal module empty
The goal is to prepare the removal of
'portal' module.

- demo portal user is moved into base
- 'is_portal' field on res.group too
- remaining security rule are moved to base too
- mail template is moved to website_portal
2017-03-23 09:59:58 +01:00
Simon Lejeune fcbfe47695 [FIX] base: lighten default values validation in ir.values
Rev acd8c4de18 prevents the creation of default values for fields that
are not defined. This is too restrictive because of the following
points:
    - one may want to create default values for fields that are yet to be
      defined
    - "fake" default fields used in res.config that do not point to real
      fields

The initial scenario this revision was trying to fix is the creation of
wrong default values through studio. This scenario is still fixed, as it
concerns the last `except` branch.

The tests have been updated to reflect these changes.
2017-03-22 12:48:56 +01:00