mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] stock_request: Losing partner_id and origin (#664)
This commit is contained in:
committed by
Kitti U
parent
0e0be9eb53
commit
3943574bf3
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "Stock Request",
|
||||
"summary": "Internal request for stock",
|
||||
"version": "12.0.1.0.1",
|
||||
"version": "12.0.1.0.2",
|
||||
"license": "LGPL-3",
|
||||
"website": "https://github.com/stock-logistics-warehouse",
|
||||
"author": "Eficent, "
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from . import procurement_group
|
||||
from . import stock_request_abstract
|
||||
from . import stock_request
|
||||
from . import stock_request_allocation
|
||||
|
||||
19
stock_request/models/procurement_group.py
Normal file
19
stock_request/models/procurement_group.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright (C) 2019 Open Source Integrators
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class ProcurementGroup(models.Model):
|
||||
_inherit = 'procurement.group'
|
||||
|
||||
@api.model
|
||||
def run(self, product_id, product_qty, product_uom, location_id, name,
|
||||
origin, values):
|
||||
if 'stock_request_id' in values and values.get('stock_request_id'):
|
||||
req = self.env['stock.request'].browse(
|
||||
values.get('stock_request_id'))
|
||||
if req.order_id:
|
||||
origin = req.order_id.name
|
||||
return super().run(product_id, product_qty, product_uom, location_id,
|
||||
name, origin, values)
|
||||
@@ -530,6 +530,7 @@ class TestStockRequest(common.TransactionCase):
|
||||
self.assertEqual(stock_request.qty_in_progress, 5.0)
|
||||
self.assertEqual(stock_request.qty_done, 0.0)
|
||||
picking.action_assign()
|
||||
self.assertEqual(picking.origin, order.name)
|
||||
packout1 = picking.move_line_ids[0]
|
||||
packout1.qty_done = 5
|
||||
picking.action_done()
|
||||
|
||||
Reference in New Issue
Block a user