Commit Graph
280 Commits
Author SHA1 Message Date
Nicolas Martinelli 5b89ca142d [FIX] purchase: vendor reference
In case no PO has a vendor reference, keep the value.
2018-09-03 11:57:49 +02:00
Nicolas Martinelli e6390a76a6 [FIX] purchase: overwrite vendor reference
Overwrite vendor reference only if there is a PO linked to the bill.
Otherwise, any addition of product will erase what the user just typed.

Closes #26734
2018-09-03 09:54:34 +02:00
Nicolas Martinelli 052a5702c5 [FIX] purchase: keep vendor reference
Create a PO and assign any string to the Vendor Reference field. Confirm
and create an invoice.

The Vendor Reference field on the invoice is empty, while it is expected
to be filled in.

opw-1879379
2018-08-30 10:07:35 +02:00
Graeme Gellatly 7d898ad72f [FIX] purchase: rounding in supplier info
- Set 'Product Price' accuracy to 5 places
- Create a PO for a product to a new supplier
- Enter price at 3.14561 / unit

Supplier info entry rounded to 3.15, while it should be 3.14561.

Closes #22253
Fixes #22252
2018-08-16 13:44:23 +02:00
Christophe Simonis 51225c9b9f [MERGE] forward port branch saas-15 up to 52e88036f2 2018-08-14 18:24:40 +02:00
Christophe Simonis 52e88036f2 [MERGE] forward port branch saas-14 up to d4ee30b4fa 2018-08-14 17:45:46 +02:00
Christophe Simonis d4ee30b4fa [MERGE] forward port branch 10.0 up to a487d7d397 2018-08-14 17:09:32 +02:00
Christophe Simonis a487d7d397 [MERGE] forward port branch 9.0 up to 72cb16865c 2018-08-14 16:57:21 +02:00
Arnold Moyaux e1ff6ce3d9 [FIX] purchase: cancel a PO undo the closest picking cancellation
Usecase to reproduce:
- Set a product buy and MTO
- Create a SO with it and cancel it
- All the pickings are cancel
- Cancel the PO
- The picking that generate the PO is set to confirm
The picking should remain in cancel state

It happens because the button_cancel method still
consider the canceled moves.

This commit only modify destination moves if they still
require an action from the user.
2018-08-13 13:51:54 +02:00
Christophe Simonis bda926034a [MERGE] forward port branch saas-14 up to c9a01ab30a 2018-06-26 13:13:05 +02:00
Christophe Simonis c9a01ab30a [MERGE] forward port branch 10.0 up to 58c92d9374 2018-06-26 12:57:31 +02:00
Josse Colpaert d4582cf020 [FIX] purchase: no mrp fields in purchase please
Fields of mrp should not be put in purchase like this,
as it can throw a traceback e.g. if you generate a purchase
based on a picking in MTO.
2018-06-25 15:38:23 +02:00
Christophe Simonis 152d42041e [MERGE] forward port branch saas-14 up to e4663523b9 2018-06-20 18:48:06 +02:00
Christophe Simonis e4663523b9 [MERGE] forward port branch 10.0 up to 081259ef25 2018-06-20 17:44:58 +02:00
Pierre Masereel 9a810565b0 [FIX] purchase: Canceling the receipt of a receipt
Canceling the delivery order created for a "Make to order" product
cancels the related procurement.

But canceling the receipt order created for a "Buy" product" with reordering rule
didn't cancel the related procurement. In some cases, it can block the application
of the reordering rules.

Now the related procurement is canceled when the receipt order is canceled.

opw:1845345
2018-06-19 15:37:26 +02:00
Nicolas Martinelli 3e2f85e021 [FIX] purchase: duplicate procurement
The fields `purchase_line_id` on a procurement should not be copied.
Otherwise, issue arise in reordering rules.

opw-1859349
2018-06-19 15:24:47 +02:00
Nicolas Lempereur 84abc9d06c [FIX] purchase: Receive Products ok context F5
The `active_id` when clicking on "Receive Products" on a purchase order
is the one of the purchase order.

But the action used has a context with:

```
{
    'search_default_picking_type_id': [active_id],
    'default_picking_type_id': active_id,
    'contact_display': 'partner_address',
}
```

So the active_id should be a stock.picking.type and not a purchase
order, thus:

