Commit Graph
3663 Commits
Author SHA1 Message Date
Martin Trigaux 43d355c208 [IMP] base: better default for translation overwrite
FP request: hide the field from the view as too technical
MAT analysis: it should be true by default as most expected behaviour
(it was the reason why it was displayed in the first place)

closes odoo/odoo#35679

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-13 14:21:00 +00:00
Martin Trigaux caa43300f2 [IMP] base: revert c875d02572
Remove the placeholder that was added at task 1921583
Cf fp discussion about task 2028152
2019-08-13 14:12:17 +00:00
Martin Trigaux bdec8efabf [ADD] web: add the language code in the translation widget
The planet icon is not very clear for translation feature.
Replace it with the code of the current language.

Task-id: 2028152
2019-08-13 14:12:17 +00:00
Kevin Baptiste f9fafcdcfb [IMP] hr: improve employee profile usability (back2basics)
Improve the usability of the employees profile / "My Profile"

TaskID: 2048672

closes odoo/odoo#35587

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-13 13:00:40 +00:00
Sébastien Theys 67e3924bfe [IMP] tools, product, website_sale: rename image_variant_max
Follow up of 58a2ffa26f

Variant specific field `image_raw_original` was meant to be renamed to
`image_variant_1920` instead of `image_variant_max` to follow the same naming
convention as the other fields (having the pixel number in the name).

closes odoo/odoo#35493

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-06 12:29:13 +00:00
jbm-odoo 853a773ee4 [IMP] settings: Improve general UX (back2basics)
TaskID: 2043133

closes odoo/odoo#35382

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-13 12:32:30 +00:00
Patrick Hoste 175994cbe2 [FIX][IMP] various: correctly place ribbon widget in form views
PURPOSE

Have a nice ribbon widget to display state of records: part II

SPECIFICATIONS

Next to 883c96b781 and recent ribbon widget update some form views
have to be updated. It is best displayed following those rules

  * after oe_button_box in order to fix overlapping;
  * before image to overlap it cleanly;

LINKS

Task ID : 2032621
PR : #34662

Task
2019-08-13 11:29:44 +00:00
fja-odoo 20efea970a [IMP] *: display some onchange warning with notif
* = base, web, sale, stock, sale_stock, stock_account

Warnings for the onchange now takes a type to know if it needs to be
displayed with a notification. Else it is displayed with a dialog
notification (like before).

Related to https://github.com/odoo/odoo/pull/32132 and
https://github.com/odoo/odoo/pull/35209

Part of https://github.com/odoo/odoo/pull/35342

task-2047628

closes odoo/odoo#35342

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-09 15:47:09 +00:00
fja-odoo 83310f4404 [IMP] *: change title and subtitle of warnings
* = portal, test_website, web, website

The title will now be "Someting went wrong." and we will no longer
display the error type as it is not usefull info to the user.

The message of the warning modal was not displayed right if too long.
Now it will be displayed properly.

Related to https://github.com/odoo/odoo/pull/32132 and
https://github.com/odoo/odoo/pull/35209

Part of https://github.com/odoo/odoo/pull/35342

