Commit Graph
111044 Commits
Author SHA1 Message Date
Mehul Patel 19b1262109 [IMP] website_sale : Remove deprecated hidden product attribute type on product variants
Purpose
=======

Hidden mode on product attributes (variants) is deprecated
Beforehand it was used to not show the attribute name  in the order (in case of single attributes). Now it's automatic: if only one value for a product attribute, this value doesn't show up in the product name.
see support ticket 744129

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

remove it
2017-07-19 17:07:43 +02:00
Dhawal Limbuwala ee9b3e0d0c [IMP] delivery: notification email for shippings
When an order is shipped, a notification email is sent to the customer.
If there is a tracking URL, it is included in the email.

(and also a bit of refactoring)
2017-07-19 15:02:16 +02:00
Thibault Delavallée f858cea1fa [REM] website_portal: remove custom panel template
This custom panel should allow to add custom content. However it is neither
necessary neither used anywhere. Let us drop it.
2017-07-19 14:54:53 +02:00
Mahendra Barad 64027f3555 [FIX] mail: fix wrong adjustment in the chat window
In the chat, there is an indication of when a message was sent,  This indication gets updated as time passes. When the last one in the conversation is updated to an indication that takes more space (e.g. from 'now' to 'a minute ago'), the text below is pushed lower (as expected) but the chatter does not scroll down. As a result, we do not see new messages, unless manually scrolling down.
(PR #17469)
2017-07-19 11:47:47 +02:00
Jigar Patel 6651016ed0 [FIX] web: Groupby not working on Pivot and Graph view
The groupby property was wrongly set in some cases: if a graph/pivot view is defined as a groupby on field F, but there is another groupby key G in the context, it will take F instead of G (at initial load).
2017-07-19 10:48:12 +02:00
Rohan Patel fe9647f9c0 [IMP] web: improved status bar color (current state)
The current state in the status bar was a light gray, which is not easy to see. Its color should be slightly darker, and the same as stat buttons of form view (PR #18064)
2017-07-19 09:21:21 +02:00
Xavier Morel 21eb4db232 [MERGE] P3 semantics fixes
Closes #17114
2017-07-18 11:49:53 +02:00
Xavier Morel e26a212304 [FIX] P3: reorder finders in meta_path
So that was a fun one: mock.patch calls would regularly fail refusing
to find the addon in odoo.addon (e.g. essentially getattr(odoo.addon,
'account_budget' deep within the bowels of mock).

Turns out the answer is that our import hooks would not be used for
many imports: while in Python 2, sys.meta_path is empty and the
default finders are run after all meta_path finders fail as noted by
the documentation[0].

However when the import system was rewritten in Python 3.3[1]
meta_path was "despecialised" and the default finders were moved to
meta_path rather than be a hidden part of the import machinery[2]:

> sys.meta_path and sys.path_hooks now store all of the meta path
> finders and path entry hooks used by import. Previously the finders
> were implicit and hidden within the C code of import instead of
> being directly exposed.

The result of this change is that ``sys.meta_path.append`` means the
default finders should take priority and the custom ones should be
fallback. This is the exact opposite of what we want.

Fix issue by ``sys.meta_path.insert``-ing our finders at the start of
the path rather than appending them at the end. This should change
nothing in Python 2 but seems to fix the issue in P3.

[0]
https://docs.python.org/2/library/sys.html?highlight=meta_path#sys.meta_path
[1] https://docs.python.org/3/whatsnew/3.3.html#importlib
[2] https://docs.python.org/3/whatsnew/3.3.html#visible-changes
2017-07-18 11:49:28 +02:00
Xavier Morel bc3cbe9eca [FIX] P3: surprise, time.time() isn't falsy
https://bugs.python.org/issue13936

That's a pretty sensible change, but it turns out we did have some
bits of resource which implicitly depended on the old behaviour.
2017-07-18 11:49:28 +02:00
Xavier Morel 3cad551a88 [FIX] P3: stupid use of hasattr
In Python 2, hasattr swallows *any* exception raised during the
access. In Python 3, it only swallows AttributeError.

Accessing an attribute on an unbound threadlocal proxy raises
RuntimeError, while running test_ir_http_mimetype ``request`` is
unbound, in Python 2 ``hasattr`` would return ``False`` on an unbound
threadlocal, in Python 3 it lets ``RuntimeError`` pass through blowing
up the test.

Fix this by just checking if the threadlocal is bound by using it as a
boolean…
2017-07-18 11:49:28 +02:00
Xavier Morel 9bd793e1b5 [FIX] P3: / has become 'real division' in all cases 2017-07-18 11:49:28 +02:00
Xavier Morel 17fe075cda [FIX] P3: absolute ordering removed 2017-07-18 11:49:28 +02:00
Xavier Morel ace4ee39e8 [FIX] P3: round() compatibility shim
In Python 3 round:

* rounds half to even (banker's rounding) rather than up
* returns an int if not given a precision (or given a precision of
  None)
* discards the negative sign when rounding to 0

Add a compatibility shim which implements P2 behaviour and at least
allows passing float_utils's tests.

Implementing float_round on top of Decimal was attempted but did not
work: although Decimal.quantize takes a non-integral
Decimal (e.g. ``d.quantize(D('0.001'))``) it only supports integral
powers of 10 and does not support quantizing to e.g. 0.05: while that
will not fail it will just use the exponent for quantization and 0.05
is thus equivalent to 0.01, which is not what we want if e.g. need to
round a value to 5 cents.

This is hinted at but maybe not clearly spelled out by the official
documentation:

> Return a value equal to the first operand after rounding
> and **having the exponent of** the second operand.

Also convert a bunch of hand-rolled currency rounding to just using
the round() method on res.currency.
2017-07-18 11:49:28 +02:00
Thibault Delavallée dc2575b5db [REM] portal: remove pot file probably reintroduced at forward-port
Commit 3e3105151b removed the portal module as its feature are completely
replaced by front-end customer portal or base portal user support in various modules.

However the portal pot file, kicked out of Odoo by the door, tried
to come back through the window. This commit closes the window and
puts this file out again. Let us hope it does not make holes in
the garden or barks at neighbors.
2017-07-18 10:00:37 +02:00
Thibault Delavallée 62de570395 [IMP] base, website: correctly use inheritance when creating qweb rendering context
Base render method now calls a prepare_qcontext method used to prepare
the qweb context used for the rendering. Website override of ir_ui_view
now simply inherits this method to add its own set of values instead of
doing strange things with the base render override.

Qweb context should be the same after this commit, i.e. containing a lot
of duplicated things like a copy of the context. The only change is that
user_id and res_company are now directly supported in base rendering
instead of only in website version of rendering. Future commits will
use those values.
2017-07-17 18:06:37 +02:00
Thibault Delavallée 0908cbd0e8 [IMP] website: ir_http: correctly call super in auth_method_public
Calling super when it is possible it always a good practice. It ensures
to have a basic behavior that is the fallback when the behavior defined
in the inheritance does not apply. Previously the base behavior was done
directly in the inheritance without calling super. This commit improves
that and calls super like a pro.
2017-07-17 17:07:19 +02:00
Thibault Delavallée e66ba3ce1e [CLN] website_payment: remove some unused variables in JS 2017-07-17 17:03:10 +02:00
David Tran 64b378fd2c [IMP] crm: allow crm.activity.report to be extended
Closes #18254
2017-07-17 16:14:03 +02:00
Thibault Delavallée de33a4193c [FIX] (website_)payment: display website_published field of acquirers in payment
As this field is defined directly in payment and is displayed on
acquirer form view let us display it in tree view also directly
in payment instead of website payment.

This is a manual forward-port of commit 5f24bf5df7.
2017-07-17 14:43:31 +02:00
Nikunj Ladava 84be2e076a [FIX] sale: Retrieve correctly the default_deposit_product_id in ICP 2017-07-17 12:52:08 +02:00
Dipali Tank 37fac4c548 [IMP] hr_holidays: relabel 'holidays' to 'leaves' as this is the App name 2017-07-17 12:20:48 +02:00
Dipali Tank 65d0fddc78 [IMP] base: rename Holidays module category to Leaves as this is the App name 2017-07-17 12:19:52 +02:00
Haresh Shyara 0c97c2c47f [IMP] sale: always update salesperson when changing partner
Updating the partner of an SO imply

 * setting the new partner sales person if set;
 * setting myself as I am the person who updated the SO and is therefore
   in charge of managing it.
2017-07-17 12:15:50 +02:00
Jigar Patel 54d8f4b027 [IMP] project(_issue): avoid stage reset at project change when it is shared among the new project
If the new project of the task or issue has the current record stage
among its own stages do not reset it. It avoids unnecessary changes and
chatter logs.
2017-07-17 12:03:31 +02:00
Mehul Patel 64df882627 [IMP] account_check_printing: Disable Check payments on Cash journals import
Purpose
=======

When generating `Cash` bank journal on CoA import, it doesn't makes sense to have the `Check` payment method enabled by default

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

When system automatically creates journals of bank and cash type when CoA is being installed,
1) type = "Bank"
     - Manual -> Checked
     - Check --> Checked
2) type = "Cash"
     - Manual -> Checked
     - Check --> Unchecked
2017-07-17 10:04:19 +02:00
Simon Lejeune 4a4513ceb5 [MERGE] stock: models and views refactoring
See commits for more informations. We consider the model as almost
OK, but were are aware that we are introducing all kinds of new
bugs and we'll do our best to fix them quickly :)
2017-07-14 17:10:40 +02:00
Simon Lejeune ddf2b21bdf [REF] stock: adapt to rename of stock.pack.operation into stock.mode.line 2017-07-14 17:08:22 +02:00
Simon Lejeune 27ab5153d9 [REF] stock: rename stock.pack.operation into stock.mode.line 2017-07-14 17:08:22 +02:00
Goffin Simon 73f1c1c4b4 [FIX] is_cost_method_standard forward port 2017-07-14 17:08:22 +02:00
amoyaux 602b26c668 [REF] sale_mrp: adapt tests to new stock implementation 2017-07-14 17:08:22 +02:00
Simon Lejeune 106c34b8d5 [REF] stock_dropshipping: adapt tests to new stock implementation
lifo_price.yml:
    - change the cost method to fifo, as real price does not exist
      anymore
    - do not check the standard price, as it is not update on the
      product in fifo
    - correct calls to picking
    - end the test by checking the value of the out move
    - note: testing the lifo removal strategy has not effect here (we
      could adapt the test to set lot on receipt and check that the
      right lot was taken, but we didn't to that here)
2017-07-14 17:08:22 +02:00
amoyaux 6337ddd496 [REF] point of sale: adapt to new stock implementation 2017-07-14 17:08:22 +02:00
Pierre Masereel f8e749a04d [REF] sale_mrp: adapt tests to new stock implementation 2017-07-14 17:08:22 +02:00
Pierre Masereel 9254dda8a1 [REF] mrp_repair: adapt to new stock implementation 2017-07-14 17:08:22 +02:00
Pierre Masereel b98e6f2d36 [REF] sale_stock: adapt tests to new stock implementation 2017-07-14 17:08:22 +02:00
Pierre Masereel 1168e73a72 [REF] sale, sale_stock: decrease sale order lines usability
* If the user tries to decrease the quantity of a sale order line below
  the received quantity, we raise a warning telling him to create a
  return first.

* As we do not propagate the decrase to the already created pickings, we
  post a message in the chatter of these pickings informing the pickers
  of the change.
2017-07-14 17:08:22 +02:00
Josse Colpaert 5e5cd08123 [REF] stock_account,etc: FIFO and average costing method
The new implementation of stock moves the cost of products from quants to
moves. So we have implemented the FIFO and average cost method based on
those moves instead of using quants.
 - When average price is choosed, a field average_price is set on the
   product.
 - The tests have been completed with an example of how fifo work with
   negative stock.

As the use of real price method is really rare, because of the rigor
required on traceability for such method, we removed this functionnality.
 - The tests purchase/test/fifo_price.yml have been adapted to use the
   FIFO costing method instead of real price.

The old report stock history doesn't exist anymore, and is replaced by
the move view that contains all the cost information.

The methods `get_price_unit` have been moved from the stock to
stock_account.

The methods `_set_default_price_moves` and
`set_default_price_unit_from_product` have been removed from stock.

Explaination of FIFO and average:
 - In action_done for an out move in average and fifo, the price_unit and
   stock_value are updated.
 - For FIFO, it will use the qty_remaining on the in moves to check from
   which in moves to take the stock values for the out.
 - In case of negative stock in FIFO, it puts also qty_remaining on OUTs.
 - In the case of average, it will take the cumulated value of the last
   move and divide it by the quantity in stock.  

This commit is pretty much a 'work in progress':
 - Edit 'done' moves when the costing method is FIFO doesn't trigger the
   replay the FIFO stack.
 - The landed_costs feature doesn't work.
2017-07-14 17:08:22 +02:00
Pierre Masereel 8248f0e153 [IMP] purchase,stock: edit PO line quantity
This commit adapt purchase to be able to edit purchase line ordered quantity
and propagate it to the related picking after the request for quotation
validation.

These are the supported use case

- When you increase the quantity on a purchase line, an extra move (and
an extra picking if they are all done or canceled) is created with the
difference between old and new value and the push rules are applied on
it.

- When you decrease the quantity of a purchase line, different behaviors
can occurs:
  * If you plan to decrese the ordered quantity under the received
    quantity, you get a user error saying tht you have to make some
    return before.
  * Else the moves not done or cancelled are decreased by starting with
    move having no procurement_id. The decrease is not propagated
    through push or pull rules.
  * If you decreased the quantity under the invoiced quantity, a next
    activity is created to remind you to do a refund.
2017-07-14 17:08:21 +02:00
Josse Colpaert 0a76e158e1 [REF] mrp: adapt to new stock implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune 8308dcd346 [REF] purchase: adapt to new stock implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune fe20747ddc [REF] stock: adapt traceability to new implementation 2017-07-14 17:08:21 +02:00
Pierre Masereel 5fcdb06010 [MOV] stock: move traceability report from mrp_workorder 2017-07-14 17:08:21 +02:00
Josse Colpaert eaca63277e [REM] stock: not imported file
Replaced by models/stock_scrap.py
2017-07-14 17:08:21 +02:00
Simon Lejeune 2ba12efb2c [REF] stock: adapt exising tests to new implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune 10efaa91bc [ADD] stock: bunch of tests 2017-07-14 17:08:21 +02:00
Pierre Masereel 809605bb8f [REF] stock, delivery: adapt packages to new implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune ff91120416 [REF] stock: adapt returns to new implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune 4b8689b86b [REF] stock: return wizard: store picking_id in the wizard
Implement the comment from tde
2017-07-14 17:08:21 +02:00
Josse Colpaert 86f08c091e [REF] stock: adapt scrap to new implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune db1b1ab579 [REF] stock: adapt inventory to new implementation
We removed the code that merge negative quants as they aren't split in
the new model.
2017-07-14 17:08:21 +02:00