- we could get an error at some instance (eg. a refresh) when loading
  the facet of the stock.picking.type with the ID of a purchase order

- we could erroneously show a facet for a stock.picking.type with the ID
  being the same as the purchase order

So this commit uses the same action without the offending `active_id` in
context.

opw-1870687
closes #26160
2018-08-06 13:18:26 +02:00
len-odoo 34d1ecd6f3 [FIX] stock, purchase: clean moves to merge
Purchase creates an activity when some stock move is deleted.
Howver when two moves are merged "behind the scenes", some moves may be deleted.
As a result it creates an activity "warning: some move has been deleted" for no
good reason.
We add a hook to clean moves before the merge.

opw 1826791
2018-08-06 10:17:25 +02:00
Can Tecim bf332e2e08 [FIX] purchase: P3-style super call
3869cdf7d8 merged a fix which used a
P3-style super call, which is not compatible with Python 2.

While 11.0 is not really exactly officially supported on Python 2,
we originally decided not to break compatibility unless there were
very good reasons to do so.
2018-07-31 10:05:30 +02:00
Akim Juillerat 3869cdf7d8 [FIX] purchase: Restore push rules behavior in 2 steps reception
Due to this commit: https://github.com/odoo/odoo/commit/ab5fcb29650349fa641c6130bf6dcbdc1ec28a07
When confirming a PO with two lines having the same product,
the stock moves were not merged anymore in the putaway
(input to stock) picking.

Reason:
When confirming the PO, odoo creates first a receipt
(vendor to input) picking and its stock moves matching the PO line.
Then it applies the push rule on each move. Both putaway
(input to stock) moves are created by copying the receipt
(vendor to input) moves, but when the second is created,
odoo check if there's another move to merge sharing same
properties to merge into it. As purchase_line_id is now copied
in both cases, both putaway moves include a different
purchase_line_id and won't be merged together, since this field
is in _prepare_merge_moves_distinct_fields() on stock.move.

opw:1854387
2018-07-19 15:03:11 +02:00
Goffin Simon 487873f170 [FIX] purchase: Error when updating dropship order
Steps to reproduce the issue:

- change the demo user settings -> use Sales: User: All Documents only
- create a stockable product with dropship feature on and a supplier
- connect as the demo user
- create a sales order with this product
- confirm the order
- as the admin user, confirm the purchase order generated through dropship
- connect as the demo user
- open the confirmed SO
- add a line with this product
- save the SO

Bug:

An access rights error was raised.

opw:1866015
2018-07-19 11:12:09 +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
Pierre Masereel f6b3247c31 [FIX] purchase: remove move_dest_ids when PO line cancelled
When a PO is confirmed, cancelled, set back to draft and confirmed
again, the push rules don't apply because the PO lines have
move_dest_ids. So we remove those move_dest_ids from PO lines, to allow
push rules to be applied on the newly confirmed PO.

OPW-1859363
2018-06-26 15:02:51 +02:00
Arnold Moyaux d0dc4c60bd [FIX] purchase: dropshipping sequence in multi company
Usecase to reproduce:
- Create 2 sequence for PO(one for each company)
- Create a product with dropshipping
- Connect on the demo user with an active company different than the
admin company
- Create a SO for this product
It will create a PO with the admin's company sequence.

It happens because _run_buy use a sudo since SO user don't always
have the purchase and inventory rights. However the company is not
forced and thus the used company for sequence is the admin company.

opw-1860802
2018-06-26 13:43:08 +02:00
Thomas Binsfeld 4d3debe2c3 [FIX] purchase: do not show all pickings from PO if there are no picking
Closes #19961.
2018-06-13 12:05:17 +02:00
Goffin Simon a5e6afe559 [FIX] purchase: Drop shipping with no access to Purchase
Let's consider a Sales user U with no access to Purhcase

Steps to reproduce the bug:
- Create a SO with one line with the drop shipping route
- Validate the SO

Bug:

 A access error was raised because the user has no access right on
Purchase.

opw:1851301
2018-06-05 11:29:26 +02:00
Goffin Simon eac4c0badf [FIX] purchase: Print RFQ and status does not change
Due to this commit: 98cb4719db

When printing a RFQ, the status of the quotation didn't change in SENT.

