Commit Graph
69 Commits
Author SHA1 Message Date
Christophe Simonis e145f2b0c8 [MERGE] forward port branch saas-12.2 up to 2694174b41 2019-04-10 15:10:24 +02:00
Christophe Simonis 6c8e30cae6 [MERGE] forward port branch saas-12.1 up to 6d4940675f 2019-04-09 12:16:06 +02:00
Christophe Simonis 6d4940675f [MERGE] forward port branch 12.0 up to ea1fc124ef 2019-04-09 11:11:48 +02:00
Christophe Simonis fef49061ea [MERGE] forward port branch saas-11.3 up to 4c61621efb 2019-04-08 19:52:29 +02:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Christophe Simonis f2be461f09 [MERGE] forward port branch saas-12.1 up to f2d0995362 2019-04-05 10:50:56 +02:00
Christophe Simonis ab0babf3e9 [FIX] purchase_stock: move code at the right place
Oversight of previous forward-port.
2019-04-04 13:43:20 +02:00
Christophe Simonis d32420397d [MERGE] forward port branch 12.0 up to 251021796c 2019-04-04 11:20:03 +02:00
Jinal Patel edef08eeee [IMP] stock: assign someone to picking
purpose is allow to assign picking to users
- add field responsible on the picking that allows to select a user
- Now we assign responsible to several picking at once
- add default filter 'My Transfers' and 'Unassigned Transfers'

Related task : 1938107

closes odoo/odoo#31138

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-02 14:41:19 +00:00
Goffin Simon 2c702108b8 [FIX] purchase_stock: Wrong journal entry created from vendor bill
Steps to reproduce:

- Create a storable product P with a vendor V and a purchase price = 100€
- Set the category of the prodcut to automated and AVCO and set a price diff account on it
- Create PO for V with 10 P with a price_unit = 110€
- Confirm the PO and deliver 7 P with no backorder
- Change the ordered quantity of P to 9 on PO (and the unit_price will be set to 100€)
- Go on the delivery order and deliver 2 remainig P
- Create the invoice and validate it

Bug:

The amount due on the invoice was 900.02€ instead of 900.00€

PS: The debit and credit of an aml are computed with the price (defined in function
_anglo_saxon_purchase_move_lines) with the function _convert_prepared_anglosaxon_line
defined on model account.invoice. So rounding the price unit after the computation
of the price allows to keep the same total as the one computed for the PO.

opw:1951465

closes odoo/odoo#32345

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-03 08:49:57 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Christophe Simonis 44515bc7be [MERGE] forward port branch saas-12.2 up to c9f832d9f0
closes odoo/odoo#31790

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13 14:24:51 +00:00
Arnold Moyaux ff63a123af [FIX] stock, purchase_stock: useless parent method
commit c914df5a36 introduced procurement
refactoring and a function _make_po_get_domain that is responsible to
forge a domain in order to find an existing PO that could append the
po line created by the procurement. However the function is defined in
stock and overriden in purchase_stock, purchase_requisition_stock,
mrp_mps(oe). All the module depends of purchase_stock and the method
in stock only return an empty tuple. So the method in stock could
be removed and the method in purchase_stock could become the new parent.

closes odoo/odoo#31580

Signed-off-by: "Simon Lejeune (sle)" <sle@openerp.com>
2019-03-05 09:07:39 +00:00
Arnold Moyaux 8c769cb40c [FIX] purchase_stock: _run_buy check supplier qty
Usecase to reproduce:
- Product with routes MTO and BUY
- Add a supplier on a product with a min qty of 5
- Create a SO with a qty of 1

A PO is created with the supplier and a quantity of 1. It should return
an error since there is no suppliers that sell with this quantity.

It happens because _run_buy directly use the suppliers on the product
without check for date and minimal quantity.
This commit replace it by _select_seller that manage every details.
2019-02-14 10:19:21 +00:00
Arnold Moyaux a2a6b099a4 [REF] stock, stock_*: procurement batch by rules's actions
Improve the procurement requests performance. Instead of processing
procurement request one by one, search rules that apply for each of
them and group them by rule's actions.

The main technical change is the record creation order.
E.g. 2 SO lines with pick ship delivery.
-Before this commit:
line1 -> LAUNCH_RULE -> PICK MOVE1 -> MOVE1 CONFIRM -> OUT MOVE1
line2 -> LAUNCH RULE -> PICK MOVE2 -> MOVE2 CONFIRM -> OUT MOVE2
-After this commit:
line1/2 -> LAUNCH RULE -> PICK MOVE1/2 -> MOVE1/2 CONFIRM -> OUT MOVE1/2

Also there is one batch creation by company_id. It implies that values
are group by company_id. Since company_id are passed by previous
procurement or by the rule, it become a required value and it's added to
the procurement arguments (it was already always passed in the values,
no functional modification).

