summaryrefslogtreecommitdiff
path: root/addons/purchase_stock/tests
AgeCommit message (Collapse)Author
2021-04-30[FIX] purchase_stock: consider product unit price precisionAdrien Widart
When changing the product price precision, this can lead to incorrect stock valuations. To reproduce the error: (Enable debug mode) 1. Go to Settings > Technical > Database Strucutre > Decimal Accuracy 2. Edit Product Price: - Digits: 4 3. Create a Product Category PC: - Costing Method: FIFO 4. Create a Product P: - Product Type: Storable Product - Product Category: PC 5. Create a RfQ with product P: - Quantity: 1000 - Unit Price: 0.035 6. Confirm Order, Receive Products, Validate 7. Click on Valuation Error: The total value is equal to $40 instead of $35. The calculation was done after rounding the unit price: $0.035 becomes $0.04, then 1000*0.04=$40. When confirming the RfQ, a stock move is created. To do so, the method `_get_stock_move_price_unit` is called. When validating the delivery, it recomputes the unit price thanks to method `_get_price_unit`. In both situation, and if the line has taxes, the method `compute_all` is called like this: ```python price_unit = line.taxes_id.with_context(round=False).compute_all(price_unit, currency=line.order_id.currency_id, quantity=1.0)['total_void'] ``` But here is the problem. In this method, total amount is computed with this line: ```python base = currency.round(price_unit * quantity) ``` However, `quantity` is equal to 1 and the multiplication is rounded using the currency precision. As a result, `base` is equal to $0.04. Then, all computations will use this value and will be incorrect. This fix applies the real quantity so `base` will have the correct value: ``` base = currency.round(price_unit * quantity) = currency.round(0.035 * 1000) = 35 ``` OPW-2472192 closes odoo/odoo#70080 X-original-commit: a57dc07189c15296055d6a07ca6d0bd350c4f11a Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-04-12[FIX] account: never set default for invoice_datewan
For customer invoices: * do not set default date because if you prepare an invoice (and it gets a default date), then validate it the next day, the date will be wrong * set the date when posting if it wasn't set, because why not? For vendor bills: * do not set default date because you rarely encode a bill at the bill date. Forcing the user to enter it reduces risks of user error (duplicated vendor bill) * do not set it when posting, same reason. opw-2492862 Related #68368 Closes #68367 closes odoo/odoo#68689 Related: odoo/enterprise#17502 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-13[FIX] purchase: Update correctly the price according to UoMAchraf (abz)
What are the steps to reproduce your issue ? 1. Create Product with Purchase Vendor(s) set 2. Create Units of Measure that are bigger than (10kg/50kg in tests) What is currently happening ? If you put a vendor that is listed in product form, when changing purchase unit from kg to 10/50kg price is updated If you put a vendor not listed, it gives cost price which is correct, but does not update price according to unit of measure. What are you expecting to happen ? Update correctly the unit of measure when the vendor is not listed opw-2494769 closes odoo/odoo#69148 Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-03-24[REV] purchase_stock: don't hide replenishment originNicolas Galler
This reverts commit 170729ee58b199041d7545e7789ac9474e86f998, per discussion with @thomasdeleval on linked ticket. opw-2422438 closes odoo/odoo#64841 Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
2021-02-25[FIX] purchase_stock: `on_time_rate` in multi companiesDenis Ledoux
Because of the weird behavior of the ORM regarding related field pointing to computed fields, `on_time_rate` was taking account of all companies when asking it through `purchase.order.on_time_rate` but it was single-company when asked through `res.partner.on_time_rate`. It was observed during an upgrade request issue analysis, and in that case the problem was not even the fact it was miscomputed, but the fact this computed field, computed as sudo, leaded to fill the cache for `purchase.order.line.move_ids` with `stock.move` belonging to other companies than the user one, and then when attempting to read values from these stock moves a multi-company access error was raised. upg-8106 closes odoo/odoo#66840 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-02-22[FIX] Purchase double validation can be circumvented by RPC callStefan Rijnhart
closes odoo/odoo#66505 Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-12-29[FIX] purchase_stock: do not include internal notes in generated PONicolas Galler
Behavior prior to this commit: When a PO is generated (via reordering rule, mto rule, or manual replenish), the description on the PO line includes the internal notes. Behavior after this commit: The description on the PO line does not include the internal notes. opw-24222438 closes odoo/odoo#63892 Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2021-01-12[FIX] purchase,purchase_stock: use correct company on PO creationVictor Feyens
The picking_type and currency were taken from the current company, even if the purchase order is created in another company. Fixes #35026 closes odoo/odoo#64469 X-original-commit: d080a5ea6b63832a6df00dce60c0b531d306241a Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-11-19[FIX] purchase_stock: vendor codeNicolas Martinelli
- Create a product P with a MTO Reordering Rule (Buy Route) - Add a supplier to P with a specific vendor code - Create a SO for 1 unit of P, validate A PO is created for the supplier but without using the vendor code. It happens because the vendor code is overridden by the product description. To avoid losing information and redundancy, we add the line description only if different from the product name. opw-2383418 closes odoo/odoo#61922 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-30[FIX] stock: consistently use translated value for product descriptionNicolas Galler
Behavior prior to this commit: In a multi-lingual setup, when entering a SO for a customer set in a non-default language with a product that has translation in both languages and is set up to replenish on order, the description in the generated RFQ is duplicated, for example: "Product test Test Product in Dutch" The problem stems from the fact that the description on the generated stock move is set to the translated name of the product. When generating the PO, the stock move class removes the product name to avoid duplicating the description, but it uses the non-translated name in the comparison. Behavior after this commit: The description on the RFQ line is included only once (using the default language for the database) opw-2368562 closes odoo/odoo#61040 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-02[IMP] purchase_stock: hide replenishment originsvs-odoo
When a Purchase Order is created by the replenishment report, doesn't pass the origin ("Manual Replenishment" or "Replenishment Report"). task-2328830 closes odoo/odoo#57254 Related: odoo/enterprise#13047 Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-02[FIX] *: fix all the typosMartin Trigaux
And other reported English mistakes in source string Courtesy of Transifex translators And remove leftover from gengo closes odoo/odoo#59002 Related: odoo/enterprise#13776 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-30[FIX] purchase_stock: precision differenceNicolas Martinelli
- Create stockable product P: FIFO, Automated Valuation - Set the price difference account - Configure Decimal Accuracy for Product Price to 6 digits - Create a PO - Add a line with: Product P Quantity: 100,000 Price unit: 0.005 - Confirm the PO, receive the product and create the invoice - Set a price unit of 0.006 on the invoice line - Post the invoice No price difference booking is generated, while a price difference of 100 should be created. It happens because we compare the price units with the currency precision. Comparing the price units, even with the proper Product Price precision, is not a good idea. Indeed, in case discounts are applied the price unit computed ends up with a larger precision. As a solution, we check if the subtotal of the journal entry is different from zero. opw-2341181 closes odoo/odoo#58364 closes odoo/odoo#58655 X-original-commit: 6ba9e7eef8d5aca33e63e64e819c91d1868e7349 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-09-30[FIX] purchase_stock: small discount at invoicingNicolas Martinelli
- Create stockable product P: FIFO, Automated Valuation - Set the price difference account - Configure Decimal Accuracy for Discounts to 5. - Create a PO - Add a line with: Product P Quantity: 10,000 Price unit: 100 A tax - Confirm the PO, receive the product and create the invoice - Set a discount of 0.92431 on the invoice line - Post the invoice The journal entries for the invoices contains the price difference move, the amount must be 9,243.10 but is 9,200.00. In case taxes are defined on the the invoice line, we call `compute_all` which will round the `price_unit`. In this case, we don't want to round it. Fixes #56832 opw-2329028 X-original-commit: 498238fb02c32285f9d9ac779884105ae9eaa1e4
2020-09-11[FIX] *stock*: fix date_deadlineRémy Voet (ryv)
date_deadline of the stock move has been reviewed: - Now, it represents the datetime when the operation must be done to be in time for the uppest document (SO/PO/MO/RR). - At the creation of stock move the date_deadline is computed in the same way than the sheduled date expected that it is not include security days (inverse the logic for PO). - When we update the delivery date (or lead time) of SO (or PO). The deadline of related stock move is updated and the delta is propagate between origin and dest moves. task-2324039
2020-08-27[REF] various: use helper to create tests usersThibault Delavallée
PURPOSE Lessen use of mail-specific calls and variables SPECIFICATIONS Use mail_new_test_user tool in tests, lessening use of mail-specific context keys in tests. LINKS Task ID-2326281 (context keys use cleaning) PR odoo/odoo#56631 PR odoo/enterprise#12707
2020-08-25[FIX] purchase_stock: mock datetime to avoid midnightWilliam Henrotin
The test test_update_date_planned issued starting just before midnight. a purchase was created at 23:59:59 then the variable `today` was assigned to 00:00:01. When comparing the activity generated by the test, taking 23:59:59.today() and 00:00:01.today() gave two different values. This commit force the test time to 09:00:00. Task : 2325270 closes odoo/odoo#56527 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-08-18[REF] core: _name_search() now returns a list of idsRaphael Collet
This provides a better API to search for records by name without the formatting part (`display_name`). This also simplifies all the overridings of `_name_search` that no longer need to call `name_get()`. The call to `name_get()` is done in method `name_search` in a generic way.
2020-08-18[FIX] *stock*, mrp: fix effective_dateRémy Voet (ryv)
- Avoid to truncate the hour/min/sec in the computation of the effective date which is related to the `date_done` of the first incoming picking. - With manufacturing in 3-step (pbm_sam), the store picking had a source document == "New". It was the case because the `_get_move_finished_values` was call before the create and the name is set only on create. To fix this issue, during the `create` set the origin of all move. - To avoid to maintain old views unused, remove unused view of stock move. - The computation of the products_availability json is too expensive to be in tree view (2.5 times long with it) of picking. It will be hard to optimize because the half the time is due to _get_report_lines method - already in batch (on 80 records). - Review buttons of the replenishment list to be more Odooer. - In some cases the delay alert date was wrongly compute: - If we new dest_move_ids of a existant move, the delay alert date won't be compute. - If the state (to done) and the date are save in same write call the alert date of next move won't be reset. To avoids these issues, refactor the alert date to be a compute stored fields. - To avoid any confusion between date expected in the replenishement (in date) and the purchase order receipt date (datetime), we put the receipt date at the middle of the day. Also On-Time Delivery Rate computation counts only when date are bigger effective date trunced to date. Also used the timezone of the company by default (if not user timezone) task-2246665 closes odoo/odoo#55379 Related: odoo/upgrade#1586 Related: odoo/enterprise#12309 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-08-18[IMP] stock*,mrp*: Dates RefactorRémy Voet (ryv)
- The deadline of MO generated via procurements is calculated differently. Now, it doesn't take anymore in account the manufacturing_lead of the company (Security Lead Time of MO). The computation of planned date remains unchanged. - The date_expected fields was duplicated with the date fields except when the move was done. Merge both fields. The only information lost is: we can't know what was the scheduled date before processing move (`state` == done). Indeed, the date becomes the actual move processing datetime. - The `date` in `stock.picking` field contained the time of (purchase) order `date_order` (`purchase.order`). This field is was wrongly used in the kanban view where we expected to see date_planned instead. Also, the `_order` used this date instead of date_planned too. - The `delay_alert` is activate independently of stock rules. Then it is now activate in all case. - Remove the auto-reschedulting process of stock move via the stock rule (`propagate_date` and `propagate_date_minimum_delta`). Replace it by a automatic deadline date (`date_deadline`) propagation. The deadline is the promise done to/by vendor/client (SO/PO) then it is a readonly fields on picking/move and MO. - Now the Scheduled date (`date`) of stock move is never propagate and it is only related to the Scheduled date of related document (MO or picking). - Now when a move is created from procurement (sale), `date_planned` = `date_deadline` - `security_lead`. - The `delivery_date` of sale is no editable after confirmation and propagate as the deadline to related stock move linked to order_line - Adapt filter and decoration of MO and picking. - Because we are the client in case of purchase (PO), the promise of vendor can be not respected. Then we add the lead security to the deadline (inverse the sale order logic) of PO picking (promise reciept date + security lead) to match with the replenishment. task-2246665
2020-08-05[IMP] account: soft post entries in the futurewilliam
Add an easy way to not post the entries in the future when calling post() on it, but rather set it to be auto-posted at accounting date. This is useful when we are creating a lot of entries in batch and some might be in the future, some in the past, and we don't want to separate that in two batch every time. (asset, accrual, transfer,... )
2020-08-03[IMP] stock: Hide Replenish on Order routesArnold Moyaux
Improve onboarding by removing the replenish on order route. Companies that do MTO process could unarchive the route in order to have a basic configuration. closes odoo/odoo#55147 Task: 2245882 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-07-31[IMP] purchase_stock: extend replenishment reportsvs-odoo
Adds Purchase Orders as replenishment/consuming document for the replenishment report. task-2058495
2020-07-31[IMP] purchase_stock: Remove test_fifo_price dependency to AccountTestCommonLaurent Smet
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180
2020-07-31[IMP] purchase_stock: Remove test_average_price dependency to AccountTestCommonLaurent Smet
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180
2020-07-31[IMP] purchase_stock: Remove test_fifo_returns dependency to AccountTestCommonLaurent Smet
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180
2020-07-31[IMP] purchase_stock: Remove test_purchase_order dependency to AccountTestCommonLaurent Smet
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180
2020-07-31[IMP] stock_account: Remove ValuationReconciliationTestCommon dependency to ↵Laurent Smet
AccountTestCommon l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180
2020-07-31[IMP] point_of_sale,stock_*: Remove StockAccountTestCommon setup classLaurent Smet
If run post_install, this setup class is not necessary.
2020-07-28[IMP] (purchase_)stock: reserve and replenish automaticallyyhu-odoo
1. When reservation can't be done for some products, we automatically evaluate their reordering rules and create the corresponding replenishment document. 2. When receiving products in stock, automatically check if some stock moves are available and assign them. Task 2244230 PR #52433 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-07-16[IMP] purchase_stock: Remove test_stockvaluation dependency to AccountTestCommonLaurent Smet
Also, this commit fixes the usage of the 'invoice_policy' field in test that is introduced by the 'sale' module. l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2296213
2020-06-29[IMP] purchase(_stock): portal update scheduled dateyhu-odoo
1. Show only date not datetime on update portal. When update the scheduled date, set it to be the last minute of that date. 2. Send updated date immediately when user pick a date. 3. If an activity for update the date already exist, update the note instead of creating a new one. Task #2265912 PR 52809
2020-06-24[IMP] stock: propagate_date on 1st receipt movePratima Gupta
1) Before this commit, propagate date on 1st receipt move was always False if PO was created manually. After this commit, move will be assigned with propagte_date of buy route of warehouse only if there is not move_dest_ids. 2) Default settings on routes as - 1) If receipts in 3 steps > the alert on the receipt (+ propagate) and the propagate rescheduling on the followings 2) If receipt in 1 step > the alert on the buy rule (no propagate rescheduling) Task-2209541 closes odoo/odoo#51853 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-06-09[IMP] purchase: set scheduled date to the last minute of that dayyhu-odoo
When set scheduled date on PO line, set it to be the last minute of that day to correctly decide the late of the receipt. Task 2265912 PR #52693 Related: odoo/enterprise#11034 Related: odoo/upgrade#1323 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-05-18[IMP] models: use slots for BaseModelRaphael Collet
This restricts the attributes of a BaseModel instance to `env`, `_ids` and `_prefetch_ids`. This way, one can only assign fields on a record; other assignments are programming errors. This also reduces the memory footprint of records from 168 to 64 bytes (-62%), and makes their instanciation faster. closes odoo/odoo#51075 Related: odoo/enterprise#10529 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-05-13[FIX] purchase_stock: receipt with returnNicolas Martinelli
- Create a PO, order 5 items - Validate Receipt with 5 items - Return 1 item to Vendor - Update Order Quantity on PO, from 5 to 8 A picking of 3 units is created. If the same workflow is used in Sales, a picking of 4 units would be created, which is the expected behavior. We adapt the logic of Sales [1] to Purchase. [1] https://github.com/odoo/odoo/commit/8a3284685856b6980e3b620abdbbb3e2c79f57c4 opw-2233826 closes odoo/odoo#51174 X-original-commit: 74e8b9ab2311ed2c1c9cea53d09e3b352db3dbe6 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-22[FIX] purchase_stock: remove forgotten printArnold Moyaux
Remove forgotten debug print in test closes odoo/odoo#49944 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-04-22[IMP] stock, mrp, purchase_stock: allow to define vendor, bom on orderpointsArnold Moyaux
Allow to set a BoM or a vendor on an orderpoint. In this case it's passed to the values and will be processed by _run_buy and _run_manufacture to use them. Task: 2161378
2020-04-22[IMP] stock, purchase_stock, mrp: Replenishment ReportArnold Moyaux
New report to easily order missing products in each warehouse. Orderpoint have a new type: 'manual'. Manual orderpoint are not trigger by the scheduler but the user could create replenishment from the report directly. The report use the forecast report in order to detect missing quantity for today (it does not search depending the lead time for each product warehouse due to lake of performance). It compares missing quantity with incoming RFQ and other ongoing orderpoint. If it still missing a new entry for replenihsment is created (it's also automaticaly deleted if the replenihsment has been done another way). Task: 2161378
2020-03-31[IMP] purchase(_stock): Add more and update PO datesTiffany Chang (tic)
Adds "Expected Date" and "Effective Date" fields to purchase orders to match what exists in sales orders. "Effective Date" mirrors sales logic (= first completed stock move). "Expected Date" has simplier logic due to simplier nature of receiving stock vs shipping (= earliest "Scheduled Date" of all PO lines). Form view has been updated to include these new fields. Additionally code was changed to not have PO 'order_line.date_planned' be overwritten by the 'purchase_order.date_planned' value. Previous behavior was both confusing and made it so info was lost. Also logic for related stock move picking line expected date values has been updated to now consider 'purchase_order.date_planned' value if set. Related changes include: - not overwriting when PO is edited+saved (this only occurred in write() logic, not create() which caused inconsistent behavior anyways.), - updating related tests, - removing PO line date_planned editing restriction when PO date_planned is set - updating of relevant stock moves/picking expected date due to PO.line.propogate_date = True ('purchase_order.date_planned' if exists, otherwise 'order_line.date_planned') This change also includes some small related improvements: - Removal of outdated code comment. - Addition of Help strings to better explain fields. - Prevent copy of 'date_planned' value into new POs (now mirrors sales logic). This change corresponds to "Receipt Date on PO's" subsection of Purchase KPIs task. Task #2198420
2020-03-13[FIX] product, purchase_stock: fix infinite loop on template name_searchjvm-odoo
Issue - Install purchase_product_matrix, Inventory - Create a (storable) Product P with default_code e.g. VOB2A with a vendor V who uses a product_code e.g. VOB2a - Create a PO/RFQ for vendor V - Add a product, search "vob2" (copy/paste) Infinite loop Cause purchase_product_matrix replace purchase.order_line.product.product by product.template so the name_search is different and the product.template's name_search loop doesn't support the case where you have default_code == product_code Solution Check if the product's name_search returned a product containing product_template_ids that we did not wanted (as mentionned in the domain). If yes, it means that we will have an infinite loop so we should break. Additional note: the issue could be in versions < 13 but purchase_product_matrix is only in 13.0 and this is not a very common case. OPW-2193005 closes odoo/odoo#47576 X-original-commit: 9d5d80f77bc04be83d5b2ca0569a6ea50e26a07e Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-05[IMP] purchase_requistion, purchase_requisition_stock: custom variantArnold Moyaux
Allow to use custom product decscription on requisition line. closes odoo/odoo#34174 Task: 1970476 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-03-05[IMP] stock, sale_stock, mrp, purchase_stock: transfer the custom variant ↵Mitali Patel
information Allow to propagate custom information to upper document. It could be usefull in many buisness that do custom stuff for people (t-shirt with user defined text, poster with own pictures...) The customes values are pass throught procurements'values and are display on MO or purchase order line. Task: 1970476
2020-03-09[FIX] stock: change of scheduled dateNicolas Martinelli
- Install Inventory, Purchase - General Settings/tick Multi-step routes - In Warehouses/YourCompany Incoming Shipments: Receive goods in input, then quality and then stock (3 steps) - Create a PO and add the same products on 2 lines. One has a scheduled date in the future - Go to transfers, where "Picking List" or "Procurement Group" correspond to your PO => the 3 scheduled_date correspond to Datetime.now() - Validate the first picking (WH/IN) The scheduled_date (resp date_expected) in the remaining pickings WH/INT (resp. stock moves) are changed to the past. This is due to the fact that both moves are merged in subsequent pickings. The cleanest solution would be to avoid the merge in case the expected dates are different. Although this makes sense, that also implies a change of behavior. Therefore, we avoid such situation by preventing the propagation of an expected date in the past, which does not make much sense when propagating. opw-2171509 closes odoo/odoo#47155 X-original-commit: c7b2341b35aabe394a34e14c48a913a8595737fc Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Co-authored-by: Arnold Moyaux <arm@odoo.com>
2020-03-02[IMP] purchase_stock: enhance extensibility of _run_buy method byLois Rilo
allowing to force the vendor to be used in the procurement batch. This does not change any default behavior. closes odoo/odoo#46678 X-original-commit: 8bff35182c38522bbd6fc218956fe0f8fe99eca4 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-02-19[IMP] account,* : Change type field to move_type in account.moveAnkita Raval
task-id: 2028z813
2020-02-04[FIX] purchase_stock: confuse return move and move destWilliam Henrotin
Increasing the quantity on a purchase order line will create a stock move with the delta quantity. In case the purchase order has a return among its picking_ids, the delta will be wrong. This is due to the fact a return move is considered like a move_dest of the original incoming move. The delta quantity will be computed from the return move which doens't make sense. This commit excludes outgoing moves from move_dest to avoid taking return move into account. closes odoo/odoo#44551 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-01-28[REF] purchase_stock: push the extra quantitySimon Lejeune
With a product configured as buy on order and a warehouse configured as receipt in two steps, if the user increases the quantity on a po line generated by a sale order before confirming it, the system will send all the quantity to input but only the ordered quantity to customer. The issue is that the "extra quantity" will stay in input. We fix this issue by creating a new move with the extra quantity to the input location so that push rules will send the extra quantity to stock while the ordered quantity will be sent to the customer. There was also an issue when incrementing the quantity on the po line after confirmation if the po line was the result of a reordering rule: only a move from supplier to the location of the reordering rule was created. This commit also introduces a change of semantic: `created_purchase_line_id` is cleared after confirming the RFQ. This allows to merge more in `_merge_moves`. task-1981355 closes odoo/odoo#43545 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-16[IMP] account: add 'partial' and 'reversed' payment states to invoicesoco-odoo
- 'partial' payment state corresponds to invoices whose payable/receivable move line has been partially reconciled with some other line. - 'reversed' payment state corresponds to entries that have been cancelled by the creation of a single reverse entry (using the dedicated button on the form view). This state can be set on invoice as well as on regular entries. => To stay consistent with the naming conventions, this commit also renames invoice_payment_state field to payment_state, since it's no longer only applicable on invoices. closes odoo/odoo#41723 Related: odoo/enterprise#7202 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-09[IMP] purchase_stock: day to purchaseArnold Moyaux
Create RFQ with an order by date in futur. It will allow to discuss RFQ before validate them and to be in time for the need. today Order by Sheduled date of receipt |_______________|___________________|_____________________| days to purchase vendor LT security days Task: 1849912