opw:1849139
2018-05-17 15:38:27 +02:00
Nicolas Martinelli d9fc5bca7e [FIX] purchase: move with zero qty
- Create a product FIFO / Real-Time valuation
- Create a PO with 1 unit, validate, receive the picking
- Create the corresponding vendor bill, but do not validate
- Unlock the picking and change the received quantity to 0.0
- Validate the invoice

A traceback because of a zero division occurs.

When searching for the stock moves linked to the PO, we should filter
out the ones with a zero quantity.

opw-1843543
2018-05-15 08:51:40 +02:00
Goffin Simon dff1e96ed3 [FIX] purchase: Wrong property fields in multicompany
Steps to reproduce the bug:
- Enable multi companies and multi-currencies
- Multi company: Your Company and Test
- Users: Admin and Demo
- Login as admin user with the current company: Your Company
    - Allowed companies: Your Company, Test
- Login as Demo user with the current company: Test
    - Allowed companies: Test
- From the admin user with the current company: Test, do the following configuration in the product,
   - product: iPad mini, select vendor: Delta PC with price $100 with company: test, currency: USD
- Change the admin's company from Test to Your Company, do the following configuration in the vendor,
   - vendor: Delta PC, set supplier currency: EUR and payment terms: 30 Daya Net Payment
- Log in with the demo user
- Create SO for that product by selecting routes: Make to order and Confirm it.
- Open the PO which is generated from this SO

Bug:

The Currency and payment terms were set with the data set for Your Company

Excpected behavior:

Nothing is set for supplier currency and Payment terms as nothing is set for the company: Test

Closes #24564
opw:1841379
2018-05-09 16:21:23 +02:00
Christophe Simonis 810603f4ef [MERGE] forward port branch saas-14 up to 55ce6aff10 2018-05-02 14:49:58 +02:00
Christophe Simonis 55ce6aff10 [MERGE] forward port branch 10.0 up to 79bbd1dcb8 2018-05-02 13:52:12 +02:00
JulioSerna 29c29b4578 [FIX] purchase: wrong get 'group_id'
The error before this pr could be reproduce with the steps,
- Create two warehouse WA and WB
- Create Route to get: Purchase in WA and transfer to WB
- Create product with Route created before
- Create orderpoint to WB
- Run scheduler

If there is no purchase created the `_run_buy` method tries to create a
PO, but if there is no `group_id`, a traceback occurs.

Closes #24353
opw-1838384
2018-04-30 14:54:01 +02:00
Simon Lejeune 0e28b858e0 [FIX] stock_account: fifo, anglosaxon and return
When computing the amount of the anglo saxon entry, if it's a vendor
bill only consider IN move, if it's a credit note only consider out move
(the returns).

opw-1819353
2018-04-30 10:25:42 +02:00
Goffin Simon feba353c65 [FIX] purchase: Wrong Fiscal position in multicompany
Steps to reproduce:

 -Create company A
 -Create company B
 -Admin user with both companies but currently in company B
 -Create Demo user only with company B
 -Create fiscal position A to company A
 -Create fiscal position B to company B
 -Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
 -Create product and add the vendor created before
 -Set like Create a draft purchase order
 -Logging with Demo user
 -Create sale order with one sale order line with route make to order
 -Validate sale order

Bug:

 The purchase order created by sale order had the fiscal position company A.

Backport of this commit: 5bb6517072
Closes #23561
opw:1825098
2018-04-26 16:29:34 +02:00
Goffin Simon 5588c2e02b [FIX] purchase: Wrong behavior of "Received product" button on purchase order
Steps to reproduce the bug:

- Create a stockable product P
- Create PO and confirm it
- Cancel the PO
- Reset the PO to Draft and reconfirm it
- Validate shipment order

Bug:

- The "Receive product" button is still displayed but every shipment orders of the
PO have been treated.

NB: The field is_shipped is only used to display the button "Received product".

opw:1838539
2018-04-26 09:22:20 +02:00
Arnold Moyaux c04119fc4f [FIX] purchase : be able to use it with MPS
Since procurement group is passed by the optional values
in the procurement proccess it should be considered as optional

MPS do not use procurement group because they will add the
planification in an existing RFQ it will fail because purchase search
for the key 'group_id' in values

