Commit Graph
126133 Commits
Author SHA1 Message Date
Florent de Labarre 4206aba48b [FIX]product: force_company doesn't work to get property
When forcing the company C in the context, the company C was not
taken into account in function _get_partner_pricelist

opw:1861989
2018-07-04 16:24:17 +02:00
Shubham Johar 26d384ef61 [FIX] website: leave 'create screen' when click outside
The purpose of this commit is to hide the Create menu when the user click on
any area other than the link icons.

Note: It was already the case in V10.0 since the options were inside a modal.
      Natively bootstrap would close the modal when clicking outside of it.
      We lost that behavior while refactoring in V11.0 with 297297696 that
      replaced the modal by a pseudo-dropdown

opw-1860196
Closes #25389
2018-07-04 16:04:00 +02:00
sed-odoo f56ad6daf8 [IMP] base,*: Improve the res.partner form view UX
Purpose
=======

The Contact form is one of the most used/important view. It is quite
important to find the piece of information easily and to navigate in
a few clicks to the related views.

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

Stat buttons
------------

- Restructure stat buttons with the following order:
Opportunities  -> sales user
Meetings    -> sales users
Sales    -> Sales users
POS Sales -> pos users
Subscriptions   -> Subscription users
Events    -> event user
Tasks -> project user
TIckets -> helpdesk user
Purchases   -> purchase user
Due -> billing: user
Invoiced     -> billing: user
Vendor Bills -> billing: user
Customer/Vendor Partner Ledger -> accounting: billing
Analytic Accounts -> accounting: billing
Credit Cards -> sales user
Direct Debit Mandates -> accounting: billing user
Publish
- Use better/more relevant icons
- Check that the proper access rights are set
- Remove the bank accounts stat buttons and replace it by a one2many
  tree on the Invoicing page.

Fields
------

Move some res.partner fields from the "Accouting" page to the
"sale & Purchase" page:
- Fiscal positions
- Payment terms

Miscellaneous
-------------

- Remove dead code.
- Display nothing instead "Please complete customer's informations and email"
  on the popup when sending an email to a contact without email address.
2018-07-04 15:43:25 +02:00
Pierre Masereel 4edcc1f322 [FIX] stock: package location only in multi location
When we open the form view of a package_level, the location_id and
location_dest_id fields are visible evene if multi location is not
enabled on the database. We add the corresponding groups to avoid such a
behavior.
2018-07-04 14:54:57 +02:00
Pierre Masereel eae6ce7b6b [FIX] stock: move lines attributes on package_level
When you see move lines in a package level, the lots and owner are not
displayed, we added them in the view.
2018-07-04 14:54:57 +02:00
Ankit Joshi 47384a4244 [FIX] stock, delivery: picking fields readonly when cancelled
When a picking is cancelled, most of fields must be readonly it was
remaining some that were not. We fixed them here.
2018-07-04 14:54:57 +02:00
Pierre Masereel 94dec61301 [FIX] stock: move lines readonly when in entire package
When a move line is in an entire package and the entire package option
is enabled, you shouldn't be able to modify them in the move form view.

So we make all fields of the move lines readonly when it has a
package_level_id and its picking_type has 'Show entire package' option
enabled
2018-07-04 14:54:57 +02:00
Pierre Masereel 63a98846b1 [FIX] stock: quant_package unpack
When you unpack a quant package, you have to invalidate the reservation
on the move lines reserved on this package and then remove the quants
from it. We need to do it as sudo because, no one has rights on quants.
2018-07-04 14:54:57 +02:00
Pierre Masereel 64b67c7f91 [FIX] stock, delivery: packaging_id displayed in delivery
The field 'packaging_id' of quant package was displayed in tree view,
even if it was impossible to fullfill it because it is added in the form
in module delivery. So the field in the tree view is moved in the module
delivery to be shown whan you can set it.
2018-07-04 14:54:57 +02:00
Pierre Masereel 4308c5fa02 [FIX] stock: error message typo 2018-07-04 14:54:57 +02:00
Pierre Masereel 7a46cf5021 [FIX] stock: hide put in pack button when picking draft 2018-07-04 14:54:57 +02:00
Darshil Trivedi 1b9ec90490 [IMP] stock: improve backorder message.
This commit is related to task ID 1860538.
2018-07-04 14:34:39 +02:00
Darshil Trivedi 436c95baef [IMP] stock: remove useless filter
Inventory report list all products in stock and the available quantity.
By default, the list is filtered on "stockable product". This filter is
useless as only stockable product are listed in the report.

