mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX]stock_request_direction: fixed an error while on click on one2many editabe tree on sro request model
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "Stock Requests Direction",
|
||||
"summary": "From or to your warehouse?",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "14.0.1.0.1",
|
||||
"license": "LGPL-3",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"author": "Open Source Integrators, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -16,9 +16,10 @@ class StockRequest(models.Model):
|
||||
|
||||
@api.onchange("direction")
|
||||
def _onchange_location_id(self):
|
||||
if self.direction == "outbound":
|
||||
# Stock Location set to Partner Locations/Customers
|
||||
self.location_id = self.company_id.partner_id.property_stock_customer.id
|
||||
else:
|
||||
# Otherwise the Stock Location of the Warehouse
|
||||
self.location_id = self.warehouse_id.lot_stock_id.id
|
||||
if not self._context.get("default_location_id"):
|
||||
if self.direction == "outbound":
|
||||
# Stock Location set to Partner Locations/Customers
|
||||
self.location_id = self.company_id.partner_id.property_stock_customer.id
|
||||
else:
|
||||
# Otherwise the Stock Location of the Warehouse
|
||||
self.location_id = self.warehouse_id.lot_stock_id.id
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<field name="inherit_id" ref="stock_request.stock_request_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="direction" required="1" />
|
||||
<field name="direction" />
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='stock_request_ids']" position="attributes">
|
||||
<attribute name="context">{
|
||||
|
||||
Reference in New Issue
Block a user