opw-1833060
2018-04-11 15:09:59 +02:00
Goffin Simon 5bb6517072 [FIX] purchase: Wrong Fiscal position in multicompany
Steps to reproduce:

 -Create company A
 -Create company B
 -Admin user with both companies but currently in company B
 -Create Demo user only with company B
 -Create fiscal position A to company A
 -Create fiscal position B to company B
 -Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
 -Create product and add the vendor created before
 -Set like Create a draft purchase order
 -Logging with Demo user
 -Create sale order with one sale order line with route make to order
 -Validate sale order

Bug:

 The purchase order created by sale order had the fiscal position company A.

Closes #23561
opw:1825098
2018-04-11 09:11:55 +02:00
Christophe Simonis c94d30541c [MERGE] forward port branch saas-15 up to 97a70c2d8e 2018-04-06 14:33:40 +02:00
Christophe Simonis 97a70c2d8e [MERGE] forward port branch saas-14 up to 5eb6e14e85 2018-04-06 13:43:57 +02:00
Christophe Simonis 5eb6e14e85 [MERGE] forward port branch 10.0 up to e5fd52d28c 2018-04-06 13:40:40 +02:00
Denis Roussel e5fd52d28c [FIX] purchase: button_approve in a multi recordset fails
Closes #24079
2018-04-06 11:36:04 +02:00
Pierre Masereel 7560bb7f42 [FIX] purchase: internal transfer wait operation when RFQ canceled
When you have a receipt in multiple steps and cancel the generated RFQ
the following internal move stay in waiting another operation.

We recompute its state and pass it in waiting.

OPW-1832176
2018-03-29 13:53:25 +02:00
Christophe Simonis e8f630e44d [MERGE] forward port branch saas-15 up to 7a45296cf1 2018-03-21 18:20:22 +01:00
Christophe Simonis 7a45296cf1 [MERGE] forward port branch saas-14 up to 78dced6bc2 2018-03-21 16:49:15 +01:00
Christophe Simonis 78dced6bc2 [MERGE] forward port branch 10.0 up to c2b3ad1899 2018-03-21 15:55:26 +01:00
Christophe Simonis 0cefaad370 [MERGE] forward port branch 9.0 up to 2c5fe07fc7 2018-03-21 11:35:58 +01:00
len-odoo 00057f8efd [FIX] stock, sale_stock, purchase: create quality checks for backorders
There was no Quality check entry for backorders
when the user did a partial shipment.
We move the logic of the backorder creation to the _create_backorder function.
This function was defined but not called anymore due to a refactoring.
We clean some of its unnecessary overrides which were not used anymore.

opw-1816845
2018-03-16 11:36:53 +01:00
Christophe Simonis 0ae300e9e6 [MERGE] forward port branch saas-14 up to 85fd5cc147 2018-03-08 12:45:29 +01:00
Goffin Simon 622399c796 [FIX] purchase: Changing the price of a confirmed PO before the receipt
Steps to reproduce the bug:
- Set your company in anglo-saxon
- Create a product P in a category which is in real price and perpetual
- Create a PO with P at 500$ and validate it
- Change the unit price of P in the PO line and set 100$
- Receive the product
Bug:
The two journal entries generated for the goods were created with the price unit
500$ instead of 100$.
Fix:
Now the right price is taken into account to generate the journal entries.

opw:1813946
2018-03-08 10:42:53 +01:00
Arnold Moyaux 29f1239d1a [FIX] stock: merge move with a mix RFQ/PO
Use case to reproduce:
- Create a Product MTO that should be buy
- Create a SO with this product and confirm it
- Confirm the RFQ
- Increase the ordered quantity on the SO
- Confirm the new RFQ
- Receive product from the 2 PO
-> Unable to reserve the quantity on the destination moves

It happens because the link between the reception move from the second PO and the delivery move is missing.
Update the quantity on the SO will create a new move with the missing quantity that will generate the new RFQ
then this move is merged in the main move. However the reception move is only created when the RFQ is confirm
and the move_dest_ids is stored on the purchase order line during this time.
Thus merge moves will unlink the new move with its reference on the purchase order line and the link is lost.

This commit do not merge move that have different RFQ/PO in order to avoid losing MTO information.
2018-03-02 11:29:13 +01:00