This commit is related to task ID 1860538.
2018-07-04 14:34:39 +02:00
Goffin Simon 30ede6a16a [FIX] pos_sale, sales_team: Timezone problem in dashboard graph
The function _get_graph computing the dashboard graph must take the timezone of the user
into account to compute the right start_date S and the right end_date E.

The query  made on model 'report.pos.order' by read_group in _graph_data must take the
timezone of the user into account to substract the right offset to compute the start_date S
and end_date E in UTC because the result returned by read_group is formated in the timezone
of the user afterwards.

Example:

In function _get_graph:

Start_date in 'Asia/Ulaanbaatar' timezone = 2018-06-05
End_date in 'Asia/Ulaanbaatar' timezone = 2018-07-04

So End_date - Start_date + 1 = 30

In function _graph_data:

Start_date in 'Asia/Ulaanbaatar' timezone = 2018-06-05 00:00:00
End_date in 'Asia/Ulaanbaatar' timezone = 2018-07-04 23:59:59

So in UTC -9 hours:

Start_date in UTC = 2018-06-04 15:00:00
End_date in UTC = 2018-07-04 14:59:59

SELECT min("report_pos_order".id) AS id,
       count("report_pos_order".id) AS "date_count" ,
       sum("report_pos_order"."price_total") AS "price_total" ,
       date_trunc('day', timezone('Asia/Ulaanbaatar',
       timezone('UTC',"report_pos_order"."date"))) as "date:day"
FROM "report_pos_order"
WHERE (((("report_pos_order"."date" >= Start_date)  AND
      ("report_pos_order"."date" <= End_date))  AND
      ("report_pos_order"."config_id" in (1,2,3)))  AND
      ("report_pos_order"."state" in ('paid','done','invoiced')))
GROUP BY date_trunc('day', timezone('Asia/Ulaanbaatar', timezone('UTC',"report_pos_order"."date")))
ORDER BY "date:day"

And the result of this request will be between 2018-06-05 00:00:00 and 2018-07-04 23:59:59 but
before the fix the result was between 2018-06-05 00:09:00 and 2018-07-05 08:59:59 and then
End_date - Start_date + 1 was equal to 31. That's why a "IndexError: list index out of range"
can be raised in _get_graph.

In this way, no mismatch is possible between the datas computed by _graph_data and the dict
"values" allocated by _get_graph.

opw:1862996
2018-07-04 13:21:46 +02:00
Goffin Simon ab5fcb2965 [FIX]purchase: A duplicated shipment is not associated with the original PO
When duplicating a shipment, the shipment was not linked to the original PO.

opw:1854387
2018-07-04 11:42:41 +02:00
Mykhailo Panarin 80b325bbb2 [CLA] create mpanarin
Backport to 9.0 of #23708

Closes #25595
2018-07-04 10:58:44 +02:00
Olivier Dony 43e4d63d06 [IMP] mass_mailing: add missing indexes
These two columns are used to compute the mailing statistics, to be
displayed in the kanban dashboards. Adding them makes the dashboards
a lot faster on large databases (e.g. a few milliseconds instead of
several seconds)
2018-07-04 10:16:38 +02:00
Olivier Dony a5edf6e0f3 [IMP] mass_mailing; speed up kanban view
The kanban view displays mailing statistics for all mailings that are
sending or done. To compute these statistics, it uses the `total` as the
expected number of emails to send. This `total` used to be computed as
the number of records matching the mailing filter.
This is both slow (filters are seldom written in an optimized way), and
incorrect because the recipients were frozen when the email was sent.
The number of matching records may have changed since then.

