Commit Graph
119893 Commits
Author SHA1 Message Date
XavierDo a4dfa6e354 [FIX] web, website: fix tests giving 404 error
-Some tests where moved without addapting the path to them:
path is now update and tests fixed.

-A picture was removed in commit 4dce6cc98b but
still referenced in template website_twitter_snippet.

-A test was missing a data leading to the wrong path to image beeing loaded
2018-08-22 14:41:02 +02:00
Alexandre Kühn 9b1daa1218 [FIX] web: no running services in tests and benchmark suites
This commit fixes two issues:

1. No error when running several mocked service providers in tests

	Revision on https://github.com/odoo/odoo/commit/eea2366fd2b8398a6c8022f24adb722e5e16a6f4

	In the commit above, the intent was to turn off the logic about
	"Service Provider" in the tests environments. To do so, it was
	mocking the methods to deploy services (`_deployServices`) and
	the method to dispatch service calls (`_call_service`).

	However, this was not enough, because such a mocked service provider
	still tracks undeployed services. This is an issue in case there are
	several mocked service providers running at the same time, because it
	will raise an exception:

		https://github.com/odoo/odoo/blob/master/addons/web/static/src/js/core/service_mixins.js#L24

	Note that the tracked services are globally known by all services
	providers, because the properties `services` and `UndeployedServices`
	are objects that are set in the definition of the mixin.

	To fix this issue, the `init` method of the `ServiceProviderMixin`
	should not do anything on mocked service providers, so that they act
	as if there were no service providers at all in the system. In
	particular, those mocked service providers will not make changes on
	the shared properties `services` and `UndeployedServices`.

2. No running services on top of benchmarks

	The web client on top of the benchmark suite was not mocked in a way
	to turn off the "Service Provider" logic. Similarly to the JS test
	suites, services should not influence the execution of benchmarks.

Closes #26519
2018-08-22 14:20:48 +02:00
Sébastien Theys 416b810eb5 [FIX] web: prevent textarea vertical resize on chrome
Since we correctly compute the height of the field, we don't want to let the user resize it vertically.

This was already working on Firefox because it doesn't require the field to be in the DOM to read the resize attribute, but Chrome does require the field to already be in DOM.

Task: 1869469
PR: #26518
2018-08-22 14:10:06 +02:00
RomainLibert daec1d0440 [FIX] sale: move sale_report filters to_invoice/fully_invoiced in enterprise
These filters were using a field defined in enterprise.
They are now added by the sale_enteprise module.
2018-08-22 14:07:14 +02:00
Jeremy Kersten e3ecc989b1 [IMP] website*: allow to customize img for OpenGraph/Twitter
Now specify og for a model is more generic, and done python side

This commit closes #25430
2018-08-22 14:02:39 +02:00
Kishan Gajjar 546dfd7d86 [IMP] website_forum: Remove meta from website_forum template.
add default meta tags into product page by override '_default_website_meta' in Forum
2018-08-22 14:01:32 +02:00
Kishan Gajjar 25166653c6 [IMP] website_slides: Remove meta from website_slides template.
add default meta tags into product page by override '_default_website_meta' in slide.slide
2018-08-22 14:01:32 +02:00
Kishan Gajjar 8d76c01a82 [IMP] website_event: Remove meta from website_event template.
add default meta tags into product page by override '_default_website_meta' in event.event
2018-08-22 14:01:32 +02:00
Kishan Gajjar f87d1dad94 [IMP] website_blog: Remove meta from website_blog template.
add default meta tags into product page by override '_default_website_meta' in 'blog.post'
2018-08-22 14:01:32 +02:00
Kishan Gajjar 769d305bc5 [IMP] website_sale: Remove meta from website_sale template.
add default meta tags into product page by override '_default_website_meta' in product.template
2018-08-22 14:01:32 +02:00
Kishan Gajjar 156955de6b [ADD] website: Added a feature to set opengraph/twitter meta image from SEO dialog.
With this commit now user can set custom meta image from the seo dialog. If the
user sets such image then it will be displayed when the user shares that URL in
social sites.

