summaryrefslogtreecommitdiff
path: root/addons/mrp_subcontracting/models
AgeCommit message (Collapse)Author
2021-04-08[FIX] mrp_subcontracting: create QC subcontractingsvs-odoo
Before this commit, if a product has Quality Points, the Quality Checks weren't created if the product was subcontracted. How to reproduce: - Create a product with a BOM of "Subcontracting" type and set a subcontractor; - Create a Quality Point for this product, for the receipt; - Create a RFQ for this product with the subcontractor as vendor; - Confirm the RFQ and receive the product -> There is no Quality Check to perform. closes odoo/odoo#68999 X-original-commit: ebc507ae1d905c76b0763cf17ebe4bad823d5964 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com> Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
2021-03-18[FIX] mrp_subcontracting: fix subcontracting + MTORémy Voet (ryv)
Issue: In case of MTO on the component tracked by serial of the subcontracted MO, if the picking generated by the MTO is complete before record component on the subcontracted picking, when we record the component, move lines is duplicated, one for the reservation (due to the MTO chained move) and a other only with the quantity done. Then it is painful to register component. Fixes: Don't the call of `_set_qty_producing()` when we click on 'Record Component', the user should it self applied the `qty_producing`. closes odoo/odoo#66873 Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
2021-03-18[FIX] mrp_subcontracting, stock: Resupply Subcontractor on OrderArnold Moyaux
Steps to reproduce the bug: - Let's consider a consumable product P with a subcontracted BOM B - Let's consider that B is subcontracted by a partner S and B has a storable component C - C has the route Resupply Subcontractor on Order and has a partner SUP as supplier - Create a purchase order PO with 1 P to S and confirm PO - A delivery order DO1 is created with C to S - Change the ordered quantity on PO and set 2 instead of 1 Bug: DO1 was canceled and a new delivery order DO2 was created with only 1 C instead of 2 It happens due to merge move, when updating the PO line a new rule is trigger and create the object in this order: - Move Sub-Stock(finished) -> Subcontract Order -> Move Stock-Sub(comp) Then the action_confirm is trigger and will run _merge_move on object from left to right order. But when the move Sub-Stock is merged, everything is write in the first move and the new move is unlink. It result by canceling all the following object (so the new subcontractor and the Move Stock-Sub). It was not an issue for the subcontracting since the write of stock.move is overridden in order to update the order quantity when the move quantity is updated. However in this case the rule are not triggered in order to create the moves that ressuply the subcontractor. In order to avoid this mess, this PR prevent the merge in case of a subcontracting move. opw-2419222 closes odoo/odoo#68098 X-original-commit: 48f2bbb844502c91dce59e8d869b56df0960fd0a Signed-off-by: Simon Goffin (sig) <sig@openerp.com> Co-authored-by: simongoffin <sig@odoo.com>
2021-03-02[FIX] mrp_subcontracting: wrong subcontracted productionsyhu-odoo
Previously, when we find out subcontracted productions of moves, we get all production_id from the origin moves of the moves. When user use multple steps manufacturing, moves may also have their move_orig_ids. In this case, we will consider its production_id as subcontracted production. To fix, we filered the moves, consider only move that is_subcontract is true. closes odoo/odoo#67066 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-11-18[FIX] mrp_subcontracting: fix flow with only tracked finished productRémy Voet (ryv)
Step to reproduce: - Create a subcontracting BoM by partner A, for a tracked product B (by serial or lots) - Create a incoming transfer coming from A and mark as todo. - Fill the move with move lines with lot + quantity. - It is impossible to validate the transfer, "You need to supply lot..." Also at the creation of the picking a warning popover indicate that the previous operation (the hidden MO) is set after the transfer. These issues comes from the refactor of mrp for v14 and the part of subcontracting wasn't complete obviously. Fixes done: - Rewrite the code of the `_action_done` for subcontracting. It is for the case of tracked finished product without any tracked component, there wasn't any code to manage that. Now manage it by backorder MO feature. Fix the main bug - Set finished_date_planned before the transfer to avoid the alert popover. - Avoid to write activity in channel about the hidden MO in case of cancelling. - Fix `action_record_components` to manage multiple subcontracting products with tracked component. - Remove the `priority` field from the wizard MO (in case of tracked product. Also the wizard is not really a wizard, just a weird hybrid MO form) PR: odoo/odoo#61606 task-2357115 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-09-09[FIX] mrp_subcontracting: Error Message with partial deliveryGoffin Simon
Steps to reproduce: - Create a product P with route 'Resupply subcontractor on an order' - Let's consider a BOM for P with type 'Subcontracting' - Create a PO with subcontractor set on that product and process with Qty > 1, - Validate a receipt with partial Qty and no backorder Bug: An error was raised because no production_id was set when trying to create a mrp.product.produce When function _action_done is called with cancel_backorder = True, the function _action_cancel is called on the new_move with no backorder and it called the function _action_cancel defined on model stock.move in module mrp_subcontracting This function called _action_cancel on the mrp.production record MP And finally this function called action_cancel on model stock.move on all finish_moves and raw_moves of MP This line unlink MP of finish_moves and raw_moves move.move_dest_ids.write({'move_orig_ids': [(3, move.id, 0)]}) That's why production_id was not set PS: In this way, we don't cancel a MO when it is still used by other moves. opw:2322278 closes odoo/odoo#57340 X-original-commit: e4d22d390c8aa8edf757e36704a9e04b2b89f115 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-07-30[FIX] mrp_subcontracting: fix flow with tracked componentRémy Voet (ryv)
After the odoo/odoo#52949 , the registering of tracked component, in case of subcontracting, was broken. Fix and try to mimic the same flow than before. The produce wizard has been replaced by a clean MO form to register component and use backorder mechanisme of MO to manage tracked finished product + tracked component. task-2278147 closes odoo/odoo#54994 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-06-15[REF] mrp: byproduct onchangeArnold Moyaux
Create the byproduct moves at the onchange. task-2241471
2020-06-15[REF] mrp: workorders for enterpriseArnold Moyaux
Removed abstract workorder Removed the integration of expiry wizard in tablet view since it should be moved in enterprise in the tablet view implementation (not possible to set consumed lot on workorders on community anymore) Refactor _set_quantity_done to use ORM command in order to not return a dict with vals to_create/to_write task-2241471
2020-06-15[REF] mrp: review consumption allowingRémy Voet (ryv)
Now, by default, a Bill of Material have a flexible consumption instead of strict consumption. Also add new consumption choice: a flexible consumption but with a warning when the bom isn't respected. Also, now, the strict (a new warning option) consumption is checked only when we try to mark as done the MO. task-2241471
2020-06-15[REF] mrp: no more produce wizardWilliam Henrotin
Use a view similar as the pickings one. task-2241471
2020-05-26[IMP] *: use specific ir.property methodsMartin Trigaux
Do not make direct CRUD to ir.property records, use appropriate methods for that
2020-04-02[IMP] mrp_subcontracting: create stock move lines in batchVictor Feyens
X-original-commit: e721dc6c25c52ae18aa74b3ffc4cc366b45b16f5
2020-03-30[FIX] *: set ondelete policy of required Selection fieldsAdrian Torres
With this commit, Selection fields with `required=True` which are extended via `selection_add` are given proper ondelete policies to ensure the cleanup of records containing these extended options during uninstall of the extending module. This commit also cleans up leftover uninstall hooks that were being used to handle the same set of problems prior to the ondelete mechanism being implemented for Selection fields. closes odoo/odoo#46325 Related: odoo/enterprise#9117 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-02[FIX] mrp_subcontracting: Allow subcontractor contacts to be usedPedro M. Baeza
**Steps to reproduce:** * Create a subcontractor. * Create a BoM of type Subcontracting and assign the subcontractor. * Create a children contact for the subcontractor. * Creat a purchase order (or a receipt picking) with the children contact of the subcontractor. * Confirm the document. **Current behavior:** Subcontractor documents are not created. **Expected result:** They should be created. **Cause:** The BoM search is not including possible parents of the partners. **Solution:** With the use of `parent_of` operator in the search, we cover both cases of the children and the parent as initiators of the subcontracting. closes odoo/odoo#46670 X-original-commit: 86726aba26f4ba8d7dadb29ed2415baf49fe54c0 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-02-24[FIX] mrp_subcontracting: multi-step receiptNicolas Martinelli
- Activate the multi-step reception - Create a Subcontracting BOM for product P and supplier S. - Create a PO for S with P - Validate the PO - Validate the input transfer - Validate the internal transfer A error is raised because a mandatory field is not set. The root cause comes from the INT move being flagged as a subcontract move, while it shouldn't be. Indeed, only the input move should be flagged as subcontract. We force the `is_subcontract` value to `False` when a move is copied in the context of a stock rule. opw-2193009 opw-2202727 closes odoo/odoo#46115 X-original-commit: 8795e0f3d4301710a089d263395633759eae76b7 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-27[FIX] mrp_subcontracting: lot_id instead of lot_name in receiptArnold Moyaux
Usecase to reproduce: - Create a subcontracted product tracked without tracked components - Create a receipt for this product - Click on show detail -> Lot_id are display even if the picking type uses create lot. The assign serial feature is not working either. The lot_id instead of lot_name is required in case of tracked components since it will open the produce wizard and the user will create lot there. However in the case of non-tracked components, the wizard will not be used nor lot created. In this case the classic behavior should be used with lot_name closes odoo/odoo#43997 Task: 2180191 X-original-commit: 00fe4186935435f46a0db197c68e6df956fe80db Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-20[IMP] mrp_subcontracting: filter on partner and productArnold Moyaux
Allow to easily find product and partners related to subcontracting closes odoo/odoo#43046 Task: 2158126 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-02[FIX] mrp_subcontracting: cancel a PO should cancel deliveryArnold Moyaux
When subcontracting a product via a purchase order and not a simple receipt. Then the cancelation of the receipt will not only cancel the receipt of the finished product but not the delivery for the components. It happens because button_cancel on purchase order will call _action_cancel the stock.move linked to purchase order line. It will not call action_cancel on the stock.picking. However the part responsible for the cancelation of components delivery is in the stock.picking action_cancel method. Move the stock.picking action_cancel logic in the stock.move _action_cancel method since it's always call for both usecase. Fixes #42551 closes odoo/odoo#42653 X-original-commit: 841305f271411c3a67af271ac09da9ce0922f100 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-18[IMP] * : replace with_context(force_company=c) by with_company(c)Victor Feyens
2019-10-25[REF] *: adapt tests to picking button_validate multiSimon Lejeune
2019-10-23[REF] stock: Set action_done on pickings privateArnaud Baes
`action_done`on pickings should be a private method, and called only trough the picking validation process. task-1938108 closes odoo/odoo#39174 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-16[FIX] mrp_subcontracting: correct type for view registryArnold Moyaux
When the action is called by a javascript function the view is not correctly rendered because the tree type does not exist in the registry but the correct type is list.
2019-10-16[IMP] mrp_subcontracting: Set subcontracting location a child of physical ↵Arnaud Baes
locations. closes odoo/odoo#33490 Taskid: 1873106 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-16[IMP] stock: Rename default locations labelsJigar Patel
TaskID: 1873106
2019-10-09[MERGE] forward port branch 13.0 up to f4105eb9c70Christophe Simonis
2019-09-24[FIX] mrp_subcontracting: Initial demand in a BOArnold Moyaux
Usecase to reproduce: - Create a receipt with a quantity of 2 - Receive 1 and create a back order - Receive 2 in the BO It will only require the components for 2 units and not 3. closes odoo/odoo#37305 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-09-18[REF] mrp_subcontracting: manage backorderSimon Lejeune
closes odoo/odoo#37046 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-18[FIX] mrp_subcontracting: empty BoM if no subcontractorArnold Moyaux
_bom_subcontract_find return a BoM of typer subcontractor for any partners if the subcontractor is not set. The real behavior is to not create a subcontracting order if the partner is not set.
2019-09-18[FIX] mrp_subcontracting: multi companyArnold Moyaux
2019-09-12[FIX] mrp_subcontracting: cannot order by many2many fieldRaphael Collet
2019-09-20[MERGE] forward port branch saas-12.5 up to 58a83d12228Christophe Simonis
2019-09-03[REF] mrp_subcontracting: multi companySimon Lejeune
Ensure proper domains are applied and enforced on relation fields thanks to the `check_company` attributes. task-1985992
2019-08-20[IMP] models: ORM speedupRaphael Collet
This branch is the combination of several optimizations in the ORM: * store field values once in the cache: the cache reflects more faithfully the database, only fields that explicitly depend on the context have an extra indirection in the cache; * delay recomputations by default: use method `recompute` to explicitly flush out pending recomputations; * delay updates in method `write`: updates are stored in a data structure that can be flushed efficiently to the database with method `flush` (which also flush out recomputations); * make method `modified` take advantage of inverse fields to inverse dependencies; * filter records by evaluating a domain on records in Python; * a computed field with `readonly=False` behaves like a normal field with an onchange method; * computed fields are computed in superuser mode by default. Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien Pinckaers. closes odoo/odoo#35659 Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-19[IMP] mrp_subcontracting: bypass reservationArnold Moyaux
A subcontracting receipt should be always assigned even if the components are not deliver. It depends on the partner and not our company.
2019-08-19[MOV] purchase_mrp_subcontracting -> mrp_subcontracting_accountArnold Moyaux
2019-08-19[IMP] mrp_subcontracting: subcontractors requiredArnold Moyaux
Force to set subcontractors on subcontracting BoM since it's always used in order to determine if a subcontracting should be apply on a receipt or not. Also there is not magical behavior has 'if there is no subcontractor on the BoM then it means all partners...'
2019-08-19[IMP] mrp_subcontracting: cancel subcontract orderArnold Moyaux
A subcontracting receipt cancellation should cancel the subcontracting order and the associated document.
2019-08-19[FIX] mrp: do not base default on active_idArnold Moyaux
Since active_id do not works allows to use a context key that will not be modified magically.
2019-08-19[REF] mrp_subcontracting: views v2Arnold Moyaux
- nothing tracked The "register components" button shouldn't appear, the receipt looks normal. - finished products tracked The "register components" button shouldn't appear, the receipt looks normal. - finished products not tracked and components tracked The "register components" button appear and the burger redirects to "Produce" wizard. The user should record all the productions before being able to access SML through the burger wizard. He cannot force any SML for subcontracted products with tracked components before having recorded all the productions. - finished products and components tracked The "register components" button appear and the burger redirects to "Produce" wizard. The user should record all the productions before being able to access SML through the burger wizard. He cannot force any SML for subcontracted products with tracked components before having recorded all the productions.
2019-08-19[IMP] mrp_subcontracting: modify initial demandArnold Moyaux
Modify the initial demand for a subcontract receipt should update the delivery to the subcontractor.
2019-08-19[FIX] mrp_subcontracting: access error on purchaseArnold Moyaux
Usecase to reproduce: - Validate a purchase_order with a user without group inventory user or manufacturing user. AccessError on operation read for BoM. A purchase user should be able to validate an order independently of the documents that will be generate.
2019-08-19[ADD] mrp_subcontracting_dropshippingArnold Moyaux
Allow to do a dropshipping with a subcontractor. If the product uses the routes drophipping and have a subcontracting BoM. Then a PO for the subcontractors will genrate a need in the subcontracting location for the required components. A module is needed because the picking_type_id for dropshipping do not have a warehouse_id. The warehouse_id is needed in order to know from which warehouse the subcontracting components should be deliver.
2019-08-19[IMP] mrp_subcontracting: partner on subcontract deliveryArnold Moyaux
If the components have the route resupply subcontractor on order then the delivery order triggered by the receipt do not have the origin nor the subcontractor partner. This commit update the procurement group in order to add those information and propagate it.
2019-08-19[FIX] mrp_subcontracting: allow to create lot.Arnold Moyaux
due to commit 108ee65af2a88d61526dc047043138bddc3f9b63#diff-99ad190cf09687f6efdebc1f7636062c picking type for subcontracting order use field use_create_components_lots instead of classic picking type.
2019-08-19[REF] mrp_subcontracting: remove partner typeArnold Moyaux
Replace the type subcontractor on the partner. Instead replace it by a property for a subcontracting location. The purpose is to have a simplier configuration. The user would just need to add the partner on the BoM in order to start a subcontracting process.
2019-08-19[REF] mrp_subcontracting: lot produced/consumed managementArnold Moyaux
Currently, the subcontract picking present multiple difficulties: - The user has to introduce multiple time the lot produced. In register components button and then create a new move line with the show details operation button. - Same problem with the correction system. The user has to modify the lot in details operation and then go on the subcontract production and unlock and edit it. In order to facilitate those behavior. A move line will be automaticaly created during the register components process. Also the subcontract moves for components will be available in the detail operations tab.
2019-08-19[FIX] mrp_subcontracting: remove hookArnold Moyaux
The hook only generate a useless rule. It has been already generated in stock_warehouse.py. Also remove the hook method and add it in data file.
2019-08-19[FIX] mrp_subcontracting: extra move correctly handle.Arnold Moyaux
Usecase to reproduce: - Create a receipt of 1 units of a subcontracted product - Receive 2 - Validate the receipt -> An extra move for subcontractor of 1 has been validated but a new move of 2 still in waiting availability and can not be validated. It happens due to action_done that will validate existing subcontract order (with the initial quantity). Then the move is validated and an extra move is created and merged in the first one. This new merged move of 2 is then confirmed and validated. That will recreate a subcontract order of 2 that will not be validated since it was validated in the picking action_done at the start. This commit will modify: - action_done on move in order to validate the subcontract order after the move validation and the new subcontract order creation too. - action_confirm in order to create the subcontract order with the additional quantity and then merge it to the existing moves.
2019-08-14[IMP] stock: default sequence for picking typesArnaud Baes