To fix both problems, introduce a new `expected` computed field that
simply returns the number of emails that were put in queue at the time
of sending, and thus represent the real number of expected emails.
This field is computed along with the rest of the statistics.
2018-07-04 10:11:32 +02:00
Olivier Dony c1de5b8419 [IMP] mass_mailing: simplify read_group column expansion
The framework supports a special `group_expand` attribute on fields,
to provide a helper method that expands the list of columns in a
read_group (typically meant to display empty columns in kanban views)
See rev. 580e78ad37

More efficient, and less code.
2018-07-04 10:11:32 +02:00
Maulik Raval 578edc0458 [CLA] signature for maulik-raval
Closes #25489
2018-07-04 10:08:44 +02:00
kujiu f90cf060a3 [FIX] Syntax of icons (#25577)
Description of the issue/feature this PR addresses:

Accessibility improvements forbids the use of the syntax
`<i class="fa fa-check"/> Some text`
to create a labelled icon. But, by this, some fonts are changed.

Desired behavior after PR is merged:
The old syntax can be used.
2018-07-04 09:55:52 +02:00
Lucas Perais (lpe) daedcd92e3 [FIX] web: mock fieldsViewGet don't delete raw attrs
Have a view with a field as:
<field name="stuck_in_the_middle" attrs="{'readonly': [('with_you', '=', False)]}"/>

Before this commit, the contents of attrs were parsed and merged into the modifiers
and the attrs attribute of the node was deleted
which might cause divergence between reality and tests

After this commit, the mock server does what the server does in this case

closes #25583
2018-07-04 09:28:04 +02:00
RomainLibert 2d8ba22b4e [FIX] hr_holidays: add a constraint on interval numbers
Before that commit we could ask for an accrual allocation of 0 hours
every 0 weeks for instance.
As it means nothing to ask for this, we add an sql constraint on these
fields and a default value of 1.
2018-07-03 17:19:00 +02:00
Toufik Benjaa 000bcd7c1e [FIX] survey: Remove the deadline constraint
- The deadline constraint is causing issues to the appraisal module.
  It causes appraisals not being able to be sent with a deadline set on the past.
2018-07-03 15:26:02 +02:00
Cedric Snauwaert 775fbcda35 [FIX] account: fix select partner problem in reconciliation widget
Problem: create a bank statement with a line that has a positive amount
and a line that has a negative amount. Both line does not have a partner
Then click on reconcile to open the reconciliation widget, notice the
message stating that we have to select a partner or choose a counterpart.

Select a partner on both line, behavior is different for the line with
credit > 0, the message still says "select partner or choose counterpart"

This commit fixes this problem.
2018-07-03 13:42:49 +02:00
Adrian Torres ad0f8fd0b7 [IMP] ir_actions: let server actions be run from UI
Now, when setting a server action's model to `ir.actions.server`, a
button will appear that will allow the user to immediately run the
current server action.

Task ID 1850663
2018-07-03 11:14:19 +02:00
Adrian Torres bca2926b01 [FIX] base: properly unlink child views
Before this commit:

* Install module A
* Edit a view from module A, add a custom field
* Uninstall module A
* Reinstall module A
* Try to access the module A's previously modified view
    -> Can't access the view, or even sometimes the app at all.

Cause:

When uninstalling module A, the custom field added to module A's is
properly unlinked, however the custom/studio view is not unlinked, therefore
the view references a field that no longer exists, when accessing the
view it will obviously crash (sometimes the traceback is not even
displayed to the user!).

Solution:

Emulate an ondelete cascade for child views only when in uninstall mode.
2018-07-03 11:11:25 +02:00
Simon Lejeune d5efba2561 [FIX] report: avoid local file resources
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
2018-07-03 10:53:42 +02:00
Odoo Translation Bot 7cf29f04be [I18N] Update translation terms from Transifex 2018-08-01 02:42:16 +02:00
Florent de Labarre d3b42bd98f [FIX] account:with -0.0 amount_total it raised
Steps to reproduce the bug:

- Create an invoice with positive lines and negative lines and with a total equal to zero

Bug:

In some cases total amount is equal to -0.0 and it raised:
"You cannot validate an invoice with a negative total amount"

The field amount_total is a monetary field, so it's computed in the precision
of the currency of the invoice.

opw:1862439
2018-07-03 10:37:10 +02:00
Romain Derie 96a293f55e [IMP] sale, website_quote: default value in settings & templates
Commit 2fa469c5e5 implemented the possibility to sign and pay (one after the
other) a sale order to validate it.

The option to sign and/or pay is activated in the sales settings but can be
overrided by a template.

Two improvements needs to be made:

1. Creating a new template should use the sale settings as default value for
   sign and pay confirmation mode.
   Note: If none has been enabled, sign should be forced.
2. Default value in sale settings should remains as it was before, nothing
   activated by default.

opw-1818837 (Added specs with fgi)
2018-07-03 09:58:17 +02:00
Goffin Simon af36063de3 [FIX] web: Email attachment issue
Steps to reproduce the bug:

- Go on a SO and click on "Send by email"
- Remove the attachment and click on "Add an attachment"
- Choose an attachment A and remove it by clicking on the cross
- Click on "Add an attachment" and choose the attachment A

Bug:

The attachment didn't appear in the modal.

opw:1862482
2018-07-03 09:46:42 +02:00
Christophe Simonis c6010258a7 [MERGE] forward port branch saas-11.4 up to a0c5b58d5d 2018-07-02 16:33:39 +02:00
Martin Trigaux 055a8828c4 [FIX] base: remove oudated filter
There is no reason to prevent creating a menu linked to a top menu
It does work to have only one parent level as a menu

Error reported during technical training
2018-07-02 15:47:49 +02:00
Christophe Simonis a0c5b58d5d [MERGE] forward port branch saas-11.3 up to 4846c30c90 2018-07-02 15:16:20 +02:00
Aaron Bohy 64d3271cc0 [ADD] im_support: test suite
This revs. add a new test suite for the im_support module. Defining
a new suite was necessary as the im_support JS feature needs
specific keys to be defined in the session, otherwise its files are
simply skipped.
2018-07-02 15:12:31 +02:00
Aaron Bohy bdf78aa9db [FIX] mail: tests: move utils in correct bundle
Those test utils files should be in the test assets bundle such
that they are available for potential other test suites (e.g. the
new im_support suite).
2018-07-02 15:12:31 +02:00
Aaron Bohy 01bf6f4383 [FIX] im_support: support message init()
Service calls only work when the parent and event dispatcher mixing is set.
In this case, this is after the `_super` call.
2018-07-02 15:12:31 +02:00
Alexandre Kühn ed79f533a6 [IMP] mail: open document threads in thread windows
Also roughly called "open chatter in chat windows".

With this commit, document threads can now be detached in a small thread window.
It uses client-side cross-tab window synchronization by means of the local storage.

To detach a document thread in a thread window, click on the document thread preview
in the systray messaging menu when receving a new (needaction) document thread message.

-------------------------
  Technical Limitations
-------------------------

  1. In order to use this feature, the user must select the Notification Management
     'Handle with Odoo' in the Preferences of the User settings (top-right menu).

  2. For the moment, only needaction messages automatically updates the thread window. Manual
     refresh is still needed for other kinds of messages (e.g. reload document record to fetch
     new messages in the document thread).

Server-side code changes are required to receive new document thread message notifications on the
longpoll bus, which would fix the limitations above.

-------------------------
  Future Works
-------------------------

  1. Receive any new message from the document thread window when it is detached.
  2. Log a note from the document thread window.

Task-33118
2018-07-02 15:12:31 +02:00
Alexandre Kühn cd34f6de72 [REF] mail: JS mail refactoring
----------------------
 Summary
----------------------

The purpose of this commit is to improve the JS code of the `mail` module.
It applies the new coding guidelines and makes some changes on the design
of some modules, such as the old ChatManager module.

Here is a short summary of the changes that have been made:

  1. New coding guidelines
    - snake_case to camelCase
    - prefix private attributes and methods with '_'
    - jsdoc on most methods
    - one class per module
  2. Rename/Merge some classes
    - 'chat manager' becomes 'mail manager' (internal) and 'mail service' (external)
    - 'chat window manager' is now included in mail manager
    - 'thread' widget now named 'thread widget'
  3. New model abstraction for mail objects:
    - modules 'mail.model.*'
    - modeling:

                    0..1    0..1        *     *
      ThreadWindow  <------>  Thread <-------> Message
                              /    \
                             /      \
              Thread With Cache     Document Thread
               /      |       \
              /       |        \
        Mailbox    Channel    Support Channel
                      |
                      |
                      DM

    - Thread: the superclass of threads.
    - ThreadWindow: the window component of a thread.
    - Message: mail objects representing messages.
    - Thread With Cache: threads that can be used with search view (Discuss app compatible).
    - Document Thread: represents the thread part of a chatter.
    - Mailbox: represents what was previously called 'static' channel, e.g. 'Inbox'.
    - Channel: mail objects representing channels, including livechat.
    - DM: special kind of Channel for 1:1 communication in the backend.
    - Support Channel: special channel for im_support module.

  This new modeling approach let us easily add features on all threads, such as the
  possibility to put any thread in a small window.

----------------------
 Known issues
----------------------

 [Already Present in Master]

    1. When the Discuss app is in the background with 'Inbox' as the selected
       Thread, when clicking on a document thread preview in the messaging menu
       of the systray, the rainbow man appears.

    2. When a document with the chatter is in the background, when receiving an
       inbox notification from this document thread, the document thread is
       automatically marked as read, which removes the notification right away.

    3. Sometimes, opening a DM window from the "blank" thread window does not work.

    4. Reply-to feature on Inbox is not working: no message is sent in the document
       thread.
    5. On the first login of admin user with demo data, the inbox counter is wrong
       (it displays 6, instead of 3).

       Explanation after investigation:

        > On page load, it fetches the correct number of Inbox messages (3),
          but the server notifies of 3 needaction messages right away,
          so it wrongly assumes these are new needaction messages.
        > Not possible for web client to detect that these messages should not
          increment the Inbox counter while keeping same API.

    6. Notifications for new document thread messages only work when the user sets
       'handle with Odoo' for the Notification Management in the preferences.

        > due to notifications on the longpoll bus for document thread
          messages that come from needaction notifications.
        > requires server-side changes to send notification on the longpoll
          bus to mentionned user.

  [New]

    7. When receiving a message on a unjoined channel, thread window flickers
       ('open' > 'close' > 'open')

        Explanation after investigation:

          > JS logic:

            a) On auto-join, ask server to join the channel and get channel infos.
            b) The info tells the channel is not detached, but JS code makes decision
               to detach it, and tells server the channel is now detached.
            c) From (a), server notifies on longpoll bus the state of channel, which is
               not detached. The web client thinks that the window state of the channel
               has been changed somewhere else, and the channel is now closed.
            d) From (b), server notifies on longpoll bus the state of channel, which is
               detached. The web client opens the thread window of this channel.

          > The flicker didn't occur before refactoring because the web client was only
            updating the model of channel when it receives the longpoll notification.
          > Server behaviour on 1st longpoll notification is necessary for cross-tab
            synchronization for channel window state.
          > New design implies that model and view should be synchronized, hence the
            issue now.
          > Solution: remove server-side thread window synchronization and replace with
            client-side synchronization.