By default, it will show the list of images used in the current page.
Alternatively, user can use media dialog to select/upload images. By default, it
will take the company logo as a meta-image.

We also improved how custom meta tags are handled for different pages, Now we can
set custom meta tags based on the model and we can override '_default_website_meta'
method in case you want to change default meta values from the specific model.
e.g. For products displayed on the shop, if we want to change the value of
og:image to product specific images instead of default logo

In future, it will be used to add model specific metas like og:price, og:currency

We passed 'website_company_id' in frontend session info because we display
company logo in dialog for all pages. We can't use /logo.png as it is not
updating in multicompany and multiwebsite.

task id: 1835370
Closes: #25430
2018-08-22 14:01:32 +02:00
Olivier Colson 05a9a095fb [FIX] account: settings: remove wrong id on div 2018-08-22 13:56:43 +02:00
Christophe Simonis 31679cd81b [FIX] project: correct syntax
Oversight of previous forward-port
2018-08-22 13:19:36 +02:00
Christophe Simonis 4f62d6dd8f [MERGE] forward port branch saas-11.4 up to ef6b574eda 2018-08-22 12:02:30 +02:00
Florian da Costa 2bcb1b1ca5 [PERF] stock: states 'not it' values changed to 'in' opposite.
Purpose: databases with lots of stock moves (3M+) can experience
slowness
 when computing quantities on hand and forecasted.

Before this commit, the domains built to compute those quantities from
stock_move contained (state not in [done, cancel, draft]). Done and
cancel states represent around 95-99% of stock_moves in a normal
instance. So selecting all stock_moves then removing done and cancel
 ones if truly less efficient than taking directly the 'waiting',
'assigned', ... moves especially that the state in indexed in database.

After this commit, the domain is build with :
(state in [...]) with other state than 'done, 'cancel' and draft.

This commit is related to the PR 23030. Thanks to all people that have
took part of the conversation and florian-dacosta for the commit
2018-08-22 11:53:56 +02:00
jem-odoo f201e720c4 [FIX] sale_timesheet: remove confusing currency rates
The test of reporting is executed in the same currency
then the company (USD as default). But in the demo data
there is a bad currency rate converting USD into USD
with a rate of 1.5289.
This commit removes the confusing currency rate
in order to make the test running in a more
stable environment.
2018-08-22 11:52:52 +02:00
Sébastien Theys 14b9e9c92d [FIX] web: give correct size to o2m textarea at init
Before this commit, a textarea inside a one2many would only have the correct size after focus or on change.

When we select a line, we want all of the textarea of the line to have the correct size even if they are not directly focused.

Task: 1869469
PR: #26430
2018-08-22 11:51:30 +02:00
Sébastien Theys 289adeb63f [FIX] web: properly resize textarea when its value changes
Before this commit, a textarea would not resize when its value changed if the event was different than "input" or "focus".

This commit fixes it by also listening to the "change" event, and by triggering it at appropriate times.

PR: #26430
Task: 1869469
2018-08-22 11:51:30 +02:00
Sébastien Theys 4310b11df5 [FIX] web: compute the correct height for textarea autoresize
The box-sizing property was not correctly taken into account.

- content-box is the standard behavior: border and padding are added after the height
- border-box needs attention: border and padding must be included into the computed height

Task: 1869469
PR: #26430
2018-08-22 11:51:30 +02:00
Sébastien Theys 241704536d [FIX] web: allow o2m navigation to work from required inputs
In a one2many, pressing ENTER or TAB from a required input (of type text or char) that is on the last editable column of its line would fail to navigate to next line.

The issue was that the validation of the required field would happen before the change to its value was actually applied.

This commit fixes it.

PR: #26430
Task: 1869469
2018-08-22 11:51:30 +02:00
Demaret Rivarola Johan 46bfe9ad65 [FIX] project: kanban examples modal
- tab not showing: fade animation was causing the issue.
- redirection to home: button instead of anchor to avoid
redirection to target href

Task #1878160
2018-08-22 11:23:26 +02:00
Adrien Dieudonne e0aec7f0a4 [REF] test_mail: update counters due to enterprise ocn_client add
This commit is related to enterprise commit that replaced mail_push.
It is about:
[MOV] ocn_client: Odoo Cloud Notification for mobile push notifications
odoo/enterprise@7587be4663

