New reception report added for non-outgoing transfers. This is intended to support easier stock allocations by allowing dynamic MTO assignment/unassignment, e.g. if we have an incoming transfer with products we want to assign to an existing outgoing transfer, then we can use the report to create a MTO link to the specific outgoing moves. To support this assignment flow, the report also allows printing of labels to place on the product so stock workers know which transfer/MO the product has been assigned to. Expected use case is when a product is purchased to fulfil a sale. Demo data has been added so reception report can be immediately seen/used for this flow. Implementation Notes: - Report has been made flexible to work with batch transfers. - Only done moves can be assigned to moves that already have quants reserved (prevents undesired behavior + this makes sense logically) - Confirmed (+ Done and everything inbetween) moves can be assigned to any confirmed moves that are not already assigned. - Report does not affect quant reservation/unreservation at all. It works only with linking moves (i.e. move_orig_id/move_dest_id) so move/transfer linkage traceability is stored within db (i.e. this isn't possible with quants) Limitations: To keep code simple for now, this assignment flow will break in certain cases: 1. Done amount of an assigned move is less than the Demand amount (linked move will not autoreserve correctly when assigned move is validated, same issue already occurs in multi-step transfer). 2. If a linked move is unreserved after its assigned move is validated, then another move can reserve its quants and its assignment link will not be accurate. 3. Already reserved SNs + assign move, may lead to mismatching SNs between report and what's actually reserved. 4. Changing a linked move's Demand amount after a move is assigned to it. 5. Potential moves to assign to are only checked for being in same warehouse, not in a matching source location to destination location. User is expected to make this match on their own. Task: 2500844 ENT PR: odoo/enterprise#18268 Upgrade PR: odoo/upgrade#2731 closes odoo/odoo#70669 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
76 lines
3.1 KiB
XML
76 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
|
|
<record id="stock.res_company_1" model="res.company">
|
|
<field eval="1.0" name="po_lead"/>
|
|
</record>
|
|
|
|
<record id="product.product_delivery_01" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_delivery_02" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_5" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_9" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_12" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_13" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_16" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="product.product_product_20" model="product.product">
|
|
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
|
|
</record>
|
|
|
|
<record id="purchase_order_8" model="purchase.order">
|
|
<field name="partner_id" ref="base.res_partner_4"/>
|
|
<field name="user_id" ref="base.user_admin"/>
|
|
<field name="state">draft</field>
|
|
<field name="date_order" eval="(datetime.now() + relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
|
|
<field name="date_planned" eval="(datetime.now() + relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
|
|
<field name="order_line" model="purchase.order.line" eval="[(5, 0, 0),
|
|
(0, 0, {
|
|
'product_id': ref('product.product_product_25'),
|
|
'name': obj().env.ref('product.product_product_25').partner_ref,
|
|
'price_unit': 286.80,
|
|
'product_qty': 20.0,
|
|
'product_uom': ref('uom.product_uom_unit'),
|
|
'date_planned': DateTime.today()}),
|
|
]"/>
|
|
</record>
|
|
|
|
<function model="purchase.order" name="button_confirm" eval="[[ref('purchase_order_8')]]"/>
|
|
|
|
</data>
|
|
|
|
<data noupdate="0">
|
|
|
|
<record id="stock.stock_warehouse_shop0" model="stock.warehouse">
|
|
<field name="buy_to_resupply" eval="True"/>
|
|
</record>
|
|
|
|
<function model="stock.warehouse" name="write">
|
|
<value model="stock.warehouse" search="[('partner_id', '=', ref('stock.res_partner_company_1'))]"/>
|
|
<value eval="{'buy_to_resupply': True}"/>
|
|
</function>
|
|
|
|
</data>
|
|
|
|
</odoo>
|