task-2047628
2019-08-09 14:17:31 +00:00
Christophe Monniez 1fc62ae3e5 [FIX] web: remove white spaces in ttf file names
Since ed18095127, some google fonts are included. The "Open Sans" fonts
prevents RPM packaging to work because of white spaces in file names. This
is a Python setuptools bug (https://bugs.python.org/issue809163) which is
not yet fixed.

With this commit, the "Open Sans" directory and ttf files are renamed
into "Open_Sans", solving the packaging problem.

closes odoo/odoo#35661

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-12 14:48:12 +00:00
Toufik Ben Jaa e974e1aec8 [FIX] tools: always retrieve a langage on formatLang
- Since commit https://github.com/odoo/odoo/commit/f5cd483216af01001f44a41f7d48f042b9f56ff9
the method `_lang_get` doesn't fallback on a language if the asked language
isn't found.

This causes issues with `formatLang` that uses the language on the
context, which is the language set on the client browser (in most cases).

Meaning, if 'en_US' is the only installed language and a customer
has set his browser to `fr_FR`, when calling `formatLang` this will
crash since no language has been found and `format` on `res.lang`
requires a singleton.

closes odoo/odoo#35633

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-08-12 12:51:29 +00:00
jem-odoo 4b8af06d8a [IMP] base: extract gantt validation
All views defined in the 'enterprise' addons have their validation done
manually in their respective addons. Each one ? No, one rebel still
resists to the standart way to work.
This commit moves the gantt validation to put it in its module. The idea
is (for developper) to have only one module to change when adding feature
in gantt view.

Task-2050019
2019-08-12 11:21:15 +00:00
jbm-odoo b6193a6b8d [IMP] Res_partner: Improve res.partner form UX (back2basics)
- Clean form view
- Add a new widget to check if IBAN account number is correct
- On the res.partner model, default value for "is a company" is True.

TaskID: 2025362

closes odoo/odoo#34691

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-12 12:07:53 +00:00
Kevin Baptiste 0f15adb304 [IMP] hr: improve employee profile
closes odoo/odoo#34931

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-12 11:26:09 +00:00
Martin Trigaux 98cc300cec [IMP] tools: ignore line number for code translations
The line number was only indicative and was not used by the system.
When the translations source were updated, a big part of the diff was
only about the line numbers.
Ignore the given res_id value and export the line at 0

When reading the po file, the res_id from the file is still read and
stored in database but should be ignored

closes odoo/odoo#35582

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-09 07:59:56 +00:00
Thibault Delavallée 7b79045fab [REF] mail: perform some code cleaning in mail gateway about parsing email values
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

Parsing email values: make message_parse effectively prepare all required
values for later processing

  * update message_parse to add some more data directly in parsed dictionary
    and avoid having to parse value again in later processing and computation.

    * notably recipients computation is now done directly in parsing. It
      includes email check and reconstruction using tools methods. That way
      routing just has to handle those values and not compute part of them;
    * from and cc are correctly managed with parsed and cleaned (sanitized)
      versions in dictionary;
    * remove all code decoding message header and replace them by fetching
      the parsed value instead;

  * filter parsed values before calling message_post to ensure right values
    are given to it instead of having to manage them in message_post. Indeed
    caller has to give the right input;
  * make parsing sub-methods (extract payload, post process payload) have
    a dictionary as input and output to always manage a dictionary of values
    through the parsing methods and update their namespace;

Routing: remove deprecated code parts

  * remove use of email_references regex. Indeed emails are routed using their
    messageId and not the regex anymore since several versions [1];
  * clean some unnecessary variables;
  * simplify variable type input, like message_parse accepts only valid
    email.message instances and to avoid several decode / encode. Tests are
    updated accordingly;

Update docstrings of those methods.

LINKS

Related to task 1893155
Linked to PR #33340

[1] See df037e2959 and 0028c42136
2019-08-09 14:30:55 +00:00
Mohammed Shekha 25ebd80b40 [IMP] *: add selection_mode condition to show/hide elements in kanban
If we use a kanban view to select a record we want to hide those elements:
dropdown boxes, buttons, anchors, some widgets, kanban color.

When it was too much change and used the new attribute
"kanban_view_ref" to explicitly define which view to open in selection_mode.

When also had to create previously unexisting kanban for
fleet.vehicle.model to show name and brand.

Task ID : 1924779
2019-08-09 09:01:19 +00:00
Mohammed Shekha 80a8b66246 [IMP] web: m2o/m2m SelectCreateDialog will now open kanban view
- many2one widget in mobile will open kanban view instead of listview when
records needs to be selected

- Add support of "kanban_view_ref" on many2x fields:
For many2one fields, this specific kanban view will be opened when you click
on this field. Note that in desktop, the behavior stay unchanged:
'Search More' will open the tree view.
For many2many fields, this specific kanban view will be opened when you add
a record in mobile.

- Add support "selection_mode" in kanban views.
This boolean is set to true when you want to use a kaban view to
select a record instead of open a record.
"selection_mode" is now passed in qweb_context to allow developers
to use t-if='selection_mode' in kanban views to show or hide elements;
buttons, dropdowns, anchor tags are not necessary when selection_mode
is enabled. So those elements can be hidden based on this condition.
Useful when kanban view is opened from m2o in mobile environment.

Task ID : 1924779
2019-08-09 09:01:19 +00:00
Katherine Zaoral 50155ae08e [ADD] base: Change Argentina country data
* set country VAT Label "CUIT" which is the country TAX id name  in
Argentina in order to used in reports and other places in Odoo. CUIT
mean "Código Único de Identificación Tributaria",

* update address format of the country.

* Use the state name instead of the state code: The address for the
company and partner was showing the state code (defined by ISO) but
this one are not the ones know for the common use. In order to avoid
errors we use the state name instead of the state code.

* Also change the order of the city state and zip are shown in address
in order to match the address in Argentinain "way".

closes odoo/odoo#34961

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-08 16:51:52 +00:00
sri-odooandjat-odoo 369c20a99b [REF] web: refactor the calendar view
Improve design and introducing several usability improvements:
- Removed customization of an event card, just display event title.
- Added popover, popover consist of two sections:
    1) Show the title, date and time of an event. Date and time are
       automatically computed according to the user timing preferences,
       language and event duration. Can be hidden with hide_date/hide_time
       attribute respectively.
    2) Display all the fields specified inside the <calendar/> element.
       fields can be specified with a widget and its options.
       e.g. <field name="name" string="Custom Name" widget="char" options="{}"/>