Indeed counters are impacted by code located in enterprise because
those are "maximum queries" counters.
As ocn_client is an auto-install module enterprise runbot would
be broken if the counters weren't updated.
2018-08-22 11:16:14 +02:00
Alexandre Kühn 7aca511b4c [FIX] mail:tests: remove leftover 'debug: true' 2018-08-22 11:14:58 +02:00
qsm-odoo 7c1695650a [REF] website, *: clean demo data and some default main data
* social_media

- Remove action server demo (out-dated and buggy)
- Remove website app / themes app actions (useless)
- Move demo social media to the social_media addons
- Use same contact us page for demo website 2
- Improve edition of contact us and about us pages by using snippets
  as default contents
- ...
2018-08-22 11:02:25 +02:00
Deep Patel 909c80125b [FIX] delivery: fix delivery method arrow buttons
Before this commit, arrow is on the right side of text.
2018-08-22 10:55:08 +02:00
Luis Ernesto Torres Macías 4a4e564c2c [FIX] account: compare datetime.date to datetime.date
Cannot compare datetime.date to '0000-00-00' as it's a string, must be a datetime.date
2018-08-22 10:53:29 +02:00
Akash Bhavsar 2407b4d457 [IMP] maintenance: added effective date field in equipment & tools
Add effective date on maintenance equipement. The purpose is to define
when the equipment is put into service.
Adapt next preventive maintenance according to effective date

Task id: 33188
2018-08-22 10:48:13 +02:00
Jeremy Kersten 1cfaa12012 [IMP] server: --test-enable support tests directory without import
Before this commit, if import from tests directory was not in the __init__ file,
it was not possible to launch it with --test-file cli.

Now we only check in test directory if file exists.

This commit closes #26500
2018-08-22 10:08:30 +02:00
Jeremy Kersten 2431e2a9ea [FIX] web_editor, website: remove useless code / comment
Rebase failed, these lines should be no more there.
2018-08-22 10:08:30 +02:00
Christophe Monniez 3ff0948b0a [FIX] gamification: compute badge stats wihtout error
Since 960360a, when computing badge stats, a datetime was compared to a
string leading to a traceback.  e.g. when clicking in employess >
badges.

Also, due to a typo, the compute method was assigning the stats result
to the wrong attributes.  e.g. 'stats_my_this_month' instead of
'stat_my_this_month'.

With this commit, the above mentioned issues are fixed and a test is
covering these issues to avoid regression.
2018-08-22 09:28:16 +02:00
Pierre Masereel 0b2d6d7487 [FIX] stock: traceability report link
The links without href attributes, have a different style, so we cannot
differentiate them from non clickable text. So we set the href attribute
and prevent the default behaviour of the link in js.

TASK-ID: 1873101
2018-08-21 22:25:26 +02:00
TWA 326e48a112 [IMP] purchase_stock, sale_stock : Show stat button instead of m2m widget
On stock production lot, we show stat buttons redirecting to purchase
orders and sale orders where the lot has been used instead of showing
Many2many in the form view.

TASK-ID: 1873101
2018-08-21 22:25:26 +02:00
Pierre Masereel c9f899b99a [FIX] mrp: Traceability show MO final product reference
When a final product move line is shown in the traceability report is
displayed, the reference to the MO is not displayed because the finish
products move lines don't have any productio_id on it.

So to fix this we take the production_id of the move_id when it's a
finished product, and the raw_material_production_id of the move_id when
it's a consumed product that are always set.

TASK-ID: 1873101
2018-08-21 22:25:26 +02:00
Pierre Masereel 9524341a81 [IMP] stock: picking and mo traceability improvements
We now only show the move lines that are processed before (in date and
location) when we display the move lines from a picking or a
manuficturing order, before it was showing all move lines that
where processed before (only in date) meaning that if you display a
delivery, you were also seeing the other deliveries done before this
one.

TASK-ID: 1873101
2018-08-21 22:25:26 +02:00
TWA 0cd475124f [IMP] stock,mrp: Enable traceability report for non-tracked products
PURPOSE
=======