----------------------
 Hacks
----------------------

The module `im_livechat` now uses mail objects that are compatible with Message
and Window objects:

      Modeling for messages:

                             AbstractMessage
                              /           \
                             /             \
                    LivechatMessage      Message

      - AbstractMessage: message compatible with the thread widget.
      - LivechatMessage: message used by im_livechat.
      - Message: message used with the mail manager.

      Modeling for thread windows:

                          AbstractThreadWindow
                              /           \
                             /             \
                    LivechatWindow    ThreadWindow

      - AbstractThreadWindow: behaviour share between all types of thread windows.
      - LivechatWindow: window used by im_livechat.
      - ThreadWindow: window used with mail_manager.

The reason for these hacks are twofold:

  1. Use the thread widget in the frontend and livechat external lib bundles.
  2. Do not have a dependency with the mail manager in the frontend and external
     lib bundles.
2018-07-02 15:06:54 +02:00
Christophe Simonis 4846c30c90 [MERGE] forward port branch saas-11.2 up to 611c86dbc7 2018-07-02 15:02:48 +02:00
Goffin Simon 44bd29fc84 [FIX] mrp: quantity_done with tracked products
Steps to reproduce the bug:

- Create 3 stockable products P1, P2, P3
- P1 is tracked by serial numbers
- Create a BOM for P3 with one P1 and one P2 as components
- Set the quantity on hand to 5 for P1 and P2
- Create a MO for P3, produce it and mark the MO as done
- On the MO in the sheet "Consumed product", the quantity_done for
P1 and P2 are equal to 1.0
- Change the tracking of P1 to "No tracking"