_run_buy is reworked. It receives a bathc of procurements, those
procurements could be merged in the same PO or the same PO lines.
However the PO/PO lines are created (if procurement couldn't be
merged in an existing one) at the end of the method. It implies
that 2 procurements creating a PO and merged inside, would now create
2 distinct PO (same for po lines). _run_buy in order to fix this issue:
- group procurements by PO search domain. If the PO doesn't exist,
create only one.
- Inside the same PO: merge quantities, move_dest_ids for procurements
with the same product and UoM.

Other _run_ methods are just adjusted in order to process batch.

For a pick pack ship scenario, without procurment_jit confirm a SO
containing 500 lines will take 40s instead of 15 minutes.
2019-02-14 10:19:21 +00:00
Nicolas Martinelli 4da82776ff [FIX] purchase_stock: return dropship
- Set an internal location as a return location
- Create a SO with a dropship product, validate and deliver
- Return the product, and choose the internal location as the return
  location.

The received quantity on the PO is counted twice.

Since the return is an 'in' move linked to a PO, it is automatically
counted as incoming quantity.

This case is quite specific, so we explicitly add an exception in case
the origin move was a dropship, but the return is not a returned
dropship.

opw-1958228

closes odoo/odoo#32205

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-28 12:01:42 +00:00
Christophe Simonis 6faad524cf [MERGE] forward port branch 12.0 up to bc744a1da4 2018-11-16 19:30:20 +01:00
Arnold Moyaux 4f080a6605 [FIX] mrp, purchase_stock: wrong company on rules
Usecase to reproduce:
- Install a database with demo date and mrp or purchase

The buy/manufacture rules have a wrong company for warehouses
in company 'My company, Chicago'

It happens because the warehouse is not specify in the create
values. In this case it creates the rules and set the user current
company as default.

This commit specify the company during the create call.

closes odoo/odoo#28682
2018-11-14 13:49:24 +00:00
Darshil Trivedi c48c3e6155 [IMP] stock, purchase_stock: Stock move description
Display product picking,receipt or delivery description depending
the picking type. The purpose is to display usefull information/note at
the right place at the right moment.

This commit is related to task ID : 1880135

closes odoo/odoo#28175
2019-01-28 10:35:11 +00:00
Arnold Moyaux a172166a8b [FIX] purchase_stock: merge po by default
Usecase to reproduce:
- Create a product with a vendor and mto/buy route checked.
- Create 2 SO and confirm them

The system generated 2 RDF instead of a single with 2po lines (same than
v11). It happens because the propagation option of buy rules is
leave empty in v11 and Propagate in v12. It was unintentionally removed
by commit 1e160dffd3

This commit set leave empty as default value for buy rules.

opw-1904165

closes odoo/odoo#28637
2018-11-13 14:22:51 +00:00
Arnaud Baes 55d460b5d5 [REF] stock, sale_stock, purchase_stock: stock.uom_propagate config parameter refactor
Avoid duplicate code and instead use a new private function

closes odoo/odoo#29266
2018-12-19 13:57:16 +00:00
David Arnold 3858fb8498 [IMP] account: non deductible taxes to inventory
Non deductible taxes (ones without an account set), increase the target
account of the product.

In case of a inventory operation, this means the inventory account.

To reflect this stock valuation wise, we need to calculate this incremented
values and rely on it during the inventory move price calculation.

This commit does exactly that.
2018-12-03 15:16:32 +00:00
sbbaro 2541db92f0 [FIX] purchase: ameliorate the performance of _create_stock_moves
When confirming purchase orders with a lot of lines the performance
is very slow (sometimes reaches the memory limit). Creating the stock
moves in only a multiple create ameliorates the performance.

opw 1929276

closes odoo/odoo#31471
2019-02-27 15:52:43 +00:00
Christophe Simonis b106b7ce0b [MERGE] forward port branch 12.0 up to dd70c68426 2018-11-06 16:40:07 +01:00
jem-odoo 3e3d6c3ce0 [REF] purchase_*: change received qty api
The received quantity on Purchase Order line can be compared
to the delivered qty on Sales Order line. It is now time for
both to share the same mecanism (introduced in
3bf8a62e0d).

This commit sets `qty_received` as a computed field, depending
of a method (`qty_received_method` field) to compute it. The
value can be computed based on
 - manual value; for services (all the time), and consummable
 products (when stock is not installed).
 - stock moves; for stockable and consummable products (when
 stock is installed)

This is now easier to extend the way the received quantity
need to be computed (like in sale).

Task #1850689

closes odoo/odoo#27663
2018-10-30 12:43:53 +00:00
Christophe Simonis 5e055a2afd [MERGE] forward port branch saas-11.4 up to f6ca72b3ce 2018-11-02 10:52:55 +01:00
Christophe Simonis a299517f83 [MERGE] forward port branch saas-11.3 up to 6136f0c02e 2018-10-29 11:56:32 +01:00
Martin Trigaux d0213a6fec [FIX] stock: correctly translate route name
Translating a variable does not work, the call must be translated

Reexport the source terms to reflect the changes