Make the traceability report available in more use cases.

SPECIFICATIONS
==============

1. Traceability Button on Manufacturing Orders
There should always be a traceability report available on the MO,
no matter if the finished product is tracked or not.

Example 1 : finished product is not tracked
            but the components are tracked
Example 2 : finished product is not tracked (qty>0)) but
            the components are tracked
Example 3 : no products are tracked

Task id: 1861928
2018-08-21 22:25:25 +02:00
Alexandre Kühn 5999ba86c7 [FIX] mail: "is typing..." notification sticky top for DESC threads
Revision on https://github.com/odoo/odoo/commit/4fa071339a8f381b1336fe326577c9decc04a1e1

There was a typo in the style of the 'is typing...' notification bar,
which resulted in applying the wrong sticky behaviour to ASC and no
sticky behaviour at all for DESC.

This commit applies the correct sticky behaviours to the notification
bar in both configurations:

      ORDER:                   ASC                           DESC

                     +--------[top]--------+        +--------[top]--------+
                     |                     |        |                     |
                     |  (older messages)   |        |  (newer messages)   |
                     |                     |        |                     |
   visible top ----> |- - - - - - - - - - -|        |- - - - - - - - - - -|
                     |                     |        |   X is typing...    |
                     | ...                 |        | ...                 |
                     | message i           |        | message i + 1       |
                     | message i + 1       |        | message i           |
                     | ...                 |        | ...                 |
                     |    X is typing...   |        |                     |
visible bottom ----> |- - - - - - - - - - -|        |- - - - - - - - - - -|
                     |                     |        |                     |
                     |  (newer messages)   |        |  (older messages)   |
                     |                     |        |                     |
                     +------[bottom]-------+        +------[bottom]-------+
2018-08-21 20:14:09 +02:00
Christophe Simonis ef6b574eda [MERGE] forward port branch saas-11.3 up to 6cc7d3f945 2018-08-21 18:48:13 +02:00
XavierDo 7f8ffba48e [FIX] mail: remove bolt on notification request
Since the title of a notification is in a t-esc, the style wont be applied
2018-08-21 17:55:27 +02:00
Christophe Simonis 6cc7d3f945 [FIX] web: correct test view option name 2018-08-21 17:36:34 +02:00
Christophe Simonis 70d0148d0d [MERGE] forward port branch 11.0 up to fbfb91799e 2018-08-21 16:58:17 +02:00
Alexandre Kühn 4fa071339a [FIX] mail: "is typing..." notification sticky top for DESC threads
Before this commit, the 'is typing...' notification bar was sticky
to the bottom of the thread, independently of the ASC or DESC mode
order of threads.

This is okay for ASC, but not for DESC: it should stick to the
visible top of the thread for DESC.