Bug:

- Check the sheet "Consumed product" on the MO and the quantity_done
was equal to 0.0 instead of 1.0

opw:1856340
2018-07-02 14:38:28 +02:00
sri-odoo ee9c1f52c3 [FIX] account: reconcile screen, btns alignment 2018-07-02 14:32:39 +02:00
MOENS Alexandre 45117f0287 [FIX] Project : Changing data & views loading order
This changes the order in which the data and the views are loaded.

Caused a problem in some fringe cases.
Install then uninstall project, playing around with discuss, when reinstalling project ,
system is trying to notify a partner and the weird order
in which the data and the views are loaded makes it bite the dust

opw:1861157
2018-07-02 13:12:03 +02:00
Romain Derie 8bd520fc30 [FIX] sale: no static terms in mail template
Forward port 49edee1f4b broke commit 2fa469c5e5
Indeed, the mail template got fixed with 5940f41ddc in earlier version.
Mail template should not integrate static term

Closes #25561
2018-07-02 12:52:44 +02:00
Goffin Simon de61d17252 [FIX] mrp: Adding a stock move line when creating a raw material
In stock.move.lots.form view, the field product_uom must be readonly like
the field product_uom_qty.

Fine tuning of this commit: 2ab3fa86fe

opw:1861321
2018-07-02 12:37:55 +02:00
Romain Derie 683b0746be [FIX] sale_payment: Pay Now was always hidden in SO panel-heading
Since refactoring of account, payment and sale with commit 01216345 the
`Pay Now` button in the panel-heading of the SO in the portal was always hidden
except if there was a pending transaction.

The button should be visible when there is no transaction. In that case
`payment_tx_id` is an empty recordset, we can safely access its `state` field.

Closes #25529
2018-07-02 12:24:22 +02:00
Christophe Simonis 611c86dbc7 [MERGE] forward port branch 11.0 up to 21b2617d6f 2018-07-02 12:17:00 +02:00
qdp-odoo 2e074a2780 [IMP] account: keep numbering of reset-to-draft payments
Was github issue #25441
2018-07-02 10:38:31 +02:00
Xavier Alt 21b2617d6f [FIX] account: show statement line info popover on reconciliation widget
This popover is the only way to get extra information like the note or the reference of the bank statement line.

Was PR #25543
2018-07-02 09:40:45 +02:00