Commit Graph
8863 Commits
Author SHA1 Message Date
Pierre Masereel 4f04af5bab [TEST] stock: add tests to pick a pack 2018-06-12 17:22:00 +02:00
Pierre Masereel 76bb1c60df [FIX] stock: pick a pack
The package level was not set on move lines when a pack was pick. this
was caused by the _check_entire_package method on picking that anly
werked when there was no package_level (pick-pack-ship) and didn't
handle when the pack is picked.
2018-06-12 17:22:00 +02:00
Ankit Joshi b730a6190f [FIX] stock: location on picking form view
In picking receipts show the destinaion(https://goo.gl/TPNgqZ),
and picking delivery show the source location(https://goo.gl/HnBfNw)

task-1853350
2018-06-12 16:26:31 +02:00
Mathieu Duckerts-Antoine af999f40dd [IMP] *: review date type groupbys in search views archs
The parent commit allows to select a specific interval for any
date or datetime field in the groupby menu. This makes some filter
akward, for instance "Order Month".

Accordingly, we have rewritten the string and help attributes in
search views archs and removed groupbys related to the same field
(that would have become redundant).
2018-06-12 09:22:30 +02:00
Pierre Masereel 76662a0a66 [REF] stock, delivery: entire package manipulation
We added a model to work easily with packages, using the quant packages
was not a good solution to move entire package and plan package moves,
because we always had to give the picking in context, and create some
move lines, so it was only possible when state was assigned (when move
lines exists)

So we created a model package level, linked to picking, move and move
lines allowing to easily plan package transfer and put in pack.
2018-06-11 17:46:19 +02:00
Simon Lejeune d4eb1e33a1 [FIX] stock: action_done: picking_type_id in created move
If the user only fills move lines and not move, this method will create
the needed ones. When creating them, a picking_type_id was not set.

task-1830757
2018-06-11 17:01:15 +02:00
William Henrotin d8887c5346 [FIX] stock: mandatory default source location
On the picking type form, the default source location is not mandatory
for 'customer' picking types. If this field is empty, creating a
'customer' picking will set a vendor location as source one.

task-1830757
2018-06-11 16:59:57 +02:00
Simon Lejeune cea38a8ea9 [REF] stock: scrap action
Complete the scrap action so that it doesn't crash for some reason when
called from a do_action in javascript.

task-183075
2018-06-11 16:56:55 +02:00
dut-odoo a19236205a [IMP] sale, stock, website_sale: add easypost in settings
task-id: 30450
2018-06-11 16:33:52 +02:00
Christophe Simonis 2ab7ad8361 [MERGE] forward port branch saas-11.3 up to c00df14654 2018-06-07 11:43:07 +02:00
Christophe Simonis 969eb3fa2f [MERGE] forward port branch saas-11.2 up to c834c0f587 2018-06-06 15:46:36 +02:00
Christophe Simonis aba8c2b8fb [MERGE] forward port branch 11.0 up to 1b272a2050 2018-06-05 16:27:49 +02:00
Odoo Translation Bot 75c44c4778 [I18N] Update translation terms from Transifex 2018-06-04 11:08:02 +02:00
Nicolas Martinelli dae6efa9a5 [FIX] stock: Stock Level Forecast
- Create the following BOM for Product A:
  Comp 1: 1 Unit(s)
  Comp 2: 5 Unit(s)
- Update on-hand quantity:
  Comp 1: 10 Unit(s)
  Comp 2: 30 Unit(s)
- Create a MO for 10 Unit(s) of A
- Check the Quantity on report 'Stock Level Forecast':
  Comp 1:   0 Unit(s)
  Comp 2: -20 Unit(s)
- 'Check Availability' on the MO
- Check the Quantity on report 'Stock Level Forecast':
  Comp 1:  0 Unit(s)
  Comp 2: 30 Unit(s)

The `partially_available` state has been added with Inventory
refactoring in v11, and needs to be taken into account.

opw-1849556
2018-06-04 10:51:06 +02:00
Nicolas Martinelli 8dbaaf896e [FIX] stock: assign move
- Create a BOM for Product A, using Component B
  1 Unit of a is built with 1 Unit of B
- Update on hand quantity for B to 3.0
- Create a MO for 5 Units of A
- Update the quantity to produce to 3.0

The button 'Check Availability' never disappears.

The core of the problem is that the move remains "Partially Available".
Indeed, if there is no product available (`available_quantity <= 0`),
the stock move is skipped and its availability status is not updated.

We slightly change the logic by first checking if we need any quantity.
If not, the move can be considered as assigned.

opw-1850499
2018-06-04 08:32:39 +02:00
Odoo Translation Bot fc5e61b63d [I18N] Update translation terms from Transifex 2018-06-03 07:04:06 +02:00
Odoo Translation Bot 395459d077 [I18N] Update translation terms from Transifex 2018-06-03 04:41:19 +02:00
Christophe Simonis e008ef302a [MERGE] forward port branch saas-11.3 up to 53300648ed 2018-05-30 12:18:52 +02:00
Christophe Simonis c2c9a60466 [MERGE] forward port branch saas-11.2 up to a2f275dfc4 2018-05-29 21:05:26 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Odoo Translation Bot ca653c8c44 [I18N] Update translation terms from Transifex 2018-05-29 14:14:28 +02:00
Atchuthan, Sodexis 05c9854627 [IMP] stock: set picking_type_id to readonly except in draft state
Before this commit, the customer is allowed to change picking type after the
stock.picking record is moved from draft.
But it doesn't make the changes in the stock moves and operations as the
procurements are already created for initial demand.

To avoid confusing the user, it can now only be modified in draft state.

Authored by SodexisTeam

opw 1848252
2018-05-29 12:57:37 +02:00
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Arnold Moyaux 575b8f3764 [FIX] stock: Diplay return in tracability report
Since saas-11.2 stock_tracability refactoring do not use
level on moves orig/dest and filter on return is
not usefull anymore. It should display all return order
by date.

This commit remove the codition on the return inside the search
on move lines.
2018-05-28 15:46:10 +02:00
Odoo Translation Bot a89e46fdc0 [I18N] Update translation terms from Transifex 2018-05-27 04:10:26 +02:00
Christophe Simonis 37eed7c509 [MERGE] forward port branch saas-11.2 up to 58e3552246 2018-05-25 14:34:18 +02:00
Nicolas Lempereur 56e3100a0b [FIX] stock: remove return return test dead code
In saas-11.2, the traceability has been rewritten and there is no notion
of upstream/downstream, also the code tested seems to have become dead
in some instance (in particular: the one this test tested), so will be
improved soon.

opw-1845444
closes #24887
2018-05-24 15:35:58 +02:00
Jeremy Kersten 0179b4370b [FIX] stock: error during fwd-port 2bc6ea1b37 2018-05-24 10:01:57 +02:00
Christophe Simonis 2bc6ea1b37 [MERGE] forward port branch 11.0 up to 02ee3fd88e 2018-05-23 19:33:40 +02:00
Christophe Simonis a496ca981c [FIX] stock: move company initial setup logic in model
Followup of 4e71bd5caf
2018-05-23 17:07:28 +02:00
Josse Colpaert 73e213edef [FIX] stock: non-tracked products should follow FIFO removal strategy too
In a warehouse, mostly most of the products have no lot.  It stays
important however to avoid having old products in stock, certainly if
we can distinguish them by pack or location.

As now in stable, in_date is not put on the quant for non-tracked products,
databases might mix quants with and without in_date of the same product.
We should see those without in_date as the oldest.
That is why we need to be able to apply a ASC NULLS FIRST (ASC is NULLS LAST by default) for FIFO
or DESC NULLS LAST for LIFO.

In order to do that, we copied the code from the _search method of the ORM to
be able to do this special order as the orm itself is restrictive as it
supposes the order itself has no spaces.

We adapted and added some tests to check it handles the combination of NULL/NOT NULL well.
2018-05-23 14:38:13 +02:00
Yannick Tivisse 473c74f636 [IMP] various: Override _(name_)search instead of (name_)search
Purpose
=======
The method _name_search and _search add support to search as another user.

All the overrides of name_search and search redefine the behavior of the search.

This bring inconsistencies as the result of a call to _name_search and name_search
could differ on certain modules, which is not acceptable.

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

Example:
~~~~~~~~

If the name_search method is overridden to search also on the driver name,
then calling name_search with a label 'JF' will return all the cars with a name containing
'JF' or all the cars with a driver name containing 'JF'. Let's say that we have a ir.rule
preventing a user to read the cars of another company. Then the call to name search only returns
the cars satisfying the previous condition AND belonging to his company.

Now, we want to overpass this constraint. We call _name_search with the attribute name_get_uid=1.
Then the call to _name_search returns all the cars from all the companies with a name like 'JF',
but nothing is done about the driver_name.

Example of wrong search redefinition on a model
-----------------------------------------------

    @api.model
    def name_search(self, name, args=None, operator='ilike', limit=100):
        domain = args or []
        domain = expression.AND([domain, [('name', 'ilike', name)]])
        partners = self.env['res.partner'].search([('name', operator, name)])
        if partners and name:
            domain = expression.OR([domain, ['|', ('driver_id', 'in', partners.ids), ('driver_id', '=', False)]])
        rec = self.search(domain, limit=limit)
        return rec.name_get()

Example of correct search redefinition on a model
-------------------------------------------------

    @api.model
    def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
        domain = args or []
        domain = expression.AND([domain, [('name', operator, name)]])
        partner_ids = self.env['res.partner']._search([('name', operator, name)], access_rights_uid=name_get_uid)
        if partner_ids:
            domain = expression.OR([domain, ['|', ('driver_id', 'in', partner_ids), ('driver_id', '=', False)]])
        rec = self._search(domain, limit=limit, access_rights_uid=name_get_uid)
        return self.browse(rec).name_get()

The same logic should be applied on the overrides of the search method.
2018-05-23 11:15:46 +02:00
Pierre Masereel 7e6b259c78 [FIX] stock: is_initial_demand_editable computation
When we perform a planned transfer (which is the default behaviour now)
we are not able to set a quantity done on move lines in a confirmed
move because, the field 'is_initial_demand_editable' is true but should
not.

To fix this, we set 'is_initial_demand_editable' to true when it is not
a planned transfer AND the state of the move is draft, which is the
desired behaviour.

This behaviour come from rev:https://github.com/odoo/odoo/commit/ffb79761c1225c8a9c9303db4781f1b40b5d9944
2018-05-22 17:13:45 +02:00
Darshil Trivedi 4699f3c2bf [IMP] stock: scheduled date as current datetime on return.
When a picking is returned, the scheduled date stay unchanged. This date can be
in the past if the return is made at least one day after the transfer. This commit
set the return day as scheduled date
2018-05-22 15:00:30 +02:00
Darshil Trivedi 7eff8d39a7 [IMP] stock: add scheduled date on picking.
When a picking is in 'Done' state, we add the effective date on the form in
addition to the effective date. The user can know the date when the picking was effectively
made.
2018-05-22 15:00:30 +02:00
Nicolas Lempereur 076ececb57 [FIX] stock: no loop in traceability report
Depending on the situation, it is possible to have move with origines
and destinations that have a loop.

A simple example is a return of a return, the origin and destination of
the return of a return is the return itself.

opw-1845444
closes #24787
2018-05-22 12:50:20 +02:00
William Henrotin f7cda99d20 [FIX] stock: correct picking view
The commit ffb7976 introduce a wrong domain in the picking form view.
This commit correct it to the previous value
2018-05-22 11:58:53 +02:00
Odoo Translation Bot b658aeb3b7 [I18N] Update translation terms from Transifex 2018-05-20 07:04:05 +02:00
Odoo Translation Bot 9dd56e1972 [I18N] Update translation terms from Transifex 2018-05-20 04:09:56 +02:00
Rishabh Jadia 799b10eca5 [IMP] pos,purchase,sale,stock,website_sale: show variant
We recently hid the Variants menu items in debug mode. We want to revert
this because the users need to see that menu for business operations.

  eg : Check the inventory per variant

This partially reverts commit 62900064c0

Related to task #1839980
Closes #24553
2018-05-18 13:29:50 +02:00
Darshil Trivedi ffb79761c1 [IMP] stock: rework of immediate transfers.
The transfers are either 'planned' or 'immediate' but the process are sensibly the
same. This commit separate clearly the two possible pickings (with a new boolean field)
and simplify the view of immediate ones. This kind of transfer is pretty straightforward
so only the 'Done' column remains and the text stays written in black.
2018-05-18 08:28:11 +02:00
Josse Colpaert 4e71bd5caf [FIX] stock: customer/vendor location empty
When creating a new company, the fields customer/vendor location
were empty.

Now, these fields are set with the internal transit location for the company
of the partner and set with Partners Locations/Customers and Partners Locations/Vendors
for the other companies.

opw:1845753
2018-05-17 17:07:24 +02:00
Nirali Sapra 47c34d2932 [IMP] stock: hide the source and destination location
This commit hide the column source location if the type is incoming and hide the
destination one if the type is outgoing. When picking type is 'vendor' then no
need of source location. If picking type is 'custmomer' there is no need of destination location.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra fcb9fafcad [IMP] stock: remove force_assign method
This commit remove force_assign method in every tests of point_of_sale, purchase, sale_mrp,
sale_stock, stock and stock_account . This method is not longer used since V11.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra ec37a48013 [IMP] stock: 'validate' button in primary mode
This commit change the validate button in stock picking. It's now primary only when the
picking is in ready stage. Before this commit, this button was primary on waiting stage too.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Denis Ledoux f8d0efee92 [FIX] stock: use product qty decimal accuracy in Picking Operations
Since revision f6144fe1f3,
the decimal accuracy for the product quantity in
the picking operations report was no longer applied,
leading to display a bunch of numbers after the comma
in some cases.
e.g. 15404.000000000002 Unit(s)

opw-1846723
2018-05-17 14:27:11 +02:00
Christophe Simonis 644f0959d0 [MERGE] forward port branch saas-11.2 up to 1655202924 2018-05-17 14:23:37 +02:00
Christophe Simonis 1655202924 [MERGE] forward port branch 11.0 up to 59a8a1cd8e 2018-05-17 13:19:49 +02:00
Christophe Simonis 9874adebb8 [MERGE] forward port branch saas-15 up to 40e74240e8 2018-05-16 17:48:37 +02:00
Christophe Simonis 40e74240e8 [MERGE] forward port branch saas-14 up to a1a03792b6 2018-05-16 17:11:39 +02:00