As a result, this notification bar was always at the top of the
thread, without the 'sticky' behaviour:

        +--------[top]--------+
        |   X is typing...    |
        |                     |
        |  (newer messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        |                     |
        | ...                 |
        | message i + 1       |
        | message i           |
        | ...                 |
        |                     |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (older messages)   |
        |                     |
        +------[bottom]-------+

With this commit, the 'is typing...' notification bar sticks
to the visible top of DESC threads:

        +--------[top]--------+
        |                     |
        |  (newer messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        |   X is typing...    |
        | ...                 |
        | message i + 1       |
        | message i           |
        | ...                 |
        |                     |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (older messages)   |
        |                     |
        +------[bottom]-------+
2018-08-21 16:57:51 +02:00
Alexandre Kühn 7e7e72edfd [FIX] mail: 'is typing...' notification bar next to composer.
Revision on https://github.com/odoo/odoo/commit/0eab8f6e0b17a4ff6a859d14b14b643212cbadc1

The commit above fixed the definition of ASC/DESC on the rendering
of mail threads.

However, the 'is typing...' notification bar was still partially
using the old definitions. As a result, this notification bar was
not sticking at the visible bottom of the thread when there were
few messages:

        +--------[top]--------+   <---- visible top
        | 1st message         |
        | 2nd message         |
        | 3rd message         |
        |    X is typing...   |
        |                     |
        |                     |
        |                     |
        +------[bottom]-------+   <---- visible bottom

This commit fixes the issue so that the 'is typing...' notification
bar is always at the bottom of the thread in such case:

        +--------[top]--------+   <---- visible top
        | 1st message         |
        | 2nd message         |
        | 3rd message         |
        |                     |
        |                     |
        |                     |
        |    X is typing...   |
        +------[bottom]-------+   <---- visible bottom

Note that it fixes the case with 'few messages', without altering the case with
'several' messages:

        +--------[top]--------+
        |                     |
        |  (older messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        | ...                 |
        | message i           |
        | message i + 1       |
        | ...                 |
        |                     |
        |    X is typing...   |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (newer messages)   |
        |                     |
        +------[bottom]-------+
2018-08-21 16:57:51 +02:00
XavierDo 2831fa7926 [IMP] core, test_mail: improve query count assertions
-remove margin
With the spirit of making tests determinists,
we can remove margins to have a real test of query count.

-mock random on assert query count
bus gc is triggered using random. Therefore, when send_many is called,
we have 1% chance to have more query. Mocking random.random to 1
will disable gc during query count tests (not during warmup).
Could be interresting to put gc collection in a cron latter

-add more info on querycount
Adding file and line number on query count failure/info will help to update
the query counts.

-update query count based on enterprise
Update all query count with enterprise values (exactly)

-normalize query counts with enterprise
voip module add a read on activity type (during create) in enterprise,
leading to one more query but also more information in cache.
Therefore, the next assertion will need one more query to access this data
in community.
Adding an access to activity type in the first assertion will allow
to have the same cache state in community and enterprise.

Task: #1878588
PR: #26476
2018-08-21 16:56:54 +02:00
David Arnold 0b72446340 [FIX] account: unproxy company currency
This indirection is the only place in the whole codebase, which indirects in
this way.

This block downstream code which relies on:
 - access to the line's company
 - while not necesarily having access to the account's company

(being line's company different than account's company)

Disclaimer: This use case is not officially supported.
However, this indirection does not make sense under the currently
supported model, neither.
2018-08-21 16:54:45 +02:00
David Arnold 7b492498eb [FIX] account_voucher: copy product in acc voucher (#26336)
* [FIX] account_voucher: copy product/qty from receipt to journal items

Before this commit, product_id and quantity were not passed
to the aml from account vouchers.

This caused inexpected behaviour, if products are a relevant dimension in cost
or revenue analysis analysis: Whereas on invoices, this product is copied to aml
on voucher, it is not.

Was PR #26336 . Courtesy of David Arnold (XOE Solutions)
2018-08-21 16:45:06 +02:00
qdp-odoo 0c34698c47 [FIX] account_voucher: unexpected error thrown when using a tax
In case of a sale receipt including a tax, the error 'cannot create unbalanced entry' was raised illegetimately. The reason was simply that the tax line was defining a debit instead of a credit.
2018-08-21 16:41:40 +02:00
Alexandre Kühn eea2366fd2 [FIX] web, mail, bus: no running services on top of tests
Before this commit, the web client in the JS tests environments
might be influenced by `longpolling/poll` or `mail/init_messaging`
RPCs. For instance, if we received a new direct message in Odoo
during some JS tests, it would open a thread window. As a result,
the tests on thread window will fail because of this newly and
externally added thread window.

After this commit, no service is deployed on the webclient on top
of the JS tests environment. This should prevent most undesirable
side-effects of RPCs, such as opening a thread window when receiving
a new direct message on the longpolling bus.
2018-08-21 16:07:30 +02:00
Christophe Simonis fbfb91799e [MERGE] forward port branch saas-15 up to 9cf0dbe226 2018-08-21 16:00:40 +02:00
Christophe Simonis 9cf0dbe226 [FIX] base_sparse_field: improve fields' view
Set default values when creating serialized field from contained field.
2018-08-21 15:12:16 +02:00
Nicolas Martinelli 65c2a9b70c [FIX] sales_team: default team is active
Check the default team is active. Moreover, make the return object type
consistent.

opw-1876966
2018-08-21 14:46:11 +02:00