- Show avatar in popover for filters.
- Removed hide sidebar feature.
- Increase readability using a better color selection.
- Better UI in mobile.

And, Adapted test cases

Task 1919926

Co-authored-by: jat-odoo <jat@openerp.com>
2019-08-07 12:30:55 +00:00
Parth Choksi 5d7c0267a6 [IMP] *_sale, sale, sale_*: improvements in form view
Sending a quotation by mail is really rare and the option is still
available in dropdown menu. It is also confusing to see the document status
changed while you just want to print as a draft sometimes. So the PRINT button
is removed here.

Only displayed UNLOCK/LOCK for 'sales managers' if the
option “Lock confirmed orders” is activated in the settings.

Removed the ability to open the payment terms via external button
in edit mode

Removed the left,right and top borders in the field of terms and condition.
Kept only bottom border.

Event and Event ticket will come after Product regardless of it being a
template or the product.

In the sale order's form view, made certain changes like shifting
the positions, removing the field, adding title, keeping the field
in debug mode.

task-2033229
2019-08-08 07:54:07 +00:00
Martin Trigaux 85ee046b37 [IMP] *: use res.lang methods
get_installed and _lang_get_id are both ormcached and correctly check
the context

Retrieving a res.lang from a code is a frequent action that can be
achieved with _lang_get (cf previous commit).
Using _lang_get ensure the active_test in the context is correct and
is not poluted with another context propagation issue.
odoo/odoo#35490 discussion is an example of bad context propagation

closes odoo/odoo#35504

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 13:06:17 +00:00
Martin Trigaux f5cd483216 [IMP] base: no fallback on _lang_get_id
It was very misleading that
    self.env['res.lang']._lang_get('fr_FR')
used to return any language if fr_FR was not active or did not exited

There is a very frequent need to get a language from the code
There is rarely a need to get any language
2019-08-07 13:04:38 +00:00
David Arnold aee0da7d53 [IMP] base: use en_US writing
While licence is technically correct, it is not used in America
Change only the label as the key is used at other places (e.g. app store)

closes odoo/odoo#35350

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 14:38:31 +00:00
shreya thakrar 6fc4c53404 [IMP] base,l10n_*: Move state from l10n_* to base and remove
Remove states according to new address format

No need to keep states that's why they have been remove.

From Module:
Belgium(l10n_be)
Germany(l10n_de)
Poland(l10n_pl)

Purpose :
========
Uniformity for define all state in base.

Specification :
===========
Move states from localization to base module

Localization modules:
China(l10n_cn)
Costa Rica(l10n_cr)
Dominican Republic(l10n_do)
Ethiopia(l10n_et)
Ireland(l10n_ie)
Netherlands(l10n_nl)
Turky(l10n_tr)
Vietnam(l10n_vn)
Romania(l10n_ro)
United Kingdom(l10n_uk)

that it is not a problem to put all these states in base, because the current csv only takes 0.34 s to be loaded

