Commit Graph
170 Commits
Author SHA1 Message Date
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
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
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
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
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
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
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
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
Christophe Simonis 5ad55264e4 [MERGE] forward port branch saas-15 up to b04c8eae6b 2018-03-01 18:02:30 +01:00
Christophe Simonis b04c8eae6b [MERGE] forward port branch saas-14 up to 153ae5e8b8 2018-03-01 17:26:43 +01:00
Christophe Simonis 153ae5e8b8 [MERGE] forward port branch 10.0 up to a6855b31c9 2018-03-01 16:51:37 +01:00
Swapnesh Shah 685f4eff50 [FIX] purchase: set date_approve on order confirmation
Restore behaviour before the workflow removal

Closes #23306
Fixes #23273
2018-03-01 11:55:42 +01:00
Simon Lejeune 97ed2e730e [FIX] purchase, sale_stock: propagation of UOM
Before this commit, the uom defined on the sale order line and on the
purchase order line was propagated to the moves. This is not the
behaviour of v8-10 and may confuse the stock operator (one time he's
working in dozen, another time in units for example). It also leads to
rounding issues if the configuration is not adapted correctly (product's
uom is in units, sale order line is in dozen, the rouding precision on
the uom is left to their defaults, now if a dozen is partially available
there's a good chance converting back and forth form dozen to units will
break).

An ir.config_parameter was added to restore the behaviour before this
commit.
2018-02-19 14:29:09 +01:00
Florent de LabarreandNicolas Martinelli 71d5425c83 [FIX] purchase: update PO line in procurement
Allow inheritance for PO update as it is already the case for PO
creation.

Closes #22224
opw-806807

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2018-02-06 13:38:12 +01:00
Christophe Simonis 950d9b2369 [MERGE] forward port branch saas-16 up to dfe7f00e78 2018-01-22 16:38:01 +01:00
Christophe Simonis a3d3e5e7fe [MERGE] forward port branch saas-15 up to 50d87ae81b 2018-01-22 14:42:09 +01:00
Christophe Simonis 50d87ae81b [MERGE] forward port branch saas-14 up to 3d673b5900 2018-01-22 13:33:58 +01:00
Christophe Simonis 3d673b5900 [MERGE] forward port branch 10.0 up to aac9cd4ca8 2018-01-22 12:32:40 +01:00
Florent de Labarre c5586134a3 [FIX] purchase: keep context
Modify the existing context instead of replacing it.

Closes #22400
opw-806661
2018-01-22 08:43:45 +01:00
Christophe Simonis 6e25eb9b05 [MERGE] forward port branch saas-16 up to 4c410ee6a1 2018-01-09 17:03:07 +01:00
Christophe Simonis 4c410ee6a1 [MERGE] forward port branch saas-15 up to 38b201abce 2018-01-09 16:30:50 +01:00
Christophe Simonis 38b201abce [MERGE] forward port branch saas-14 up to e671cdcc44 2018-01-09 15:54:16 +01:00
Christophe Simonis e671cdcc44 [MERGE] forward port branch 10.0 up to 849d8ffd21 2018-01-09 15:12:51 +01:00
Benjamin Willig 22da94f147 [FIX] Allow to keep the state of a PO when logging a message
Steps to reproduce the bug:

- Create a new RFQ
- When it's in draft state, log an internal note using the 'mail.compose.message' dialog.

Bug:

- RFQ is now in 'sent' state.

The fix allows to inherit from mail_purchase_order_on_send method to change the base behavior.

opw:801549
2018-01-04 14:28:05 +01:00
Arnold Moyaux 9e0724088b [FIX] purchase: cancel rfq set destination move to mts
Use case to reproduce:
- Create a SO with a product MTO and confirm the PO
-> PO -- Stock -- SO
- Cancel the SO
-> PO -- Stock    canceled SO
- Set the quotation to draft and confirm it again
-> PO  -- Stock
   RFQ -- Stock -- SO
- If the user cancel the RFQ we will get this diagram:
-> PO -- Stock
         Stock -- SO
The user can't reserve the chain correctly. Also a new RFQ will be
generated each time the user delete the existing one even if the PO
already exists.

It happens because the move keep the procure methode MTO although
the moves origin and destination links are broken.

This commit changes the move destination from purchase order
line to MTS if the RFQ is deleted. This implies that RFQ are
not automatically generated by the scheduler.
2017-11-27 14:50:52 +01:00
Christophe Simonis 810b6aa760 [MERGE] forward port branch saas-15 up to d1fcca1504 2017-10-31 15:25:01 +01:00
Christophe Simonis d1fcca1504 [MERGE] forward port branch saas-14 up to a0157f104f 2017-10-31 12:36:47 +01:00
Christophe Simonis a0157f104f [MERGE] forward port branch 10.0 up to dcce040a63 2017-10-31 12:07:15 +01:00
Yenthe V.G a6603b1a5d [FIX] purchase: use procurement instead of self 2017-10-27 13:27:10 +02:00
Simon Lejeune b33ef74d16 [FIX] purchase: amount of the purchase in the logged message
When a picking is created from a purchase order, a message is logged in
the chatter:  "This transfer has been created from: POXXX: XX$".

Ideally, an inventory user should not have access to the purchase
orders. Sadly, removing the access right brings a lot of access right
issues, so this commit only remove the amount from the logged message

We adapt the name_get that always displayed the total amount of the
purchase order since rev[1], as a message was logged in the chatter when
a picking is created from a purchase order and the message contained this
value.

We implement a context key to display the total amount in the name_get,
as it is used when linking a vendor bill to a purchase order.

[1] 0c618d79ff
2017-10-10 15:17:11 +02:00
Vandan Shah 41a3c884c0 [IMP] purchase: when product qty is change in confirmed PO display log note 2017-09-27 13:20:00 +02:00
Christophe Simonis 5c51a0ad4d [MERGE] forward port branch saas-17 up to bf4ccb21f6 2017-09-21 18:14:55 +02:00
Christophe Simonis bf4ccb21f6 [MERGE] forward port branch saas-16 up to 88395bdb8e 2017-09-21 17:18:49 +02:00
Christophe Simonis 88395bdb8e [MERGE] forward port branch saas-15 up to 3ad3b34df6 2017-09-21 16:00:27 +02:00
Christophe Simonis 3ad3b34df6 [MERGE] forward port branch saas-14 up to 537d1ec0d2 2017-09-21 15:08:34 +02:00