Commit Graph
115299 Commits
Author SHA1 Message Date
Arnold Moyaux 17f5f74af9 [IMP] mail: redirect on mail activity
Allow to redirect on a form view when the user click
on a html tag a with data-oe-model and data-oe-id specified.

In order to avoid code duplication the do_action already existing in
mail_thread is moved in the action_manager and mail_thread and mail_activity
use a trigger_up in order to call it.
2018-02-01 15:26:59 +01:00
Arnold Moyaux 18d5b11cb4 [IMP] stock : log a note
The purpose of this commit is to create a generic method in order to
log an activity on following documents or on upstream documents in order
to avoid code duplication.

In order to use it, you have to:
- create a static method in order to generate the string
for the note (it will use an arguement with the format
{'dest_object': ['orig_obejct', (new_qty, old_qty)]}
- 'DOWN' to notify following document. In this case you
have to specify a groupby/sorted method.
- 'UP' to notify upstream document. In this case you have
to specify a specific method call
'_get_upstream_documents_and_responsibles' on the object to
ride up.

Log_activity's operating mode:
destination objects = self.stream_field(passed as arguments)
'DOWN' group destination objects by document on which we want
to log the activity and a responsible to assign.
For each pair (document, responsible) generate a specific note
with only the information relative to object that belong to the current
document. Once the note is returned, it logs the activity on the
document and assign the reponsible.
'UP' instead of sort and group runs the method
'_get_upstream_documents_and_responsibles'. For example on moves
this method is called recursively on all moves orig that are not done or
cancel until it can't find a valid one at this moment it returns its picking.
Then generate the note and log the activity the same way than 'DOWN'.
2018-02-01 15:26:59 +01:00
Arnold Moyaux a94d58fefe [IMP] stock: add tooltip for repsonsible_id 2018-02-01 15:26:59 +01:00
xmo-odoo c385f5f418 [FIX] base: correctly handle non-normalised domains in SSF
Turns out I'd kinda skipped that bit.

Fixes #22711
2018-02-01 15:24:38 +01:00
William Henrotin 373eb4bf42 [REF] purchase_requisition: separate PO for different BO.
If two blanket order are active with the same vendor, we have to produce
two separate purchase orders even if the two products are ordered in the
same operation.
2018-02-01 15:11:15 +01:00
William Henrotin 8b5401864d [REF] purchase_requisition: multi-currency support
If the parameter multi currency is enabled, the field currency is added
in the purchase requisition form. The currency chosen will be the one by
default in the PO attached to the BO
2018-02-01 15:11:15 +01:00
William Henrotin 1c458d9e99 [REF] purchase_requisition: PO creation from blanket order
If a there is blanket order in 'ongoing' state and linked with the purchase
order's vendor, we can choose associate it to the PO to retrieve the contrat
price and impact the ordered quantity.

If a purchase order is created from a blanket order, the vendor is
linked to the BO reference. So we forbid its edition once its choose.
2018-02-01 15:11:15 +01:00
William Henroin e85838d358 [REF] purchase_requisition: adapt sequence of supplierinfo
When creating a blanket order, it will generate a supplier info for the
associated product. If there is already a supplier info for the same product
and same vendor, the sequence should be adapted to take the one created via
blanket order before the other(s) one(s).
2018-02-01 15:11:15 +01:00
William Henroin b3ac2d2f48 [REF] purchase_requisition: new stages workflow for blanket orders
The stages workflow of purchase tender is not suitable for blanket order.
the steps bid selection is use only with purchase tender. Now :
PT : draft -> confirmed -> bid selection -> closed
BO : draft -> ongoing -> closed
2018-02-01 15:11:15 +01:00
William Henroin 87af05ae76 [REF] purchase_requisition: blanket order generate sellerinfo
The blanket order is a contract between you and a supplier on a
different
price (usually lower than normal) for a big quantity of some specific
products.

The goal is to generate a supplier info for each product of the blanket
order and
remove them when the BO is either closed or cancel.
2018-02-01 15:11:15 +01:00
William Henroin 7fea2292ce [REF] purchase_requisition: requisition type editable only in draft state
Purchase requisitions have two different type available : purchase tender
and blanket order. As the behaviours between these two types are very different,
the type is now locked once the requisition is no more in draft state.
2018-02-01 15:11:14 +01:00
William Henrotin 8d0be4059a [REF] purchase_requisition: sequence handling
When creating a draft purchase agreement, a reference number was generated even if
we do not click the 'Save' button.
Now, the reference is filled with 'New' at the creation and overided with a proper
reference number after clicking on 'Save'. Also, the prefix depends now of the
requisition type. BOxxxxx for blanket orders, TExxxxx for call for tenders.
2018-02-01 15:11:14 +01:00
William Henrotin d8d925d366 [REF] purchase_requisition: vendor mandatory in blanket order
The vendor is now a mandatory field in the blanket order form
because it's directly linked to purchase orders. So Odoo needs
to know to which supplier the PO is addressed.
2018-02-01 15:11:14 +01:00
Aaron Bohy 02ec09cb1c [REF][IMP] *: mail js refactoring
This commit improves the JS code of the mail module,
which comes maily from the new coding guidelines
and the addition of "JS services".

JS services are important objects that do not fit
well in the component tree, such as chat_manager
or ajax.

The benefits of JS services are improved readability
of the code, reduced coupling, and more testable
modules. In particular, discuss was hard to

Summary of the changes:

- ClientAction has been renamed into Discuss
- Clear instantiation of chatManager
- New coding guidelines in most mail modules
- JS Services can interact with each other
- Chat Manager and Window Manager are services
- Window Manager renamed to Chat Window Manager
- bus.bus is now encapsulated in Bus Service (a service)
- The test infrastructure has been tweaked with JS Services
- Chat Mixin has been removed

A future improvement would be to translate some 'trigger' into 'trigger_up'.
2018-02-01 14:51:58 +01:00
Alexandre Kühn 0cd656b5af [IMP] mass_mailing: onboarding
Lots of small usability improvements on the mass_mailing app.
2018-02-01 13:34:29 +01:00
qsm-odoo 126850e9bd [IMP] web: update bootstrap to 3.3.7
Before this commit the bootstrap version we used was inconsistent.
Indeed, the javascript files were the 3.3.4 ones and the less files
were the 3.3.5 ones. This was due to a failed merged resolution in 9.0.
This should however not cause any issue as the difference between
3.3.x versions are very minor.

Basically, this commit is more of a fix than an improvement and may
even be backported if we find reasons to do so. This commit is mainly
made to prepare the transition to version 4.0.0, which requires to
switch our LESS files to SCSS first (and it will be easier to go by
bootstrap 3.3.7 with SCSS files first).
2018-02-01 11:03:05 +01:00
Géry Debongnie 31a99ed5b7 [IMP] web: add better message in column quick create
This commit add a help message in the column to indicate that pressing
escape will discard the current column creation. Note that some JS had
to be added to make the message disappear when the input is no longer
focused. The reason is that the create column widget may still be visible when
the input is no longer focused (for example, because the user clicked on
the fake records, or clicked on the example link)
2018-01-31 16:46:56 +01:00
Joren Van Onder 079a13a349 [IMP] analytic: in-depth refactoring
* analytic accounts can be shared among companies
* amount on analytic lines always refer to amount in company currency of which it belongs to
* add analytic groups (hierarchical way to classify analytic accounts)
* analytic tags:
- only present on analytic lines, not anymore on analytic accounts
- can be used to distribue/split an analytic lines among several analytic accounts
- enabled by a dedicated res.group
- added on several objects (vouchers, expenses, analytic defaults...) as well as in bank statement reconciliation widget (manual counterpart and account.reconcile.model)

* bunch of fixes made related to analytic

Was PR #22124. Was task 32386. Original work by tbe.
2018-01-31 15:53:04 +01:00
Gorash cd30db60e6 [IMP] web: allow to use m2m_tags outside a form view 2018-01-31 15:53:04 +01:00
Simon Lejeune a37932b9be [MERGE] stock, mrp, repair: traceability report improvements
- remove the upstream/downstream logic, always display the most recent
  move at the top and the least one at the end
- color in move in green, out move in red
- better integration with repair and mo
- when trying to drill down an untracked component, don't display all
  the possibilities
- few usability fixes overall

Closes #19737
task 36338
2018-01-31 14:15:42 +01:00
Haresh Shyara 68061e2517 [IMP] stock, mrp, repair: optimization traceability report based on stock move lines
- Optimized _lines() to fold/unfold mechanism and use stock move line in get lines.
- Merged into single method (make_dict_move and make_dict_head) to get parent & child traceability result
  and use unfolfable to make line unfoldable.
- Removed _get_produced_or_consumed_vals method and move mechanisam into _line method will do same for this.
- Make some methods private.
- Removed useless vals from dict.
2018-01-31 14:15:00 +01:00
Haresh Shyara 476ebd08d7 [IMP]stock: lot_serial number clickable on traceability report
- click on lot/serial number directly send to the traceability of that SN
2018-01-31 14:15:00 +01:00
Haresh Shyara 23ab8019c0 [IMP] stock: improve unbuild order traceability
- Traked component in case of consumed in.
- removed unused get_traceability method to move michanism into _lines()
2018-01-31 14:15:00 +01:00
Haresh Shyara 4d77748e76 [IMP] stock: set text color on report line
- Outgoing moves should be in red (if going out of the stock).
- Incoming moves should be in green (if entering the stock).
- Internal moves should be in black.
- No lines in bold anymore in the report.
2018-01-31 14:15:00 +01:00
Haresh Shyara 05305729ee [IMP] mrp: moved 'Traceability: Lots' menu into Master Data
- Renamed 'Traceability: Lots' to 'Lots/Serial Numbers'
2018-01-31 14:15:00 +01:00
Haresh Shyara 776457fee9 [IMP] stock: set text align left in PDF report header 2018-01-31 14:15:00 +01:00
Haresh Shyara 276e7ac769 [IMP] stock: scroll in traceability report 2018-01-31 14:15:00 +01:00
Haresh Shyara a88bb28ad5 [IMP] mrp: added production_id in vals when generate consumed move lines 2018-01-31 14:14:59 +01:00
Haresh Shyara 0a9c5c9aa5 [IMP] stock: open traceability report from picking
- Make lot/serial number is clickable to open traceability report
2018-01-31 14:14:59 +01:00
Haresh Shyara 827beb9662 [IMP] mrp: added stat button on MO to open Traceability Report
- Remove some reusable code in get_lines()
2018-01-31 14:14:59 +01:00
Haresh Shyara 523092e6f4 [REF] stock: renamed 'UP/Down Stream traceability' to 'Traceability Report 2018-01-31 14:14:59 +01:00
Haresh Shyara 8de1e54f65 [IMP] stock: added button on components to switch report on finished product 2018-01-31 14:14:59 +01:00
Haresh Shyara 387c441f7c [IMP] stock, mrp, repair: get linked consumed or produced lines for this operation
- When unfold down MO, Repair Order, Unbuild Order to display produced or consumed materials even product is trackable or not.
- Normal products(not trackable) are directly displayed with source and destination not foldable.
- Unfoldable line has no caret icon to unfold, so move it to margin-left 15px to make parellel.
- Invisible source and destination location on head lines if product trackable.
2018-01-31 14:14:59 +01:00
Haresh Shyara acd0254d48 [IMP] stock: clickable reference on traceability report
- make all references clickable for all model and remove unused code.
2018-01-31 14:14:59 +01:00
Haresh Shyara 5fcbc116f1 [REM] stock: removed upstream and downstream traceability in report 2018-01-31 14:14:59 +01:00
Haresh Shyara 90333dc0a4 [IMP] stock: added and arrange some columns on traceability report 2018-01-31 14:14:59 +01:00
Haresh Shyara 53ac302eab [REM] stock: removed stock_quant on traceability report 2018-01-31 14:14:59 +01:00
Martin Geubelle 5d463d2c03 [FIX] base: correctly delete required many2one
In the transient model 'Change Password Wizard User', the many2one
`wizard_id` was not set as ondelete cascade even though this field was
required.

This was causing issues in the auto-vacuum cron if by chance this model
was cleaned up before the wizard ('Change Password Wizard').

Courtesy of @rco-odoo

Issue #813289
2018-01-31 14:12:53 +01:00
Yenthe V.G 897b84b37b [IMP] base: remove deprecated colors tag
Cleaning leftovers

Closes #22678
2018-01-31 13:55:26 +01:00
Haresh Shyara f003216f74 [IMP] l10n_ch: removed taxes using deprecated rates
- Removed old taxes of sales and purchase with percentage 8 and 3.8 that cannot be used anymore since 2018

Was PR #22040. Was task 39836
2018-01-31 12:05:43 +01:00
Thibault Delavallée d19195de0d [DOC] test_mail: update performance counters after last commits
Commits improving performance counters related to mailing

 * introduction of message_log (https://github.com/odoo/odoo/commit/8ddca6f95a52d36c4a8731dcf93413e8206dce81) and its application in
   the mail_thread (https://github.com/odoo/odoo/commit/99be64dc174af9ad7eb739575215aa03260e833b and https://github.com/odoo/odoo/commit/74ec8a95a0f7b1aadd847a728b4d9bc24daca495). This
   commit has a big impact on the runbot installation query count (110K on 700K, about 15%);
 * moving templates from mail.templates to qweb (https://github.com/odoo/odoo/commit/2f7593761c1ea432e2e58045150150356816f868). This
   merge has an impact on the runbot installation query count (10K on 680K);
 * removing (un)follow buttons in notification emails (https://github.com/odoo/odoo/commit/11d2d30e91758baaa9c6241a86f97ae3dfe52ad2).
   This commit has an impact on the runbot installation query count
   (8K on 690K);
 * removing 'always' tracking option, meaning less tracking values are
   created when writing on a record (https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da). No impact is given
   as it is mixed with another commit that decreases performances.

Commits decreasing performance counters related to mailing

 * adding the discussion subtype consideration in data send to the bus
   (https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da). Future improvements will come that improve bus
   management in chatter and channels.

Apart from those commits there are several commits notably from @rco-odoo
that improves performances that are not listed here.
2018-01-31 11:44:22 +01:00
Thibault Delavallée 74ec8a95a0 [IMP] mail: make tracking without subtype a notification log (note)
This message is not linked to any real subtype and will never be notified
to someone. It creates a notification with subtype note. It is however
different from user-created notes and should not be propagated.

Tracking triggering subtypes are managed differently as they have a
business related meaning. It makes sense to notify them to followers.
2018-01-30 17:22:12 +01:00
Thibault Delavallée 99be64dc17 [IMP] mail: make 'Doc created' message a notification log (note)
This message is not linked to any real subtype and will never be notified
to someone. It creates a notification with subtype note. It is however
different from user-created notes and should not be propagated.

New record creation suck as new task or new ticket are linked to subtypes
people can follow and defined in their own module.
2018-01-30 17:22:11 +01:00
Thibault Delavallée 8ddca6f95a [IMP] mail: introduce _message_log as shortcut when logging notifications
This commit introduces _message_log to use when logging notification-based
notes on a document. Its main purpose is to provide a shortcut to the
complex mechanism of message_post. As it is a lighter code and as it
performs less checks and value computation it allows to clearly gain
queries when logging notes.

It does

 * skip the notification process completely. Side effect is that followers
   following note subtype are not notified of document created and pure
   note tracking. This is considered more as a fix than a feature change.
   Indeed following notes means that followers want to receive notes
   logged by other users. The fact that system notifications without a
   specific subtypes are also notes is a side-effect of the current
   implementation;
 * support only notification-based notes and should not be used currently
   when logging real notes as those could trigger the notification
   process;
 * skip access rights checks as it creates the message as superuser. It
   is therefore defined as a private method and should be called within
   a method where access rights are already granted;

On community runbot installing all 203 modules takes 580K queries instead
of 690 at the time of testing. It is a 15% performance increase based on
the 'all modules installation' metric.

In a distant future message_post and message_log could be merged after
some cleaning but it is easier currently to have this shortcut available.
Moreover as there are clouds on the mail module some developers prefer
to already have some optimization and code cleaning done to avoid
loosing all their hair.

This commit includes a small test. In a same distant future more tests
will probably be added depending on how mail API evolves.
2018-01-30 17:20:45 +01:00
stefanorigano 139737dbeb [IMP] web: tables :hover state
Properly style table’s rows ‘:hover’ state to let people understand
that it’s clickable
2018-01-30 16:09:04 +01:00
Xavier-Do c99de45515 [IMP] chatter: improve chatter readability
Only messages as comments and email template should keep a white backround since they are not internal.

It is also enough to display fields that changed on subtypes (update message) since emails will be reworked soon and more information will be given there. The support of 'always' track can be removed. (is now considered as a simple tracked field)

The use of self.env.ref('mail.mt_comment').id add some query and the performance tests needs to be update since message_format is called by notify_by_chat. This code will be refactor later
2018-01-30 14:49:03 +01:00
Thibault Delavallée ba5133dc63 [IMP] mail: add two performance tests
This commits adds two tests in test_mail performance tests related to
the write operation. Indeed create a often tested but there are less
performance tests related to the write. Those two tests are

 * first one is a simple write on a chatter-enabled model without any
   tracking or specific feature; nothing should happen when performing
   a write in that kind of model;
 * second one is a write on a complex tracking-enabled model linked to
   templates and auto subscription. It allows to have some figures for
   real world use case.
2018-01-30 14:23:04 +01:00
Xavier-Do 3ac2e42a3a [IMP]portal: remove is portal flag
The is_portal flag was used before to define if a group is a portal group. This is not true anymore since the default portal group should be used for this purpose. All logic associated to this flag can be removed.

TASK: 47937
2018-01-30 11:43:33 +01:00
Thibault Delavallée f408fffbc0 [DOC] test_mail: update performance counters after last commits
Due to last commits that aim at improving Odoo performance all complex
tests of test_mail now take less queries to execute. Counters are
updated to match the current runbot behavior.

There is quite a big improvement when posting using a template compared
to other tests. As there are not enough tests to ensure all results
are correct let us stay careful by saying "it seems there are
improvements".
2018-01-30 10:42:55 +01:00
jem-odoo 8f94e542e3 [MERGE] sale,sale_*: computation of delivered quantity on sale line
This commit refactors the computation of the delivered quantity
on sale order line, using a computed field and a manual field.
This quantity is automatically computed when using stock moves,
timsheet or expenses (through analytic line).
This simplify code, avoid having trigger in `create` and `write`
method of many models, ...

Once this big clean done, we wanted to go futher and clean the
reinvoice flow for analytic line (vendor bills and hr expenses)
by :
- using the reinvoice policy has it should be
- flagging sale order line generated from expenses
- clarify 'reinvoice policy' and 'can be expensed' fields usage
- erase some usability issues (with onchanges and views reoganization)

This commit also add tests suites for reinvoice flow, and
delivered quantity computation.

See sub commits for more details.
Thanks @rco-odoo for the onchange fix, and @tde-banana-odoo for its
review.

Task 40226
2018-01-30 09:20:41 +01:00