Skip to content

Commit

Permalink
[MIG] stock_request_direction: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Jun 11, 2024
1 parent 3128c83 commit 2c9574e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stock_request_direction/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Stock Requests Direction",
"summary": "From or to your warehouse?",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-request",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
Expand Down
2 changes: 0 additions & 2 deletions stock_request_direction/models/stock_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class StockRequest(models.Model):

direction = fields.Selection(
[("outbound", "Outbound"), ("inbound", "Inbound")],
states={"draft": [("readonly", False)]},
readonly=True,
)

@api.onchange("direction")
Expand Down
2 changes: 0 additions & 2 deletions stock_request_direction/models/stock_request_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class StockRequestOrder(models.Model):

direction = fields.Selection(
[("outbound", "Outbound"), ("inbound", "Inbound")],
states={"draft": [("readonly", False)]},
readonly=True,
)

@api.onchange("warehouse_id", "direction")
Expand Down
4 changes: 2 additions & 2 deletions stock_request_direction/views/stock_request_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
<field name="direction" readonly="state != 'draft'" />
</xpath>
<xpath expr="//field[@name='stock_request_ids']" position="attributes">
<attribute name="context">{
Expand All @@ -32,7 +32,7 @@
}</attribute>
</xpath>
<xpath expr="//tree/field[@name='warehouse_id']" position="after">
<field name="direction" invisible="1" />
<field name="direction" column_invisible="1" />
</xpath>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion stock_request_direction/views/stock_request_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<field name="inherit_id" ref="stock_request.view_stock_request_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='warehouse_id']" position="after">
<field name="direction" />
<field name="direction" readonly="state != 'draft'" />
</xpath>
</field>
</record>
Expand Down

0 comments on commit 2c9574e

Please sign in to comment.