Related to task #1967713
Closes #32767

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-06 12:34:12 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00
Sébastien Theys b77bbd01f8 [FIX] tools: fix condition of image_process quick return
Follow up of 344614b54a

If base64_source is falsy, we don't need to check the other parameters.

closes odoo/odoo#35489

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-06 12:16:18 +00:00
Mitali Patel 857c485175 [IMP] base/web: store more precision digits for rate field
Currently, only 6 digits after decimal point is stored in database and for some currencies
it may require to have more digits after decimal precision to correctly convert rates,
like MXN -> USD currency. So, we allow maximum digits to be stored in database.

On the view side, wherever rate is editable(form or tree view), we show 12 digits
after decimal point and on list view, we truncate limit it to 6 digits.

Also, a bug is fixed for web where 'digits' attribute for float field on list view isn't considered.

Also, we have to remove a test case statement which only checks for 6 digits for a float number.

task: 2024668
closes: #34279

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-06 05:28:35 +00:00
Christophe Simonis dfc9fe6a54 [ADD] core: new magical odoo.upgrades package
This package point to first package found in `upgrades_paths` or
fallback to alias of legacy `odoo.addons.base.maintenance.migrations`.

closes odoo/odoo#32650

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-05 12:21:29 +00:00
Laurent ContzenandOlivier Dony bbb1a8f151 [IMP] ORM: Add new --upgrades-paths CLI option
This commit adds a new way to use upgrades scripts folders
whithout needing to symlink them to an hardcoded path.

The folders specified in --upgrades-paths is then being used by
migration.py to find and execute migrations scripts per module
specified in the -u CLI option.

The folder needs to have the following structure:
- <upgrades_paths folder 1>
	- <module1 name>
		- <version1>
			- <script1>
			- <script2>
			- ...
			- <scriptn>
		- <version2>
			- <scripts>
	- <module2 name>
		- <versions>
			- <scripts>
	- ...
- <upgrades_paths folder 2>
	- ...

Update odoo/tools/config.py

Co-Authored-By: Olivier Dony <odony@users.noreply.github.com>
2019-08-05 12:21:00 +00:00
Anand Kansagra e488f208d2 [IMP] account,stock,base: fix typos
And use CamelCase in label

Closes odoo/odoo#29010
Closes odoo/odoo#29092

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-05 06:51:52 +00:00
Christophe Simonis e8a3f1a04e [IMP] core: remove support of oldname attribute
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.

Moreover, this feature was misused. It was:
- left on fields during multiple versions.
- used on reports (SQL views). This would be ok if the feature was
complete, but, as is, it was useless.
- kept unchanged after a second renaming of the field (which can happen
versions later the first rename).
- used, even when the meaning of the field changed. i.e. the field
`archived` has been renamed to the classic `active`, but the value
in the database should be switched.

closes odoo/odoo#35439

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-05 11:49:07 +00:00
Christophe Simonis 886eca0131 [IMP] *: remove usage of oldname attribute
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.

Moreover, this feature was misused. It was:
 - left on fields during multiple versions.
 - used on reports (SQL views). This would be ok if the feature was
   complete, but, as is, it was useless.
 - kept unchanged after a second renaming of the field (which can happen
   versions later the first rename).
 - used, even when the meaning of the field changed. i.e. the field
   `archived` has been renamed to the classic `active`, but the value
   in the database should be switched.
2019-08-05 09:36:41 +00:00
Stéphane Bidoul (ACSONE) 795c7b0a94 [IMP] core: improve python external dependencies check
Use pkg_resources.get_distribution() to check if python external
dependencies are installed, instead of trying an import.
The import test is preserved as a backwards compatibility measure.

This better expresses which python distribution needs to be installed
from PyPI and allows declaring a minimum supported version using PEP 440
version specifiers.

Closes #25541

closes odoo/odoo#25549

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-05 17:25:59 +00:00
Florent de LabarreandOlivier Dony c8fca2d052 [IMP] base: add more information for incorrect dependencies
If a dependency was wrong in the triggers, it was hard to debug

Co-Authored-By: Olivier Dony <odo@odoo.com>

closes odoo/odoo#31958

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-05 13:57:34 +00:00
Thanh Dodeur 8a8126126e [IMP] base: removes storing of res_name from ir.attachment
This commit removes the store property of `res_name` from `ir.attachment`
as it doesn't need to be stored and could contain outdated information
if the record name was changed after the computation.