closes odoo/odoo#28099
2018-10-24 09:38:45 +00:00
Christophe Simonis 9dbb7d199c [MERGE] forward port branch 12.0 up to b81c2bce84 2018-10-22 17:57:08 +02:00
arbaes 9764f04a3c [IMP] stock: backorder created only when needed
Before this commit, when the user chose to not make a backorder, a backorder was created then immediatly canceled.
This behaviour is now changed as in such a case the backorder is simply not created anymore
2018-10-16 09:14:48 +00:00
Nicolas Martinelli 5f0be01323 [FIX] purchase_stock: no destination address
- Create a product sold by Dropshipping
- Create a SO, validate
- Validate the corresponding PO
- On the picking, print the 'Picking Operations' or the 'Delivery Slip'

There is no delivery address printed.

The root cause of the issue is that the field `dest_address_id` of the
PO is empty. This is because `partner_dest_id` is not used anymore since
1e160dffd3.

opw-1892990

closes odoo/odoo#27850
2018-10-16 13:12:41 +00:00
Gustavo Valverde 1c0e419a2d [FIX] purchase_stock: buy_route xml_id
When creating a warehouse with purchase app installed, it will
traceback since the route_warehouse0_buy is referenced in a wrong
module.

closes odoo/odoo#27523
2018-10-08 07:52:57 +00:00
Arnold Moyaux 6b550b8721 [FIX] sale_stock, purchase_stock: lot po/so count
Usecase to reproduce:
- Create a PO or SO with 10 lines
- Process the DO/Receipt to done
PO or SO count on lot is equal to 10 instead of 1

It happens because multiple stock_move could be linked to 1 order.
2018-09-06 13:27:56 +02:00
RomainLibert 3f2bc7b11f [FIX] various: adapt code to new datetime fields
Some code was still using the date and datetime fields as if they were
strings, but they are now dates and datetimes
2018-08-23 16:03:55 +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
Christophe Simonis 0ac7f8fbe6 [MERGE] forward port branch saas-11.4 up to dabe59df9c 2018-08-14 20:16:03 +02:00
Christophe Simonis dabe59df9c [MERGE] forward port branch saas-11.3 up to 27d8daf8a7 2018-08-14 19:43:32 +02:00
Martin Trigaux e08f947abe [FIX] purchase: use field in purchase_stock
The field move_dest_ids is now defined in purchase_stock (since the split at
rev 8d4609a1db)

The line was added in purchase at f6b3247c31 in 11.0 but incorrectly forward
ported.

This commit only moves the code to the appropriate module.
2018-08-14 11:16:50 +02:00
Arnold Moyaux 1e160dffd3 [IMP] stock, mrp: picking before and after manufacturing
Currently MRP do not handle multi locations for components. In order to
be able to use both feature at the same time, we could:
- Improve mrp in order to handle multiple stock.move.line for a
componenet stock.move
- Add a rule that allow to bring all the good from multiple location to
a single location. (was already possible but it requires some
configuration)
This commit introduce a checkbox on the warehouse in order to
automatically configure all the routes/rules/locations/picking_types,...
necessary to bring all the components to a single location before
running the manufacturing order.

Technically it also refactor some stock_warehouse.py methods in order to
easily override the picking_type, rules and routes creation.

Thank to Hetashree Chauhan <hch@odoo.com> for his help.

task_id: 27785
2018-08-13 15:38:34 +02:00
Christophe Simonis 7499b47ffa [MERGE] forward port branch saas-11.4 up to edd586002e 2018-08-10 13:37:21 +02:00
Christophe Simonis 7717f082c0 [MERGE] forward port branch saas-11.3 up to af35aea6b0 2018-08-09 19:33:32 +02:00
Christophe Simonis 32dce83618 [MERGE] forward port branch saas-11.3 up to ff80efd71e 2018-08-06 19:59:53 +02:00
Raphael Collet 960360afe4 [REF] *: use native date/datetime for Date/Datetime fields
From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master.

This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well.

Task-ID: 47189
2018-08-06 14:37:19 +02:00
Christophe Simonis 7d529c6ae9 [FIX] purchase_stock: adapt fix 3869cdf7d8 to new models 2018-08-01 19:06:17 +02:00
Christophe Simonis 4797627259 [MERGE] forward port branch saas-11.4 up to 8d9366197e 2018-08-01 18:02:29 +02:00
Christophe Simonis 8d9366197e [MERGE] forward port branch saas-11.3 up to 691dd65e0e 2018-08-01 17:23:03 +02:00
Christophe Simonis a719cf2563 [MERGE] forward port branch saas-11.3 up to b4555df336 2018-07-30 17:02:28 +02:00
Martin Trigaux 424e50121b [FIX] purchase_stock: use correct external id
The external id is purchase_stock.route_warehouse0_buy

Simplify the code to make it more readable

Fixes #25942
2018-07-26 16:33:28 +02:00
Laurent Smet c75f3a007c [REF] account,stock,account_intrastat: Intrastat report moved in interprise
This will allow to use the same core for all intrastat reports and benefit from the dynamic financial reports engine.
Incoterms have been move to account, as we want to provide a light intrastat report for people not having the stock app installed

Was task: 35850
Was PR #23805
2018-07-26 02:18:37 +02:00