Commit Graph
120443 Commits
Author SHA1 Message Date
qsm-odoo 39a441e902 [FIX] web_editor: restore link dialog preview
By default, all btn colors are suggested in the link dialog (alpha,
beta, gamma, delta, epsilon, link, primary, secondary, success, info,
warning and danger). In lots of themes (and the default one), primary
= alpha and secondary = beta, which led to having two suggestion with
the same apparent color.

A new system was introduced to automatically remove the duplicates...
but this system also removed the button preview as it considered it to
be a duplicate.

This commit also adapts the preview to BS4.

task-1878245
2018-09-12 10:56:46 +02:00
jem-odoo 0cbf638730 [FIX] project: remove default group_by
When seeing the task of a proejct, we don't want to force
the group by stage on the list view.
2018-09-12 10:44:12 +02:00
jem-odoo 32700ebacc [IMP] hr_timesheet: remove calendar view for timesheet
The calendar view does not make many sense for timesheet. Moreover
recording timesheet from it is strange since there is no end date
on the timesheet model.
Removing this view avoids confusing for users.

Task #1883326
2018-09-12 10:44:12 +02:00
jem-odoo a01b5eb402 [IMP] *_timesheet: improve tests
This commit only improve timesheet tests, by adding
more assertions.
2018-09-12 10:44:12 +02:00
qsm-odoo 797442a024 [MERGE] portal, *: redesign portal screens
This commit redesigns all portal screens, improve bootstrap compliance
and increases maintainability. See sub-commits for details.

Closes https://github.com/odoo/odoo/pull/26849
2018-09-12 10:36:09 +02:00
qsm-odoo 49923edc90 [FIX] portal: adapt tests to portal changes 2018-09-12 09:37:56 +02:00
qsm-odoo 545638c8f4 [FIX] portal: at least use background mixin for portal dark background 2018-09-12 09:37:56 +02:00
sri-odoo a56a476a97 [REF] sale, project: move edit button into portal top banner 2018-09-12 09:37:56 +02:00
sri-odoo 9aafeb8429 [IMP] portal: make fullwidth top banner
Add template that render a top banner. This box is intended
to be used to prompt system message, like links to the backend.
2018-09-12 09:37:56 +02:00
sri-odoo aac0f8e9fc [REF] website_crm_partner_assign: use template for 'opportunities' 2018-09-12 09:37:56 +02:00
sri-odoo 9dc300b467 [REF] project, hr_timesheet: use template for 'tasks' and 'projects' 2018-09-12 09:37:56 +02:00
sri-odoo 8ba6e3b0c3 [REF] sale(_management): review 'sale order' and 'quotation' templates 2018-09-12 09:37:56 +02:00
sri-odoo afdee7d67f [REF] account, account_payment: review 'invoice' design 2018-09-12 09:37:56 +02:00
sri-odoo 86ab1c55b4 [REF] portal: prepare single entry layouts (with and without sidebar)
Create single entry templates to be used in portal apps.
Add the ability to customize the bg-color for single entry pages
2018-09-12 09:37:56 +02:00
sri-odoo 084a162196 [REM] portal: js sidebar resize function
Not longer necessary, we'll use boostrap default classes instead
2018-09-12 09:37:56 +02:00
sri-odoo c78a2dbd8f [REF] portal, *: use a template for tables
Use a template in order to simplify maintenance and keep a consistent design
2018-09-12 09:37:56 +02:00
sri-odoo 1f946a2bec [REF] portal, *: move breadcrumbs in searchbar
* account, project, purchase, sale, website_crm_partner_assign

In some circumstances, we need to move the breadcrumbs into the
searchbar.
2018-09-12 09:37:56 +02:00
sri-odoo 5f71dad5e3 [IMP] portal, *: review home entries templates
* account, project, purchase, sale, website_crm_partner_assign

- Create a single template to be used for all doc's entry in order to
  simplify maintenance