Task: #1943295

closes odoo/odoo#34930

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-05 13:11:33 +00:00
Sébastien Theys 45e3be94c0 [IMP] tools, base: removed unused image helpers
PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 1b85ab93ec [IMP] base, product, website_sale: move image zoom out of mixin
This field is not necessary on most models so move it to the few places where it
is needed to avoid computing it and storing it everywhere.

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 8206b5b4cc [IMP] fields: add image field
PR: #34925
2019-08-02 16:44:47 +00:00
mreficent aafc5f7821 [IMP] base: add external id in error message
The view name is often not very informative, add the external id for a better
error

closes odoo/odoo#29473

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-02 14:58:14 +00:00
jbm-odoo e967435b2d [IMP] mail: Change validation success message
If the connection test to mail server succeeds, we shouldn't see
"Oops something went wrong" and "User Error" either

Replace error generation to display success message by bus notify.

closes odoo/odoo#35292

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-02 11:47:35 +00:00
Martin Trigaux 66dea8bb7b [REF] web: remove raw_mode flag on export
The export is now always in raw_mode
Adapt the tests

Fixes odoo/odoo#18798

closes odoo/odoo#26724

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-02 08:53:24 +00:00
Naglis Jonaitis 7417d8fc13 [IMP] *: fix typos in field definitions
* account, crm, hr, im_livechat, l10n_ch, l10n_it_edi, mail,
mass_mailing, project, stock, base

- `String` -> `string`;
- `defaut` -> `default`;
- `defaults` -> `default`;
- `reandonly` -> `readonly`;
- removed redundant `placeholder` attribute for `Char` field;
- removed redundant `size` attribute for `Float` and `Integer` fields;
- changed to use `Selection` instead of `Char` for a field having a
defined `selection`.

closes odoo/odoo#35356

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-31 17:14:19 +00:00
Martin Trigaux f8ff7debdc [FIX] *: bad usage of _ method
No need for selection fields
If in global variable, the _lt should be used instead

closes odoo/odoo#31211

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 12:40:01 +00:00
Martin Trigaux f4319580e5 [ADD] tools: lazy translation method
Introduces the method _lt

The translation method is now evaluated lazily.
It allows to declare global variables with translatable content

e.g. this code will now work:

LABEL = _lt("User")

def _compute_label(self):
    context = {'lang': self.partner_id.lang}
    self.user_label = LABEL
2019-08-01 12:39:56 +00:00
Yenthe666 0c808a082f [IMP] base: improve logging view and add hooks
closes odoo/odoo#32392

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 13:06:55 +00:00
mreficent 64773140b0 [IMP] doc: remove calls to @api.guess and @api.noguess
Those two decorators are removed/deprecated since recent commits but
some references remained in the documentation.

api.guess and api.noguess is deprecated and removed since c552fb7a61

closes odoo/odoo#35332

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 13:16:37 +00:00
Lucas LefèvreandYannick Tivisse 3e97cff779 [IMP] base: Remove customer and supplier fields from res.partner
Purpose
=======

Fields `customer` and `supplier` on `res.partner`
are mostly used in domains of many2x fields.

Those domains can confuse end users because they don't
see the partner they are looking for; and it's not obvious why.

Some identified problems:

1. It can lead to duplicated partners: the user does not find
   the partner, so he creates a new one.

2. The user imports supplier contacts in the Contacts app, so they
   don't get the `supplier` flag. Then the user wants to make a purchase order,
   and cannot find the new suppliers in the list

3. A user removes the customer flag on a prospect, because they don't think
   it's a customer yet - except now they can't make a quote for that customer...

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

Remove the two mentioned fields.

Since fields `customer` and `supplier` have been removed, all partners
are now shown in many2one dropdowns.

But in some cases, not all partners are relevant or some are more likely
to be relevant than others. e.g. when creating a PO, top suppliers have a
higher priority than other partners.

So, adapt the places where those fields were used with the new mechanism to
display the searched the partners, according to the number purchase/sales
orders they made.

TaskID: 2031147

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2019-08-01 12:42:03 +02:00