- Make the entire entry clickable using bts4 classes
- Fix an alignment issue between title and badge
2018-09-12 09:37:56 +02:00
sri-odoo d5c66ca1fa [REF] portal: review 'salesperson' design 2018-09-12 09:37:56 +02:00
sri-odoo 7a419ec2c2 [REF] portal: review 'search/filters' toolbar 2018-09-12 09:37:56 +02:00
sri-odoo 60d837044a [FIX] base, portal: format address widget
Empty space were used to compensate the icons size.
Unfortunatly icons may have different sizes and the surrounding text
barely match the empty space provided, causing misalignment.
2018-09-12 09:37:56 +02:00
sri-odoo b1d5af2e6c [REF] portal: review main layout 2018-09-12 09:37:56 +02:00
Aaron Bohy a131373fac [FIX] web: wait for onchanges before saving
Rev. db9b91ff removes a use of a mutex where it could end up in a
deadlock situation (and where the use of the mutex wasn't
necessary). However, it caused an issue as the following scenario
didn't work anymore:
  - in a form view with a one2many with fields A and B (required),
    with an onchange on A setting B,
  - add a row and set a value for A,
  - click on 'Save' directly (before the onchange RPC returns)
  - whereas it should wait for the onchange to return before
    trying to save, it tries to save directly but faces an unset
    required field, and displays a warning to the user.

The reason is that, before saving, the FormController asks all its
widgets to commit their value (through a call to commitChange).
This call was, prior to db9b91ff, done in the mutex. The onchange
RPC being itself done in that mutex, we thus waited for the
onchange to return before calling commitChanges. After db9b91ff,
since there was no longer a mutex, commitChanges was called
directly, and the editable list returned a warning as one of its
required field was unset.

This commit ensures that commitChanges is called once all onchange
RPCs are done, by waiting the mutex to be idle.
2018-09-11 21:05:23 +02:00
Aaron Bohy 0ff2087fb9 [FIX] web: FieldMany2ManyTags: fix broken colorpicker
Before this rev., if the user clicked on a tag to open the color
picker, and then clicked in the dropdown, but not on a color, the
color picker closed itself, and it was no longer possible to open
it again.

This issue came with the migration to BS4 and its following fixes.
As the color picker is now a classical BS dropdown, it closes
itself automatically, so we don't need to manually close it on
focusout.

Task 1878254.
2018-09-11 21:05:23 +02:00
Christophe Monniez 88e935fa01 [FIX] web: remove display none timeout
Since 6dc37ee461 a d-none class was added to hide the menus in the
navbar during the start of the navbar. A timeout was set to mimic the
old behavior and let enought time to bind events on menus.

When the project app was installed alongside with all other apps on the
runbot, there was not enough place in the navbar. This resulted in a
race condition at the begining of the project tour.

With this commit, the d-none class is immediately removed and then the
menu are started (binded to events) before the tour has the hand to
continue its next step.
2018-09-11 20:19:17 +02:00
Pierre Masereel a7aab13cc4 [FIX] l10n_be_invoice_bba: inherit non existing view
The view 'res_config_settings_view_form' doesn't exist in the module
l10n_be, so as the field wer are referencing in the xpath is added in
module account, we inherit 'account.res_config_settings_view_form'
instead.
2018-09-11 17:56:59 +02:00
Toufik Benjaa 0c67985023 [FIX] l10n_de, l10n_mx, l10n_nl: bad command sent to ORM
When we get the existing tags to append them a new id, we don't get a
list of id but a list of tuple with one id, this only append if you have
more than one accounting of these country installed, as the first time
it will return an empty list. So the command sent to the ORM, is not
built correctly.

To fix this we just append commands '4' that will be append in a list.
2018-09-11 17:54:40 +02:00
Raphael Collet fa6774b899 [FIX] models: make log_access fields readonly, and remove useless definitions 2018-09-11 17:25:07 +02:00
Raphael Collet 9823fe6f07 [FIX] models: allow superuser to set log_access fields while loading registry
This enables a module to create data in the past.
2018-09-11 17:25:07 +02:00
Xavier Morel 5fade72656 [FIX] models: batch field set on creation when company_dependent
This may be completely broken/wrong, but damn if it doesn't speed
import up (2mn to 30s, the main cost center goes back to updating
computed fields during/after creation fields).
2018-09-11 16:43:55 +02:00
Xavier Morel 0ecc5d50fb [IMP] base: cache property.get(res_id=False)
After installing a bunch more modules including account & some others,
company-dependent fields turn out to be horrendously inefficient (more
or less entirely unbatched): near 80% of runtime is taken by setting
those fields on the partners being created, split 28%/51% between
getting the default values (_default_company_dependent) and setting
them (_inverse_company_dependent).

clear_cache on *every* set_multi call is a bit extreme and cause test
problems (test_pickings_transfer_with_different_uom_and_back_orders
has a super fucky behaviour wrt caching so breaks when clearing the
cache on every set_multi) so only cache the "default"
case (res_id=False) and only clear when specifically setting that.

This makes fetching default values essentially disappear from the
profile.
2018-09-11 16:43:55 +02:00
Xavier Morel 7f29b31cf3 [IMP] models: use raw sql for modified()
Avoiding search makes modified go from 18% of total runtime to 9% over
10k calls (though only 5k search() call).
2018-09-11 16:43:55 +02:00
Xavier Morel edb34ee27a [IMP] base: avoid ref() in conversion of M2O/M2M
A proper ref() call implies an exists(), which isn't that expensive
but piles up over a few thousand calls.

The partner import test case trigger 7394 calls to exists, for a total
of ~6% runtime (and under 2% for the actual xid lookup).
2018-09-11 16:43:55 +02:00
Xavier Morel f11d143f00 [IMP] base: avoid re-serializing the tz list every time we create a partner
odoo.fields.Selection.convert_to_cache checks that values being set on
the field are valid (part of the selection's values).

For res.partner because of the tz field that means duplicating a list of
~600 timezones and sorting it every time we create a partner. Which for
my test case is 2500 times and burns 3.8% of total runtime for
absolutely no reason.

statically compute the reordered tzs list and just return it as-is from
_tz_get.
2018-09-11 16:43:55 +02:00
Xavier Morel d7210f5257 [IMP] api, models: _write performances on import
Followup from the previous commit: before this, _write takes 32% of
total runtime, of which 13.7% is ultimately assignable to add_todo.

Turns out for the test case we mostly keep adding records to recorsets
where they're already present, so the 13.7% of runtime in add_todo are
mostly spent creating orderedsets (11.17) then converting those back
into recordsets (1.75%) with some time spent creating lists and
appending records (already present) in them.

Checking if the records are already present before merging them in
decreases add_todo's runtime cost to 0.5%, and ultimately _write to
20%.

As many of the ignorable calls were merging a singleton or an empty
recorset into the parent recordset, optimising for these cases was
added to BaseModel's <= and >=.
2018-09-11 16:43:55 +02:00
Xavier Morel c3216db4c1 [IMP] fields: performance of creating with m2m fields
Note: all costs are according to cprofile on my machine, as a fraction
of total time to import, python-flamegraph has somewhat different cost
distributions, YMMV. Profiles use test-import of a 2500 partners file,
with name, country, street and 0~4 tags, all randomly
generated/assigned.

Costs were profiled as split 8.5%/32%/57% between data conversion,
creating records (Model.create/Model._create) and populating stored
computed fields for a total import time (unprofiled) of 1mn (±2s or
something).

For the creation step, 27% (of total runtime) were assigned to the m2m
(fields.Many2many.create), almost all of which (25%) was assigned to
accessing a record's id in a listcomp in a loop.

Optimisations:

* optimise the case where we're only adding / creating values:
  represent the relation as a dict of sets instead of a set of pairs;
  commands 5 and 6 will only operate on the current record's value,
  instead of traversing all pairs in the relation
* optimise accessing the value of an id field by hand-inlining the
  various bits, this is mostly obviated by the other previous
  optimisations (number of Id.__get__ calls reduced from 5.4 millions
  to 0.55) but given how common accessing a record's id is (and
  how it's usually considered to be free) it's still a good idea: cost
  of accessing the id field was reduced by 75% (0.55 million accesses
  went from 3.32% of total runtime to 0.83%)

Without profiling, time to import my test file went from ~1mn to ~45s.
2018-09-11 16:43:55 +02:00
Thibault Delavallée 08ce84f51d [REF] base: allow to override access rights computation on node in fields view get
Purpose of this commit is to have a hook to allow to set CRUD actions
on node in fields view get for other views than those defined in base or
web. For example grid view defined in enterprise does not have its
CRUD actions correctly set.

We choose to extract the access rights set on nodes in a separate method
to ease inheritance. The whole postprocess_and_fields does a big mixup
of updating the node, computing fields, computing the arch and could
probably be cleaned. This is however far from the simple purpose of this
commit and we choose to make a small diff without refactoring things
especially in a near-stable version.

This commit should not change anything from functional point of view.
2018-09-11 16:36:20 +02:00
Hiral Bhavsar 3bb99ff80e [FIX] web: BS4, use a fixed width for datetimepicker
When switching from calendar to hours, the 'auto' width changes and this
is not what was desired.
2018-09-11 15:17:23 +02:00
RomainLibert e332c304e0 [FIX] product: make the new group invisible
Since https://github.com/odoo/odoo/commit/acace4d8c3caca5f38eb6d6e603a1133329b4ccc a new empty
group was added to the product form view.

The problem is that this group is always visible while its content is
only visible when having group_product_pricelist hence showing a blank
space in the form view.
2018-09-11 15:05:14 +02:00
David Monjoie 955e2bad52 [FIX] web: fix wrong padding css rule
The css rule I introduced in 737ba55 was poorly written, my bad.
2018-09-11 15:02:55 +02:00
Martin Trigaux 3b30cd245d [I18N] export some saas-11.5 source terms 2018-09-11 14:53:40 +02:00
Kinjal Mehta 49c7105631 [FIX] mail: BS4, adjust counter position 2018-09-11 14:21:18 +02:00
Nikunj Ladava 9d98590f49 [FIX] note: fix border bottom color 2018-09-11 14:16:01 +02:00
Simon Lejeune 2d92febaf7 [FIX] barcodes: don't listen to barcode in input number
related to rev 74fcd3ac3b
2018-09-11 13:58:20 +02:00
XavierDo d5bc0e57cd [FIX] project: use user right on portal task
The search on project were done as sudo with a domain matching the
"project_task_rule_portal" rule. This commits remove the sudo call
and corresponding domains.

This replace lpe's fix b8fe404e, and user connected to portal to see
his tasks, avoiding an error during crawling tests:

Error use case:
User try to access a task list from /my/projects with a filter on a project.
The project filter does not exist in task list since the rules applied are for
portal user -> an error is raised

Now, project list on /my/projects and the filter available on /my/tasks should
be the same.
2018-09-11 12:22:40 +02:00
Cedric Snauwaert 069c6f39a3 [FIX] l10n_de: wrong order in manifest for xml view
Crashed on installation because there is a reference in data/report_layout.xml to a template that is defined in report/din5008_report.xml (external_layout_din5008).
The report/din5008_report.xml should be loaded first to avoid this error.
2018-09-11 11:34:58 +02:00
qsm-odoo c04d3d1460 [FIX] portal, web, web_editor: frontend font-size
Commit https://github.com/odoo/odoo/commit/903ff171acbef7f9fe6e533f43b99eba801b200f
lowered the font-size to 14px for the frontend by customizing the
bootstrap variable in the portal app. It changed the web_editor
rte_inline tour accordingly.

This however broke the test on runbot "base" database, as the font-size
in the editor without having installed the portal app was still set to
16px. Commit https://github.com/odoo/odoo/commit/e3bc059c3649a05c12cd3c8099092282c10141b7
only moved the failed test from "base" to "all" database.

This commit unifies the font-size for all frontends by setting it in the
web app. So, after this commit: reports, editor, login screen and
frontend will always have a font-size of 14px no matter the application
which is installed (except themes).
2018-09-11 10:58:17 +02:00
Christophe Monniez e3bc059c36 [FIX] web_editor: adapt tour to BS4 2018-09-11 10:00:42 +02:00
Dharmraj Jhala 881346780d [FIX] base: justify bootstrap grid columns properly using wkhtmltopdf
Since the BS4 is using 'justify-content' property to justify grid columns,
the columns are not justified properly in pdf because wkhtmltopdf does not
support this property.

So we set supported property '-webkit-box-pack' instead of 'justify-content'
through the post processing regex that will add limited support for grid
columns justification in pdf reports using BS classes only.

However, 'justify-content-between' / 'justify-content-around' classes are
still not supported due to the limited flex support by wkthmltopdf, and so
report designer might have to put some extra efforts for such rare cases.

Task: 1880709
Closes #26846
2018-09-10 17:54:43 +02:00
Dharmraj Jhala 2db1b48bfc [FIX] web: declare <!DOCTYPE> at the beginning of 'minimal_layout'
The <!DOCTYPE> declaration must be the very first thing in an HTML
document, otherwise you may experience that the preference is given
to the "user agent stylesheet".

This is the case while printing PDF reports using the 'minimal_layout' template.
For example, layout for 'Picking Operation' report will be different in HTML and
and PDF reports. Text inside <th> will be aligned left in the HTML report, while
center in the PDF one. The issue is there since a long time, but was not obvious
enough to catch till now. (For example, in previous BS versions, explicit rule
was present to align text to the left inside <th> tag, and so the layout did not
break by luck. BSv4 afterwards, this rule was removed, shedding light on this
issue).

This commit improves the behavior while printing PDF reports by placing
<!DOCTYPE> declraration at the very beginning so that preference will be
given to custom stylesheet over "user agent stylesheet".

Task: 1880709
Closes #26846
2018-09-10 17:54:43 +02:00