mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_vertical_lift: black, isort
This commit is contained in:
committed by
Hai Lang
parent
68e10cd503
commit
d9cbd996b0
@@ -1,41 +1,41 @@
|
||||
# Copyright 2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
'name': 'Vertical Lift',
|
||||
'summary': 'Provides the core for integration with Vertical Lifts',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Stock',
|
||||
'author': 'Camptocamp, Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'depends': [
|
||||
'stock',
|
||||
'barcodes',
|
||||
'base_sparse_field',
|
||||
'stock_location_tray', # OCA/stock-logistics-warehouse
|
||||
'web_notify', # OCA/web
|
||||
'web_ir_actions_act_view_reload', # OCA/web
|
||||
"name": "Vertical Lift",
|
||||
"summary": "Provides the core for integration with Vertical Lifts",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Stock",
|
||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"depends": [
|
||||
"stock",
|
||||
"barcodes",
|
||||
"base_sparse_field",
|
||||
"stock_location_tray", # OCA/stock-logistics-warehouse
|
||||
"web_notify", # OCA/web
|
||||
"web_ir_actions_act_view_reload", # OCA/web
|
||||
],
|
||||
'website': 'https://github.com/OCA/stock-logistics-warehouse',
|
||||
'demo': [
|
||||
'demo/stock_location_demo.xml',
|
||||
'demo/vertical_lift_shuttle_demo.xml',
|
||||
'demo/product_demo.xml',
|
||||
'demo/stock_inventory_demo.xml',
|
||||
'demo/stock_picking_demo.xml',
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"demo": [
|
||||
"demo/stock_location_demo.xml",
|
||||
"demo/vertical_lift_shuttle_demo.xml",
|
||||
"demo/product_demo.xml",
|
||||
"demo/stock_inventory_demo.xml",
|
||||
"demo/stock_picking_demo.xml",
|
||||
],
|
||||
'data': [
|
||||
'views/stock_location_views.xml',
|
||||
'views/stock_move_line_views.xml',
|
||||
'views/vertical_lift_shuttle_views.xml',
|
||||
'views/vertical_lift_operation_base_views.xml',
|
||||
'views/vertical_lift_operation_pick_views.xml',
|
||||
'views/vertical_lift_operation_put_views.xml',
|
||||
'views/vertical_lift_operation_inventory_views.xml',
|
||||
'views/stock_vertical_lift_templates.xml',
|
||||
'views/shuttle_screen_templates.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/ir_sequence.xml',
|
||||
"data": [
|
||||
"views/stock_location_views.xml",
|
||||
"views/stock_move_line_views.xml",
|
||||
"views/vertical_lift_shuttle_views.xml",
|
||||
"views/vertical_lift_operation_base_views.xml",
|
||||
"views/vertical_lift_operation_pick_views.xml",
|
||||
"views/vertical_lift_operation_put_views.xml",
|
||||
"views/vertical_lift_operation_inventory_views.xml",
|
||||
"views/stock_vertical_lift_templates.xml",
|
||||
"views/shuttle_screen_templates.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"data/ir_sequence.xml",
|
||||
],
|
||||
'installable': True,
|
||||
'development_status': 'Alpha',
|
||||
"installable": True,
|
||||
"development_status": "Alpha",
|
||||
}
|
||||
|
||||
@@ -8,13 +8,15 @@ _logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class VerticalLiftController(http.Controller):
|
||||
@http.route(['/vertical-lift'], type='http', auth='public', csrf=False)
|
||||
@http.route(["/vertical-lift"], type="http", auth="public", csrf=False)
|
||||
def vertical_lift(self, answer, secret):
|
||||
if secret == os.environ.get('VERTICAL_LIFT_SECRET', ''):
|
||||
rec = request.env['vertical.lift.command'].sudo().record_answer(
|
||||
answer
|
||||
)
|
||||
if secret == os.environ.get("VERTICAL_LIFT_SECRET", ""):
|
||||
rec = request.env["vertical.lift.command"].sudo().record_answer(answer)
|
||||
return str(rec.id)
|
||||
else:
|
||||
_logger.error('secret mismatch: %r != %r', secret, os.environ.get('VERTICAL_LIFT_SECRET', ''))
|
||||
_logger.error(
|
||||
"secret mismatch: %r != %r",
|
||||
secret,
|
||||
os.environ.get("VERTICAL_LIFT_SECRET", ""),
|
||||
)
|
||||
raise http.AuthenticationError()
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record model="ir.sequence" id="sequence_kardex_command">
|
||||
<field name="name">Vertical Lift Commands</field>
|
||||
<field name="code">vertical.lift.command</field>
|
||||
<field name="prefix">L</field>
|
||||
<field name="padding">6</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
<odoo noupdate="1">
|
||||
<record model="ir.sequence" id="sequence_kardex_command">
|
||||
<field name="name">Vertical Lift Commands</field>
|
||||
<field name="code">vertical.lift.command</field>
|
||||
<field name="prefix">L</field>
|
||||
<field name="padding">6</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="product_running_socks" model="product.product">
|
||||
<field name="default_code">RS200</field>
|
||||
<field name="barcode">4491673293664</field>
|
||||
<field name="name">Running Socks</field>
|
||||
<field name="type">product</field>
|
||||
<field name="categ_id" ref="product.product_category_6"/>
|
||||
<field name="lst_price">30.0</field>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="weight">1.0</field>
|
||||
<field name="tracking">none</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="property_stock_inventory" ref="stock.location_inventory"/>
|
||||
</record>
|
||||
<record id="product_running_socks" model="product.product">
|
||||
<field name="default_code">RS200</field>
|
||||
<field name="barcode">4491673293664</field>
|
||||
<field name="name">Running Socks</field>
|
||||
<field name="type">product</field>
|
||||
<field name="categ_id" ref="product.product_category_6"/>
|
||||
<field name="lst_price">30.0</field>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="weight">1.0</field>
|
||||
<field name="tracking">none</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="property_stock_inventory" ref="stock.location_inventory"/>
|
||||
</record>
|
||||
|
||||
<record id="product_recovery_socks" model="product.product">
|
||||
<field name="default_code">RS300</field>
|
||||
<field name="barcode">2779891103531</field>
|
||||
<field name="name">Recovery Socks</field>
|
||||
<field name="type">product</field>
|
||||
<field name="categ_id" ref="product.product_category_6"/>
|
||||
<field name="lst_price">30.0</field>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="weight">1.0</field>
|
||||
<field name="tracking">none</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="property_stock_inventory" ref="stock.location_inventory"/>
|
||||
</record>
|
||||
<record id="product_recovery_socks" model="product.product">
|
||||
<field name="default_code">RS300</field>
|
||||
<field name="barcode">2779891103531</field>
|
||||
<field name="name">Recovery Socks</field>
|
||||
<field name="type">product</field>
|
||||
<field name="categ_id" ref="product.product_category_6"/>
|
||||
<field name="lst_price">30.0</field>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="weight">1.0</field>
|
||||
<field name="tracking">none</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="property_stock_inventory" ref="stock.location_inventory"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="stock_inventory_vertical_lift_0" model="stock.inventory">
|
||||
<field name="name">Starting Vertical Lift Inventory</field>
|
||||
</record>
|
||||
<record id="stock_inventory_vertical_lift_0" model="stock.inventory">
|
||||
<field name="name">Starting Vertical Lift Inventory</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_inventory_vertical_lift_line_1" model="stock.inventory.line">
|
||||
<field name="product_id" ref="product_running_socks"/>
|
||||
<field name="product_uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="inventory_id" ref="stock_inventory_vertical_lift_0"/>
|
||||
<field name="product_qty">30.0</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_tray_1b_x3y2"/>
|
||||
</record>
|
||||
<record id="stock_inventory_vertical_lift_line_1" model="stock.inventory.line">
|
||||
<field name="product_id" ref="product_running_socks"/>
|
||||
<field name="product_uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="inventory_id" ref="stock_inventory_vertical_lift_0"/>
|
||||
<field name="product_qty">30.0</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_tray_1b_x3y2"/>
|
||||
</record>
|
||||
|
||||
<function model="stock.inventory" name="action_validate">
|
||||
<function eval="[[('state','=','draft'),('id', '=', ref('stock_vertical_lift.stock_inventory_vertical_lift_0'))]]" model="stock.inventory" name="search"/>
|
||||
</function>
|
||||
<function model="stock.inventory" name="action_validate">
|
||||
<function eval="[[('state','=','draft'),('id', '=', ref('stock_vertical_lift.stock_inventory_vertical_lift_0'))]]" model="stock.inventory" name="search"/>
|
||||
</function>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -14,103 +14,103 @@
|
||||
<field name="company_id"></field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_1" model="stock.location">
|
||||
<field name="name">Shuttle 1</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_1" model="stock.location">
|
||||
<field name="name">Shuttle 1</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_1a" model="stock.location">
|
||||
<field name="name">Tray 1A</field>
|
||||
<field name="barcode">T1A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_1a" model="stock.location">
|
||||
<field name="name">Tray 1A</field>
|
||||
<field name="barcode">T1A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_1b" model="stock.location">
|
||||
<field name="name">Tray 1B</field>
|
||||
<field name="barcode">T1B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_16x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_1b" model="stock.location">
|
||||
<field name="name">Tray 1B</field>
|
||||
<field name="barcode">T1B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_16x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_1c" model="stock.location">
|
||||
<field name="name">Tray 1C</field>
|
||||
<field name="barcode">T1C</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_1c" model="stock.location">
|
||||
<field name="name">Tray 1C</field>
|
||||
<field name="barcode">T1C</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_2" model="stock.location">
|
||||
<field name="name">Shuttle 2</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_2" model="stock.location">
|
||||
<field name="name">Shuttle 2</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_2a" model="stock.location">
|
||||
<field name="name">Tray 2A</field>
|
||||
<field name="barcode">T2A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_2a" model="stock.location">
|
||||
<field name="name">Tray 2A</field>
|
||||
<field name="barcode">T2A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_2b" model="stock.location">
|
||||
<field name="name">Tray 2B</field>
|
||||
<field name="barcode">T2B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_4x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_2b" model="stock.location">
|
||||
<field name="name">Tray 2B</field>
|
||||
<field name="barcode">T2B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_4x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_2c" model="stock.location">
|
||||
<field name="name">Tray 2C</field>
|
||||
<field name="barcode">T2C</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_16x_2"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_2c" model="stock.location">
|
||||
<field name="name">Tray 2C</field>
|
||||
<field name="barcode">T2C</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_16x_2"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_2d" model="stock.location">
|
||||
<field name="name">Tray 2D</field>
|
||||
<field name="barcode">T2D</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_2d" model="stock.location">
|
||||
<field name="name">Tray 2D</field>
|
||||
<field name="barcode">T2D</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_8x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_3" model="stock.location">
|
||||
<field name="name">Shuttle 3</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_shuttle_3" model="stock.location">
|
||||
<field name="name">Shuttle 3</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_3a" model="stock.location">
|
||||
<field name="name">Tray 3A</field>
|
||||
<field name="barcode">T3A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_3a" model="stock.location">
|
||||
<field name="name">Tray 3A</field>
|
||||
<field name="barcode">T3A</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_small_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_vertical_lift_demo_tray_3b" model="stock.location">
|
||||
<field name="name">Tray 3B</field>
|
||||
<field name="barcode">T3B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
<record id="stock_location_vertical_lift_demo_tray_3b" model="stock.location">
|
||||
<field name="name">Tray 3B</field>
|
||||
<field name="barcode">T3B</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="tray_type_id" ref="stock_location_tray.stock_location_tray_type_large_32x"/>
|
||||
<field name="usage">internal</field>
|
||||
</record>
|
||||
|
||||
<!-- When the trays are created, they will create their 'cell' locations.
|
||||
This method will add xmlids on them to be able to reference them in
|
||||
other demo data and tests.
|
||||
-->
|
||||
<function model="stock.location" name="_create_tray_xmlids">
|
||||
<function eval="[[('cell_in_tray_type_id', '!=', False)]]" model="stock.location" name="search"/>
|
||||
<value>stock_vertical_lift</value>
|
||||
</function>
|
||||
<!-- When the trays are created, they will create their 'cell' locations.
|
||||
This method will add xmlids on them to be able to reference them in
|
||||
other demo data and tests.
|
||||
-->
|
||||
<function model="stock.location" name="_create_tray_xmlids">
|
||||
<function eval="[[('cell_in_tray_type_id', '!=', False)]]" model="stock.location" name="search"/>
|
||||
<value>stock_vertical_lift</value>
|
||||
</function>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="stock_picking_out_demo_vertical_lift_1" model="stock.picking">
|
||||
<field name="picking_type_id" ref="stock.picking_type_out"/>
|
||||
<field name="origin">Outgoing shipment from Vertical Lift (demo)</field>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="date" eval="DateTime.today()"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_customers"/>
|
||||
<field name="move_lines" model="stock.move" eval="[(0, 0, {
|
||||
'name': obj().env.ref('stock_vertical_lift.product_running_socks').name,
|
||||
'product_id': ref('stock_vertical_lift.product_running_socks'),
|
||||
'product_uom': ref('uom.product_uom_unit'),
|
||||
'product_uom_qty': 15.0,
|
||||
'picking_type_id': ref('stock.picking_type_out'),
|
||||
'location_id': ref('stock.stock_location_stock'),
|
||||
'location_dest_id': ref('stock.stock_location_customers'),
|
||||
})]"/>
|
||||
</record>
|
||||
<record id="stock_picking_out_demo_vertical_lift_1" model="stock.picking">
|
||||
<field name="picking_type_id" ref="stock.picking_type_out"/>
|
||||
<field name="origin">Outgoing shipment from Vertical Lift (demo)</field>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="date" eval="DateTime.today()"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_customers"/>
|
||||
<field name="move_lines" model="stock.move" eval="[(0, 0, {
|
||||
'name': obj().env.ref('stock_vertical_lift.product_running_socks').name,
|
||||
'product_id': ref('stock_vertical_lift.product_running_socks'),
|
||||
'product_uom': ref('uom.product_uom_unit'),
|
||||
'product_uom_qty': 15.0,
|
||||
'picking_type_id': ref('stock.picking_type_out'),
|
||||
'location_id': ref('stock.stock_location_stock'),
|
||||
'location_dest_id': ref('stock.stock_location_customers'),
|
||||
})]"/>
|
||||
</record>
|
||||
|
||||
<function model="stock.picking" name="action_confirm">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_out_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
<function model="stock.picking" name="action_confirm">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_out_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
|
||||
<function model="stock.picking" name="action_assign">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_out_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
<function model="stock.picking" name="action_assign">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_out_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
|
||||
<record id="stock_picking_in_demo_vertical_lift_1" model="stock.picking">
|
||||
<field name="picking_type_id" ref="stock.picking_type_in"/>
|
||||
<field name="origin">Incoming shipment from Vertical Lift (demo)</field>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="date" eval="DateTime.today()"/>
|
||||
<field name="location_id" ref="stock.stock_location_suppliers"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_stock"/>
|
||||
<field name="move_lines" model="stock.move" eval="[(0, 0, {
|
||||
'name': obj().env.ref('stock_vertical_lift.product_running_socks').name,
|
||||
'product_id': ref('stock_vertical_lift.product_running_socks'),
|
||||
'product_uom': ref('uom.product_uom_unit'),
|
||||
'product_uom_qty': 15.0,
|
||||
'picking_type_id': ref('stock.picking_type_in'),
|
||||
'location_id': ref('stock.stock_location_suppliers'),
|
||||
'location_dest_id': ref('stock.stock_location_stock'),
|
||||
})]"/>
|
||||
</record>
|
||||
<record id="stock_picking_in_demo_vertical_lift_1" model="stock.picking">
|
||||
<field name="picking_type_id" ref="stock.picking_type_in"/>
|
||||
<field name="origin">Incoming shipment from Vertical Lift (demo)</field>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="date" eval="DateTime.today()"/>
|
||||
<field name="location_id" ref="stock.stock_location_suppliers"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_stock"/>
|
||||
<field name="move_lines" model="stock.move" eval="[(0, 0, {
|
||||
'name': obj().env.ref('stock_vertical_lift.product_running_socks').name,
|
||||
'product_id': ref('stock_vertical_lift.product_running_socks'),
|
||||
'product_uom': ref('uom.product_uom_unit'),
|
||||
'product_uom_qty': 15.0,
|
||||
'picking_type_id': ref('stock.picking_type_in'),
|
||||
'location_id': ref('stock.stock_location_suppliers'),
|
||||
'location_dest_id': ref('stock.stock_location_stock'),
|
||||
})]"/>
|
||||
</record>
|
||||
|
||||
<function model="stock.picking" name="action_confirm">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_in_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
<function model="stock.picking" name="action_confirm">
|
||||
<value model="stock.picking" eval="[obj().env.ref('stock_vertical_lift.stock_picking_in_demo_vertical_lift_1').id]"/>
|
||||
</function>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="stock_vertical_lift_demo_shuttle_1" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 1</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
<record id="stock_vertical_lift_demo_shuttle_1" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 1</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_1"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_vertical_lift_demo_shuttle_2" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 2</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
<record id="stock_vertical_lift_demo_shuttle_2" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 2</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_2"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_vertical_lift_demo_shuttle_3" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 3</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
<record id="stock_vertical_lift_demo_shuttle_3" model="vertical.lift.shuttle">
|
||||
<field name="name">Shuttle 3</field>
|
||||
<field name="location_id" ref="stock_location_vertical_lift_demo_shuttle_3"/>
|
||||
<field name="mode">pick</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -52,4 +52,4 @@
|
||||
<line fill="none" style="stroke:#000000; stroke-width:6;" x1="343" y1="0" x2="343" y2="60"/>
|
||||
<line fill="none" style="stroke:#000000; stroke-width:2;" x1="349" y1="0" x2="349" y2="60"/>
|
||||
<line fill="none" style="stroke:#000000; stroke-width:4;" x1="354" y1="0" x2="354" y2="60"/>
|
||||
<text x="178" y="77.271" text-anchor="middle" style="font-family: Tahoma; font-size: 20px; stroke: none; fill:#000000;">O-BTN.release</text></svg>
|
||||
<text x="178" y="77.271" text-anchor="middle" style="font-family: Tahoma; font-size: 20px; stroke: none; fill:#000000;">O-BTN.release</text></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -43,4 +43,4 @@
|
||||
<line fill="none" style="stroke:#000000; stroke-width:6;" x1="277" y1="0" x2="277" y2="60"/>
|
||||
<line fill="none" style="stroke:#000000; stroke-width:2;" x1="283" y1="0" x2="283" y2="60"/>
|
||||
<line fill="none" style="stroke:#000000; stroke-width:4;" x1="288" y1="0" x2="288" y2="60"/>
|
||||
<text x="145" y="77.271" text-anchor="middle" style="font-family: Tahoma; font-size: 20px; stroke: none; fill:#000000;">O-BTN.save</text></svg>
|
||||
<text x="145" y="77.271" text-anchor="middle" style="font-family: Tahoma; font-size: 20px; stroke: none; fill:#000000;">O-BTN.save</text></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -10,8 +10,7 @@ class StockLocation(models.Model):
|
||||
vertical_lift_location = fields.Boolean(
|
||||
"Is a Vertical Lift View Location?",
|
||||
default=False,
|
||||
help="Check this box to use it as the view for Vertical"
|
||||
" Lift Shuttles.",
|
||||
help="Check this box to use it as the view for Vertical" " Lift Shuttles.",
|
||||
)
|
||||
vertical_lift_kind = fields.Selection(
|
||||
selection=[
|
||||
@@ -29,9 +28,7 @@ class StockLocation(models.Model):
|
||||
# give the unique shuttle for any location in the tree (whether it's a
|
||||
# shuttle, a tray or a cell)
|
||||
inverse_vertical_lift_shuttle_ids = fields.One2many(
|
||||
comodel_name="vertical.lift.shuttle",
|
||||
inverse_name="location_id",
|
||||
readonly=True,
|
||||
comodel_name="vertical.lift.shuttle", inverse_name="location_id", readonly=True
|
||||
)
|
||||
# compute the unique shuttle for any shuttle, tray or cell location, by
|
||||
# going through the parents
|
||||
@@ -42,9 +39,7 @@ class StockLocation(models.Model):
|
||||
)
|
||||
|
||||
@api.depends(
|
||||
"location_id",
|
||||
"location_id.vertical_lift_kind",
|
||||
"vertical_lift_location",
|
||||
"location_id", "location_id.vertical_lift_kind", "vertical_lift_location"
|
||||
)
|
||||
def _compute_vertical_lift_kind(self):
|
||||
tree = {"view": "shuttle", "shuttle": "tray", "tray": "cell"}
|
||||
@@ -57,8 +52,7 @@ class StockLocation(models.Model):
|
||||
location.vertical_lift_kind = kind
|
||||
|
||||
@api.depends(
|
||||
"inverse_vertical_lift_shuttle_ids",
|
||||
"location_id.vertical_lift_shuttle_id",
|
||||
"inverse_vertical_lift_shuttle_ids", "location_id.vertical_lift_shuttle_id"
|
||||
)
|
||||
def _compute_vertical_lift_shuttle_id(self):
|
||||
for location in self:
|
||||
@@ -114,20 +108,13 @@ class StockLocation(models.Model):
|
||||
if self.vertical_lift_shuttle_id.hardware == "simulation":
|
||||
message = _("Opening tray {}.").format(self.name)
|
||||
if cell_location:
|
||||
from_left, from_bottom = (
|
||||
cell_location.tray_cell_center_position()
|
||||
)
|
||||
message += _(
|
||||
"<br/>Laser pointer on x{} y{} ({}mm, {}mm)"
|
||||
).format(
|
||||
cell_location.posx,
|
||||
cell_location.posy,
|
||||
from_left,
|
||||
from_bottom,
|
||||
from_left, from_bottom = cell_location.tray_cell_center_position()
|
||||
message += _("<br/>Laser pointer on x{} y{} ({}mm, {}mm)").format(
|
||||
cell_location.posx, cell_location.posy, from_left, from_bottom
|
||||
)
|
||||
return message
|
||||
else:
|
||||
raise NotImplemented()
|
||||
raise NotImplementedError()
|
||||
|
||||
def fetch_vertical_lift_tray(self, cell_location=None):
|
||||
"""Send instructions to the vertical lift hardware
|
||||
@@ -146,8 +133,7 @@ class StockLocation(models.Model):
|
||||
if self.vertical_lift_kind == "cell":
|
||||
if cell_location:
|
||||
raise ValueError(
|
||||
"cell_location cannot be set when the location is "
|
||||
"a cell."
|
||||
"cell_location cannot be set when the location is a cell."
|
||||
)
|
||||
tray = self.location_id
|
||||
tray.fetch_vertical_lift_tray(cell_location=self)
|
||||
@@ -155,8 +141,7 @@ class StockLocation(models.Model):
|
||||
self._hardware_vertical_lift_tray(cell_location=cell_location)
|
||||
else:
|
||||
raise exceptions.UserError(
|
||||
_("Cannot fetch a vertical lift tray on location %s")
|
||||
% (self.name,)
|
||||
_("Cannot fetch a vertical lift tray on location %s") % (self.name,)
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
@@ -17,12 +17,7 @@ class StockMove(models.Model):
|
||||
# count of assigned move lines may change (and we track this in
|
||||
# stock.move, not stock.move.line, because the state of the lines
|
||||
# is a related to this one).
|
||||
models = (
|
||||
"vertical.lift.operation.pick",
|
||||
"vertical.lift.operation.put",
|
||||
)
|
||||
models = ("vertical.lift.operation.pick", "vertical.lift.operation.put")
|
||||
for model in models:
|
||||
self.env[model].invalidate_cache(
|
||||
["number_of_ops", "number_of_ops_all"]
|
||||
)
|
||||
self.env[model].invalidate_cache(["number_of_ops", "number_of_ops_all"])
|
||||
return result
|
||||
|
||||
@@ -5,19 +5,14 @@ from odoo import models
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = 'stock.quant'
|
||||
_inherit = "stock.quant"
|
||||
|
||||
def _update_available_quantity(self, *args, **kwargs):
|
||||
result = super()._update_available_quantity(*args, **kwargs)
|
||||
# We cannot have fields to depends on to invalidate this computed
|
||||
# fields on vertical.lift.operation.* models. But we know that when the
|
||||
# quantity of quant changes, we can invalidate the field
|
||||
models = (
|
||||
"vertical.lift.operation.pick",
|
||||
"vertical.lift.operation.put",
|
||||
)
|
||||
models = ("vertical.lift.operation.pick", "vertical.lift.operation.put")
|
||||
for model in models:
|
||||
self.env[model].invalidate_cache(
|
||||
["tray_qty"]
|
||||
)
|
||||
self.env[model].invalidate_cache(["tray_qty"])
|
||||
return result
|
||||
|
||||
@@ -2,49 +2,47 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
import logging
|
||||
|
||||
from odoo import api, exceptions, fields, models
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class VerticalLiftCommand(models.Model):
|
||||
_name = 'vertical.lift.command'
|
||||
_order = 'shuttle_id, name desc'
|
||||
_name = "vertical.lift.command"
|
||||
_order = "shuttle_id, name desc"
|
||||
_description = "commands sent to the shuttle"
|
||||
|
||||
@api.model
|
||||
def _default_name(self):
|
||||
return self.env['ir.sequence'].next_by_code('vertical.lift.command')
|
||||
return self.env["ir.sequence"].next_by_code("vertical.lift.command")
|
||||
|
||||
name = fields.Char(
|
||||
'Name', default=_default_name, required=True, index=True
|
||||
)
|
||||
name = fields.Char("Name", default=_default_name, required=True, index=True)
|
||||
command = fields.Char(required=True)
|
||||
answer = fields.Char()
|
||||
error = fields.Char()
|
||||
shuttle_id = fields.Many2one('vertical.lift.shuttle', required=True)
|
||||
shuttle_id = fields.Many2one("vertical.lift.shuttle", required=True)
|
||||
|
||||
@api.model
|
||||
def record_answer(self, answer):
|
||||
name = self._get_key(answer)
|
||||
record = self.search([('name', '=', name)], limit=1)
|
||||
record = self.search([("name", "=", name)], limit=1)
|
||||
if not record:
|
||||
_logger.error('unable to match answer to a command: %r', answer)
|
||||
raise exceptions.UserError('Unknown record %s' % name)
|
||||
_logger.error("unable to match answer to a command: %r", answer)
|
||||
raise exceptions.UserError(_("Unknown record %s") % name)
|
||||
record.answer = answer
|
||||
record.shuttle_id._hardware_response_callback(record)
|
||||
return record
|
||||
|
||||
def _get_key(self, answer):
|
||||
key = answer.split('|')[1]
|
||||
key = answer.split("|")[1]
|
||||
return key
|
||||
|
||||
@api.model_create_multi
|
||||
@api.returns('self', lambda value: value.id)
|
||||
@api.returns("self", lambda value: value.id)
|
||||
def create(self, vals_list):
|
||||
for values in vals_list:
|
||||
if "name" not in values:
|
||||
name = self._get_key(values.get('command'))
|
||||
name = self._get_key(values.get("command"))
|
||||
if name:
|
||||
values["name"] = name
|
||||
return super().create(vals_list)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
from odoo.addons.base_sparse_field.models.fields import Serialized
|
||||
|
||||
|
||||
@@ -16,9 +17,7 @@ class VerticalLiftOperationBase(models.AbstractModel):
|
||||
shuttle_id = fields.Many2one(
|
||||
comodel_name="vertical.lift.shuttle", required=True, readonly=True
|
||||
)
|
||||
location_id = fields.Many2one(
|
||||
related="shuttle_id.location_id", readonly=True
|
||||
)
|
||||
location_id = fields.Many2one(related="shuttle_id.location_id", readonly=True)
|
||||
number_of_ops = fields.Integer(
|
||||
compute="_compute_number_of_ops", string="Number of Operations"
|
||||
)
|
||||
@@ -27,9 +26,7 @@ class VerticalLiftOperationBase(models.AbstractModel):
|
||||
string="Number of Operations in all shuttles",
|
||||
)
|
||||
mode = fields.Selection(related="shuttle_id.mode", readonly=True)
|
||||
operation_descr = fields.Char(
|
||||
string="Operation", default="...", readonly=True
|
||||
)
|
||||
operation_descr = fields.Char(string="Operation", default="...", readonly=True)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
@@ -83,17 +80,12 @@ class VerticalLiftOperationBase(models.AbstractModel):
|
||||
for pkg in product.packaging_ids
|
||||
]
|
||||
}
|
||||
content = self.env["ir.qweb"].render(
|
||||
"stock_vertical_lift.packagings", values
|
||||
)
|
||||
content = self.env["ir.qweb"].render("stock_vertical_lift.packagings", values)
|
||||
return content
|
||||
|
||||
def _get_tray_qty(self, product, location):
|
||||
quants = self.env["stock.quant"].search(
|
||||
[
|
||||
("location_id", "=", location.id),
|
||||
("product_id", "=", product.id),
|
||||
]
|
||||
[("location_id", "=", location.id), ("product_id", "=", product.id)]
|
||||
)
|
||||
return sum(quants.mapped("quantity"))
|
||||
|
||||
@@ -112,10 +104,7 @@ class VerticalLiftOperationBase(models.AbstractModel):
|
||||
channel = "notify_vertical_lift_screen"
|
||||
bus_message = {
|
||||
"action": "refresh",
|
||||
"params": {
|
||||
"model": self._name,
|
||||
"id": self.id,
|
||||
}
|
||||
"params": {"model": self._name, "id": self.id},
|
||||
}
|
||||
self.env["bus.bus"].sendone(channel, bus_message)
|
||||
|
||||
@@ -142,15 +131,11 @@ class VerticalLiftOperationTransfer(models.AbstractModel):
|
||||
compute="_compute_tray_data",
|
||||
string="Tray Type",
|
||||
)
|
||||
tray_type_code = fields.Char(
|
||||
compute="_compute_tray_data", string="Tray Code"
|
||||
)
|
||||
tray_type_code = fields.Char(compute="_compute_tray_data", string="Tray Code")
|
||||
tray_x = fields.Integer(string="X", compute="_compute_tray_data")
|
||||
tray_y = fields.Integer(string="Y", compute="_compute_tray_data")
|
||||
tray_matrix = Serialized(string="Cells", compute="_compute_tray_data")
|
||||
tray_qty = fields.Float(
|
||||
string="Stock Quantity", compute="_compute_tray_qty"
|
||||
)
|
||||
tray_qty = fields.Float(string="Stock Quantity", compute="_compute_tray_qty")
|
||||
|
||||
# current operation information
|
||||
picking_id = fields.Many2one(
|
||||
@@ -174,12 +159,8 @@ class VerticalLiftOperationTransfer(models.AbstractModel):
|
||||
product_packagings = fields.Html(
|
||||
string="Packaging", compute="_compute_product_packagings"
|
||||
)
|
||||
qty_done = fields.Float(
|
||||
related="current_move_line_id.qty_done", readonly=True
|
||||
)
|
||||
lot_id = fields.Many2one(
|
||||
related="current_move_line_id.lot_id", readonly=True
|
||||
)
|
||||
qty_done = fields.Float(related="current_move_line_id.qty_done", readonly=True)
|
||||
lot_id = fields.Many2one(related="current_move_line_id.lot_id", readonly=True)
|
||||
location_dest_id = fields.Many2one(
|
||||
string="Destination",
|
||||
related="current_move_line_id.location_dest_id",
|
||||
@@ -217,7 +198,7 @@ class VerticalLiftOperationTransfer(models.AbstractModel):
|
||||
def _compute_tray_qty(self):
|
||||
for record in self:
|
||||
if not (record.tray_location_id and record.current_move_line_id):
|
||||
record.tray_qty = 0.
|
||||
record.tray_qty = 0.0
|
||||
continue
|
||||
product = record.current_move_line_id.product_id
|
||||
location = record.tray_location_id
|
||||
@@ -250,9 +231,7 @@ class VerticalLiftOperationTransfer(models.AbstractModel):
|
||||
def count_move_lines_to_do(self):
|
||||
"""Count move lines to process in current shuttles"""
|
||||
self.ensure_one()
|
||||
return self.env["stock.move.line"].search_count(
|
||||
self._domain_move_lines_to_do()
|
||||
)
|
||||
return self.env["stock.move.line"].search_count(self._domain_move_lines_to_do())
|
||||
|
||||
def count_move_lines_to_do_all(self):
|
||||
"""Count move lines to process in all shuttles"""
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.addons.base_sparse_field.models.fields import Serialized
|
||||
from odoo.tools import float_compare
|
||||
|
||||
from odoo.addons.base_sparse_field.models.fields import Serialized
|
||||
|
||||
# TODO handle autofocus + easy way to validate for the input field
|
||||
|
||||
|
||||
@@ -24,10 +25,7 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
state = fields.Selection(
|
||||
selection=[
|
||||
("quantity", "Inventory, please enter the amount"),
|
||||
(
|
||||
"confirm_wrong_quantity",
|
||||
"The quantity does not match, are you sure?",
|
||||
),
|
||||
("confirm_wrong_quantity", "The quantity does not match, are you sure?"),
|
||||
("save", "Save"),
|
||||
],
|
||||
default="quantity",
|
||||
@@ -44,15 +42,11 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
compute="_compute_tray_data",
|
||||
string="Tray Type",
|
||||
)
|
||||
tray_type_code = fields.Char(
|
||||
compute="_compute_tray_data", string="Tray Code"
|
||||
)
|
||||
tray_type_code = fields.Char(compute="_compute_tray_data", string="Tray Code")
|
||||
tray_x = fields.Integer(string="X", compute="_compute_tray_data")
|
||||
tray_y = fields.Integer(string="Y", compute="_compute_tray_data")
|
||||
tray_matrix = Serialized(string="Cells", compute="_compute_tray_data")
|
||||
tray_qty = fields.Float(
|
||||
string="Stock Quantity", compute="_compute_tray_qty"
|
||||
)
|
||||
tray_qty = fields.Float(string="Stock Quantity", compute="_compute_tray_qty")
|
||||
|
||||
# current operation information
|
||||
inventory_id = fields.Many2one(
|
||||
@@ -105,10 +99,8 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
@api.depends("tray_location_id", "current_inventory_line_id.product_id")
|
||||
def _compute_tray_qty(self):
|
||||
for record in self:
|
||||
if not (
|
||||
record.tray_location_id and record.current_inventory_line_id
|
||||
):
|
||||
record.tray_qty = 0.
|
||||
if not (record.tray_location_id and record.current_inventory_line_id):
|
||||
record.tray_qty = 0.0
|
||||
continue
|
||||
product = record.current_inventory_line_id.product_id
|
||||
location = record.tray_location_id
|
||||
@@ -151,11 +143,7 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
|
||||
def reset(self):
|
||||
self.write(
|
||||
{
|
||||
"quantity_input": 0.,
|
||||
"last_quantity_input": 0.,
|
||||
"state": "quantity",
|
||||
}
|
||||
{"quantity_input": 0.0, "last_quantity_input": 0.0, "state": "quantity"}
|
||||
)
|
||||
self.update_step_description()
|
||||
|
||||
@@ -216,7 +204,7 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
return True
|
||||
else:
|
||||
self.last_quantity_input = self.quantity_input
|
||||
self.quantity_input = 0.
|
||||
self.quantity_input = 0.0
|
||||
self.step_to("confirm_wrong_quantity")
|
||||
return False
|
||||
if self.step() == "confirm_wrong_quantity":
|
||||
@@ -255,7 +243,6 @@ class VerticalLiftOperationInventory(models.Model):
|
||||
self.reset()
|
||||
if (
|
||||
next_line
|
||||
and previous_line.vertical_lift_tray_id
|
||||
!= next_line.vertical_lift_tray_id
|
||||
and previous_line.vertical_lift_tray_id != next_line.vertical_lift_tray_id
|
||||
):
|
||||
self.fetch_tray()
|
||||
|
||||
@@ -11,9 +11,7 @@ class VerticalLiftOperationPick(models.Model):
|
||||
|
||||
def on_barcode_scanned(self, barcode):
|
||||
self.ensure_one()
|
||||
location = self.env["stock.location"].search(
|
||||
[("barcode", "=", barcode)]
|
||||
)
|
||||
location = self.env["stock.location"].search([("barcode", "=", barcode)])
|
||||
if location:
|
||||
self.current_move_line_id.location_dest_id = location
|
||||
self.operation_descr = _("Save")
|
||||
@@ -65,9 +63,7 @@ class VerticalLiftOperationPick(models.Model):
|
||||
# TODO use a state machine to define next steps and
|
||||
# description?
|
||||
descr = (
|
||||
_("Scan New Destination Location")
|
||||
if next_move_line
|
||||
else _("No operations")
|
||||
_("Scan New Destination Location") if next_move_line else _("No operations")
|
||||
)
|
||||
self.operation_descr = descr
|
||||
if next_move_line:
|
||||
|
||||
@@ -109,9 +109,7 @@ class VerticalLiftOperationPut(models.Model):
|
||||
self.current_operation_line_id.process()
|
||||
|
||||
def button_release(self):
|
||||
self.write(
|
||||
{"operation_line_ids": [(2, self.current_operation_line_id.id)]}
|
||||
)
|
||||
self.write({"operation_line_ids": [(2, self.current_operation_line_id.id)]})
|
||||
return super().button_release()
|
||||
|
||||
def button_save(self):
|
||||
@@ -138,9 +136,7 @@ class VerticalLiftOperationPut(models.Model):
|
||||
|
||||
def action_select_operations(self):
|
||||
self.ensure_one()
|
||||
menu_xmlid = (
|
||||
"stock_vertical_lift." "vertical_lift_operation_put_select_view"
|
||||
)
|
||||
menu_xmlid = "stock_vertical_lift." "vertical_lift_operation_put_select_view"
|
||||
select_model = self.env["vertical.lift.operation.put.select"]
|
||||
select = select_model.create(
|
||||
{
|
||||
@@ -165,13 +161,9 @@ class VerticalLiftOperationPutLine(models.Model):
|
||||
_description = "Vertical Lift Operation Put Line"
|
||||
|
||||
operation_id = fields.Many2one(
|
||||
comodel_name="vertical.lift.operation.put",
|
||||
required=True,
|
||||
readonly=True,
|
||||
)
|
||||
move_line_id = fields.Many2one(
|
||||
comodel_name="stock.move.line", readonly=True
|
||||
comodel_name="vertical.lift.operation.put", required=True, readonly=True
|
||||
)
|
||||
move_line_id = fields.Many2one(comodel_name="stock.move.line", readonly=True)
|
||||
|
||||
def process(self):
|
||||
line = self.move_line_id
|
||||
@@ -186,9 +178,7 @@ class VerticalLiftOperationPutSelect(models.TransientModel):
|
||||
_description = "Vertical Lift Operation Put Select"
|
||||
|
||||
operation_id = fields.Many2one(
|
||||
comodel_name="vertical.lift.operation.put",
|
||||
required=True,
|
||||
readonly=True,
|
||||
comodel_name="vertical.lift.operation.put", required=True, readonly=True
|
||||
)
|
||||
move_line_ids = fields.Many2many(comodel_name="stock.move.line")
|
||||
|
||||
@@ -197,10 +187,7 @@ class VerticalLiftOperationPutSelect(models.TransientModel):
|
||||
operation_line_model = self.env["vertical.lift.operation.put.line"]
|
||||
operation_line_model.create(
|
||||
[
|
||||
{
|
||||
"operation_id": self.operation_id.id,
|
||||
"move_line_id": move_line.id,
|
||||
}
|
||||
{"operation_id": self.operation_id.id, "move_line_id": move_line.id}
|
||||
for move_line in self.move_line_ids
|
||||
]
|
||||
)
|
||||
@@ -217,9 +204,7 @@ class VerticalLiftOperationPutSelect(models.TransientModel):
|
||||
]
|
||||
|
||||
def action_add_all(self):
|
||||
move_lines = self.env["stock.move.line"].search(
|
||||
self._move_line_domain()
|
||||
)
|
||||
move_lines = self.env["stock.move.line"].search(self._move_line_domain())
|
||||
self.move_line_ids = move_lines
|
||||
self._sync_lines()
|
||||
return {"type": "ir.actions.act_window_close"}
|
||||
@@ -227,9 +212,7 @@ class VerticalLiftOperationPutSelect(models.TransientModel):
|
||||
def on_barcode_scanned(self, barcode):
|
||||
self.ensure_one()
|
||||
domain = self._move_line_domain()
|
||||
domain = expression.AND(
|
||||
[domain, [("product_id.barcode", "=", barcode)]]
|
||||
)
|
||||
domain = expression.AND([domain, [("product_id.barcode", "=", barcode)]])
|
||||
move_lines = self.env["stock.move.line"].search(domain)
|
||||
# note: on_barcode_scanned is called in an onchange, so 'self'
|
||||
# is a NewID, we can't use 'write()' on it.
|
||||
|
||||
@@ -39,8 +39,7 @@ class VerticalLiftShuttle(models.Model):
|
||||
help="set this if the server expects TLS wrapped communication"
|
||||
)
|
||||
command_ids = fields.One2many(
|
||||
'vertical.lift.command', 'shuttle_id',
|
||||
string="Hardware commands"
|
||||
"vertical.lift.command", "shuttle_id", string="Hardware commands"
|
||||
)
|
||||
_sql_constraints = [
|
||||
(
|
||||
@@ -65,17 +64,10 @@ class VerticalLiftShuttle(models.Model):
|
||||
@property
|
||||
def _screen_view_for_mode(self):
|
||||
return {
|
||||
"pick": (
|
||||
"stock_vertical_lift."
|
||||
"vertical_lift_operation_pick_screen_view"
|
||||
),
|
||||
"put": (
|
||||
"stock_vertical_lift."
|
||||
"vertical_lift_operation_put_screen_view"
|
||||
),
|
||||
"pick": ("stock_vertical_lift." "vertical_lift_operation_pick_screen_view"),
|
||||
"put": ("stock_vertical_lift." "vertical_lift_operation_put_screen_view"),
|
||||
"inventory": (
|
||||
"stock_vertical_lift."
|
||||
"vertical_lift_operation_inventory_screen_view"
|
||||
"stock_vertical_lift." "vertical_lift_operation_inventory_screen_view"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -90,18 +82,12 @@ class VerticalLiftShuttle(models.Model):
|
||||
|
||||
"""
|
||||
self.ensure_one()
|
||||
_logger.info('send %r', payload)
|
||||
command_values = {
|
||||
'shuttle_id': self.id,
|
||||
'command': payload.decode(),
|
||||
}
|
||||
_logger.info("send %r", payload)
|
||||
command_values = {"shuttle_id": self.id, "command": payload.decode()}
|
||||
|
||||
self.env['vertical.lift.command'].sudo().create(
|
||||
command_values
|
||||
)
|
||||
self.env["vertical.lift.command"].sudo().create(command_values)
|
||||
if self.hardware == "simulation":
|
||||
self.env.user.notify_info(message=payload,
|
||||
title=_("Lift Simulation"))
|
||||
self.env.user.notify_info(message=payload, title=_("Lift Simulation"))
|
||||
return True
|
||||
else:
|
||||
conn = self._hardware_get_server_connection()
|
||||
|
||||
@@ -1,103 +1,103 @@
|
||||
odoo.define('stock_vertical_lift.vertical_lift', function (require) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
var KanbanRecord = require('web.KanbanRecord');
|
||||
var basicFields = require('web.basic_fields');
|
||||
var field_registry = require('web.field_registry');
|
||||
var FormController = require('web.FormController');
|
||||
var FieldInteger = basicFields.FieldInteger;
|
||||
var KanbanRecord = require('web.KanbanRecord');
|
||||
var basicFields = require('web.basic_fields');
|
||||
var field_registry = require('web.field_registry');
|
||||
var FormController = require('web.FormController');
|
||||
var FieldInteger = basicFields.FieldInteger;
|
||||
|
||||
KanbanRecord.include({
|
||||
KanbanRecord.include({
|
||||
|
||||
_openRecord: function () {
|
||||
if (this.modelName === 'vertical.lift.shuttle'
|
||||
&& this.$el.hasClass("open_shuttle_screen")) {
|
||||
var self = this;
|
||||
this._rpc({
|
||||
method: 'action_open_screen',
|
||||
model: self.modelName,
|
||||
args: [self.id],
|
||||
}).then(function (action) {
|
||||
self.trigger_up('do_action', {action: action});
|
||||
});
|
||||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var ExitButton = FieldInteger.extend({
|
||||
tagName: 'button',
|
||||
className: 'btn btn-danger btn-block btn-lg o_shuttle_exit',
|
||||
events: {
|
||||
'click': '_onClick',
|
||||
},
|
||||
_render: function () {
|
||||
this.$el.text(this.string);
|
||||
},
|
||||
_onClick: function () {
|
||||
// the only reason to have this field widget is to be able
|
||||
// to inject clear_breadcrumbs in the action:
|
||||
// it will revert back to a normal - non-headless - view
|
||||
this.do_action('stock_vertical_lift.vertical_lift_shuttle_action', {
|
||||
clear_breadcrumbs: true,
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
FormController.include({
|
||||
init: function (parent, model, renderer, params) {
|
||||
this._super.apply(this, arguments);
|
||||
if(this.modelName.startsWith('vertical.lift.operation.')) {
|
||||
this.call('bus_service', 'addChannel', 'notify_vertical_lift_screen');
|
||||
this.call(
|
||||
'bus_service', 'on', 'notification',
|
||||
this, this.vlift_bus_notification
|
||||
);
|
||||
this.call('bus_service', 'startPolling');
|
||||
}
|
||||
},
|
||||
vlift_bus_notification: function (notifications) {
|
||||
var self = this;
|
||||
_.each(notifications, function (notification) {
|
||||
var channel = notification[0];
|
||||
var message = notification[1];
|
||||
if(channel === 'notify_vertical_lift_screen') {
|
||||
switch(message['action']) {
|
||||
case 'refresh':
|
||||
self.vlift_bus_action_refresh(message['params']);
|
||||
break;
|
||||
}
|
||||
_openRecord: function () {
|
||||
if (this.modelName === 'vertical.lift.shuttle' &&
|
||||
this.$el.hasClass("open_shuttle_screen")) {
|
||||
var self = this;
|
||||
this._rpc({
|
||||
method: 'action_open_screen',
|
||||
model: self.modelName,
|
||||
args: [self.id],
|
||||
}).then(function (action) {
|
||||
self.trigger_up('do_action', {action: action});
|
||||
});
|
||||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
},
|
||||
vlift_bus_action_refresh: function(params) {
|
||||
var selectedIds = this.getSelectedIds();
|
||||
if(!selectedIds.length){
|
||||
return;
|
||||
}
|
||||
var currentId = selectedIds[0];
|
||||
if(params['id'] === currentId && params['model'] == this.modelName){
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
destroy: function () {
|
||||
if(this.modelName.startsWith('vertical.lift.operation.')) {
|
||||
this.call('bus_service', 'deleteChannel', 'notify_vertical_lift_screen');
|
||||
}
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
field_registry.add('vlift_shuttle_exit_button', ExitButton);
|
||||
|
||||
return {
|
||||
ExitButton: ExitButton,
|
||||
};
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var ExitButton = FieldInteger.extend({
|
||||
tagName: 'button',
|
||||
className: 'btn btn-danger btn-block btn-lg o_shuttle_exit',
|
||||
events: {
|
||||
'click': '_onClick',
|
||||
},
|
||||
_render: function () {
|
||||
this.$el.text(this.string);
|
||||
},
|
||||
_onClick: function () {
|
||||
// The only reason to have this field widget is to be able
|
||||
// to inject clear_breadcrumbs in the action:
|
||||
// it will revert back to a normal - non-headless - view
|
||||
this.do_action('stock_vertical_lift.vertical_lift_shuttle_action', {
|
||||
clear_breadcrumbs: true,
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
FormController.include({
|
||||
init: function () {
|
||||
this._super.apply(this, arguments);
|
||||
if (this.modelName.startsWith('vertical.lift.operation.')) {
|
||||
this.call('bus_service', 'addChannel', 'notify_vertical_lift_screen');
|
||||
this.call(
|
||||
'bus_service', 'on', 'notification',
|
||||
this, this.vlift_bus_notification,
|
||||
);
|
||||
this.call('bus_service', 'startPolling');
|
||||
}
|
||||
},
|
||||
vlift_bus_notification: function (notifications) {
|
||||
var self = this;
|
||||
_.each(notifications, function (notification) {
|
||||
var channel = notification[0];
|
||||
var message = notification[1];
|
||||
if (channel === 'notify_vertical_lift_screen') {
|
||||
switch (message.action) {
|
||||
case 'refresh':
|
||||
self.vlift_bus_action_refresh(message.params);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
vlift_bus_action_refresh: function (params) {
|
||||
var selectedIds = this.getSelectedIds();
|
||||
if (!selectedIds.length) {
|
||||
return;
|
||||
}
|
||||
var currentId = selectedIds[0];
|
||||
if (params.id === currentId && params.model === this.modelName) {
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
destroy: function () {
|
||||
if (this.modelName.startsWith('vertical.lift.operation.')) {
|
||||
this.call('bus_service', 'deleteChannel',
|
||||
'notify_vertical_lift_screen');
|
||||
}
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
field_registry.add('vlift_shuttle_exit_button', ExitButton);
|
||||
|
||||
return {
|
||||
ExitButton: ExitButton,
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _
|
||||
|
||||
from odoo.addons.stock_location_tray.tests import common
|
||||
|
||||
|
||||
@@ -10,83 +11,68 @@ class VerticalLiftCase(common.LocationTrayTypeCase):
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.shuttle = cls.env.ref(
|
||||
'stock_vertical_lift.stock_vertical_lift_demo_shuttle_1'
|
||||
)
|
||||
cls.product_socks = cls.env.ref(
|
||||
'stock_vertical_lift.product_running_socks'
|
||||
)
|
||||
cls.product_recovery = cls.env.ref(
|
||||
'stock_vertical_lift.product_recovery_socks'
|
||||
"stock_vertical_lift.stock_vertical_lift_demo_shuttle_1"
|
||||
)
|
||||
cls.product_socks = cls.env.ref("stock_vertical_lift.product_running_socks")
|
||||
cls.product_recovery = cls.env.ref("stock_vertical_lift.product_recovery_socks")
|
||||
cls.vertical_lift_loc = cls.env.ref(
|
||||
'stock_vertical_lift.stock_location_vertical_lift'
|
||||
"stock_vertical_lift.stock_location_vertical_lift"
|
||||
)
|
||||
cls.location_1a = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a"
|
||||
)
|
||||
cls.location_1a_x1y1 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x1y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x1y1"
|
||||
)
|
||||
cls.location_1a_x2y1 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x2y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x2y1"
|
||||
)
|
||||
cls.location_1a_x3y1 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x3y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x3y1"
|
||||
)
|
||||
cls.location_1a_x1y2 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x1y2"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x1y2"
|
||||
)
|
||||
cls.location_1b_x1y1 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1b_x1y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1b_x1y1"
|
||||
)
|
||||
cls.location_1b_x1y2 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1b_x1y2"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1b_x1y2"
|
||||
)
|
||||
cls.location_2a = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_2a"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_2a"
|
||||
)
|
||||
cls.location_2a_x1y1 = cls.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_2a_x1y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_2a_x1y1"
|
||||
)
|
||||
|
||||
def _update_qty_in_location(self, location, product, quantity):
|
||||
self.env["stock.quant"]._update_available_quantity(
|
||||
product, location, quantity
|
||||
)
|
||||
self.env["stock.quant"]._update_available_quantity(product, location, quantity)
|
||||
|
||||
@classmethod
|
||||
def _create_simple_picking_out(cls, product, quantity):
|
||||
stock_loc = cls.env.ref('stock.stock_location_stock')
|
||||
customer_loc = cls.env.ref('stock.stock_location_customers')
|
||||
picking_type = cls.env.ref('stock.picking_type_out')
|
||||
partner = cls.env.ref('base.res_partner_1')
|
||||
return cls.env['stock.picking'].create(
|
||||
stock_loc = cls.env.ref("stock.stock_location_stock")
|
||||
customer_loc = cls.env.ref("stock.stock_location_customers")
|
||||
picking_type = cls.env.ref("stock.picking_type_out")
|
||||
partner = cls.env.ref("base.res_partner_1")
|
||||
return cls.env["stock.picking"].create(
|
||||
{
|
||||
'picking_type_id': picking_type.id,
|
||||
'partner_id': partner.id,
|
||||
'location_id': stock_loc.id,
|
||||
'location_dest_id': customer_loc.id,
|
||||
'move_lines': [
|
||||
"picking_type_id": picking_type.id,
|
||||
"partner_id": partner.id,
|
||||
"location_id": stock_loc.id,
|
||||
"location_dest_id": customer_loc.id,
|
||||
"move_lines": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
'name': product.name,
|
||||
'product_id': product.id,
|
||||
'product_uom': product.uom_id.id,
|
||||
'product_uom_qty': quantity,
|
||||
'picking_type_id': picking_type.id,
|
||||
'location_id': stock_loc.id,
|
||||
'location_dest_id': customer_loc.id,
|
||||
"name": product.name,
|
||||
"product_id": product.id,
|
||||
"product_uom": product.uom_id.id,
|
||||
"product_uom_qty": quantity,
|
||||
"picking_type_id": picking_type.id,
|
||||
"location_id": stock_loc.id,
|
||||
"location_dest_id": customer_loc.id,
|
||||
},
|
||||
)
|
||||
],
|
||||
@@ -95,27 +81,27 @@ class VerticalLiftCase(common.LocationTrayTypeCase):
|
||||
|
||||
@classmethod
|
||||
def _create_simple_picking_in(cls, product, quantity, dest_location):
|
||||
supplier_loc = cls.env.ref('stock.stock_location_suppliers')
|
||||
picking_type = cls.env.ref('stock.picking_type_in')
|
||||
partner = cls.env.ref('base.res_partner_1')
|
||||
return cls.env['stock.picking'].create(
|
||||
supplier_loc = cls.env.ref("stock.stock_location_suppliers")
|
||||
picking_type = cls.env.ref("stock.picking_type_in")
|
||||
partner = cls.env.ref("base.res_partner_1")
|
||||
return cls.env["stock.picking"].create(
|
||||
{
|
||||
'picking_type_id': picking_type.id,
|
||||
'partner_id': partner.id,
|
||||
'location_id': supplier_loc.id,
|
||||
'location_dest_id': dest_location.id,
|
||||
'move_lines': [
|
||||
"picking_type_id": picking_type.id,
|
||||
"partner_id": partner.id,
|
||||
"location_id": supplier_loc.id,
|
||||
"location_dest_id": dest_location.id,
|
||||
"move_lines": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
'name': product.name,
|
||||
'product_id': product.id,
|
||||
'product_uom': product.uom_id.id,
|
||||
'product_uom_qty': quantity,
|
||||
'picking_type_id': picking_type.id,
|
||||
'location_id': supplier_loc.id,
|
||||
'location_dest_id': dest_location.id,
|
||||
"name": product.name,
|
||||
"product_id": product.id,
|
||||
"product_uom": product.uom_id.id,
|
||||
"product_uom_qty": quantity,
|
||||
"picking_type_id": picking_type.id,
|
||||
"location_id": supplier_loc.id,
|
||||
"location_dest_id": dest_location.id,
|
||||
},
|
||||
)
|
||||
],
|
||||
@@ -123,21 +109,28 @@ class VerticalLiftCase(common.LocationTrayTypeCase):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _create_inventory(self, products):
|
||||
def _create_inventory(cls, products):
|
||||
"""Create a draft inventory
|
||||
|
||||
Products is a list of tuples (bin location, product).
|
||||
"""
|
||||
values = {
|
||||
'name': 'Test Inventory',
|
||||
'filter': 'partial',
|
||||
'line_ids': [(0, 0, {
|
||||
'product_id': product.id,
|
||||
'product_uom_id': product.uom_id.id,
|
||||
'location_id': location.id
|
||||
}) for location, product in products]
|
||||
"name": "Test Inventory",
|
||||
"filter": "partial",
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"product_id": product.id,
|
||||
"product_uom_id": product.uom_id.id,
|
||||
"location_id": location.id,
|
||||
},
|
||||
)
|
||||
for location, product in products
|
||||
],
|
||||
}
|
||||
inventory = self.env['stock.inventory'].create(values)
|
||||
inventory = cls.env["stock.inventory"].create(values)
|
||||
inventory.action_start()
|
||||
return inventory
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _
|
||||
|
||||
from .common import VerticalLiftCase
|
||||
|
||||
|
||||
@@ -19,27 +20,19 @@ class TestInventory(VerticalLiftCase):
|
||||
action = self.shuttle.action_open_screen()
|
||||
operation = self.shuttle._operation_for_mode()
|
||||
self.assertEqual(action["type"], "ir.actions.act_window")
|
||||
self.assertEqual(
|
||||
action["res_model"], "vertical.lift.operation.inventory"
|
||||
)
|
||||
self.assertEqual(action["res_model"], "vertical.lift.operation.inventory")
|
||||
self.assertEqual(action["res_id"], operation.id)
|
||||
|
||||
def test_inventory_count_ops(self):
|
||||
self._update_qty_in_location(
|
||||
self.location_1a_x1y1, self.product_socks, 10
|
||||
)
|
||||
self._update_qty_in_location(
|
||||
self.location_1a_x2y1, self.product_recovery, 10
|
||||
)
|
||||
self._update_qty_in_location(self.location_1a_x1y1, self.product_socks, 10)
|
||||
self._update_qty_in_location(self.location_1a_x2y1, self.product_recovery, 10)
|
||||
self._create_inventory(
|
||||
[
|
||||
(self.location_1a_x1y1, self.product_socks),
|
||||
(self.location_1a_x2y1, self.product_recovery),
|
||||
]
|
||||
)
|
||||
self._update_qty_in_location(
|
||||
self.location_2a_x1y1, self.product_socks, 10
|
||||
)
|
||||
self._update_qty_in_location(self.location_2a_x1y1, self.product_socks, 10)
|
||||
self._create_inventory([(self.location_2a_x1y1, self.product_socks)])
|
||||
|
||||
self.shuttle.switch_inventory()
|
||||
@@ -48,17 +41,13 @@ class TestInventory(VerticalLiftCase):
|
||||
self.assertEqual(operation.number_of_ops_all, 3)
|
||||
|
||||
def test_process_current_inventory(self):
|
||||
self._update_qty_in_location(
|
||||
self.location_1a_x1y1, self.product_socks, 10
|
||||
)
|
||||
self._update_qty_in_location(self.location_1a_x1y1, self.product_socks, 10)
|
||||
inventory = self._create_inventory(
|
||||
[(self.location_1a_x1y1, self.product_socks)]
|
||||
)
|
||||
self.shuttle.switch_inventory()
|
||||
operation = self.shuttle._operation_for_mode()
|
||||
self.assertEqual(
|
||||
operation.current_inventory_line_id, inventory.line_ids
|
||||
)
|
||||
self.assertEqual(operation.current_inventory_line_id, inventory.line_ids)
|
||||
# test the happy path, quantity is correct
|
||||
operation.quantity_input = 10.0
|
||||
result = operation.button_save()
|
||||
@@ -79,9 +68,7 @@ class TestInventory(VerticalLiftCase):
|
||||
self.assertEqual(result, expected_result)
|
||||
|
||||
def test_wrong_quantity(self):
|
||||
self._update_qty_in_location(
|
||||
self.location_1a_x1y1, self.product_socks, 10
|
||||
)
|
||||
self._update_qty_in_location(self.location_1a_x1y1, self.product_socks, 10)
|
||||
inventory = self._create_inventory(
|
||||
[(self.location_1a_x1y1, self.product_socks)]
|
||||
)
|
||||
@@ -97,8 +84,7 @@ class TestInventory(VerticalLiftCase):
|
||||
self.assertEqual(operation.state, "confirm_wrong_quantity")
|
||||
self.assertEqual(operation.current_inventory_line_id, line)
|
||||
self.assertEqual(
|
||||
operation.operation_descr,
|
||||
_("The quantity does not match, are you sure?"),
|
||||
operation.operation_descr, _("The quantity does not match, are you sure?")
|
||||
)
|
||||
|
||||
# entering the same quantity a second time validates
|
||||
|
||||
@@ -9,32 +9,29 @@ class TestVerticalLiftLocation(VerticalLiftCase):
|
||||
# this boolean is what defines a "Vertical Lift View", the upper level
|
||||
# of the tree (View -> Shuttles -> Trays -> Cells)
|
||||
self.assertTrue(self.vertical_lift_loc.vertical_lift_location)
|
||||
self.assertEqual(self.vertical_lift_loc.vertical_lift_kind, 'view')
|
||||
self.assertEqual(self.vertical_lift_loc.vertical_lift_kind, "view")
|
||||
|
||||
# check types accross the hierarchy
|
||||
shuttles = self.vertical_lift_loc.child_ids
|
||||
self.assertTrue(
|
||||
all(
|
||||
location.vertical_lift_kind == 'shuttle'
|
||||
for location in shuttles
|
||||
)
|
||||
all(location.vertical_lift_kind == "shuttle" for location in shuttles)
|
||||
)
|
||||
trays = shuttles.mapped('child_ids')
|
||||
trays = shuttles.mapped("child_ids")
|
||||
self.assertTrue(
|
||||
all(location.vertical_lift_kind == 'tray' for location in trays)
|
||||
all(location.vertical_lift_kind == "tray" for location in trays)
|
||||
)
|
||||
cells = trays.mapped('child_ids')
|
||||
cells = trays.mapped("child_ids")
|
||||
self.assertTrue(
|
||||
all(location.vertical_lift_kind == 'cell' for location in cells)
|
||||
all(location.vertical_lift_kind == "cell" for location in cells)
|
||||
)
|
||||
|
||||
def test_create_shuttle(self):
|
||||
# any location created directly under the view is a shuttle
|
||||
shuttle_loc = self.env['stock.location'].create(
|
||||
shuttle_loc = self.env["stock.location"].create(
|
||||
{
|
||||
'name': 'Shuttle 42',
|
||||
'location_id': self.vertical_lift_loc.id,
|
||||
'usage': 'internal',
|
||||
"name": "Shuttle 42",
|
||||
"location_id": self.vertical_lift_loc.id,
|
||||
"usage": "internal",
|
||||
}
|
||||
)
|
||||
self.assertEqual(shuttle_loc.vertical_lift_kind, 'shuttle')
|
||||
self.assertEqual(shuttle_loc.vertical_lift_kind, "shuttle")
|
||||
|
||||
@@ -21,8 +21,7 @@ class TestPick(VerticalLiftCase):
|
||||
self.shuttle.switch_pick()
|
||||
self.assertEqual(self.shuttle.mode, "pick")
|
||||
self.assertEqual(
|
||||
self.shuttle._operation_for_mode().current_move_line_id,
|
||||
self.out_move_line,
|
||||
self.shuttle._operation_for_mode().current_move_line_id, self.out_move_line
|
||||
)
|
||||
|
||||
def test_pick_action_open_screen(self):
|
||||
@@ -39,9 +38,7 @@ class TestPick(VerticalLiftCase):
|
||||
operation = self.shuttle._operation_for_mode()
|
||||
operation.select_next_move_line()
|
||||
self.assertEqual(operation.current_move_line_id, self.out_move_line)
|
||||
self.assertEqual(
|
||||
operation.operation_descr, _("Scan New Destination Location")
|
||||
)
|
||||
self.assertEqual(operation.operation_descr, _("Scan New Destination Location"))
|
||||
|
||||
def test_pick_save(self):
|
||||
self.shuttle.switch_pick()
|
||||
@@ -71,8 +68,7 @@ class TestPick(VerticalLiftCase):
|
||||
ml.location_id.location_id.tray_type_id,
|
||||
)
|
||||
self.assertEqual(
|
||||
operation.tray_type_code,
|
||||
ml.location_id.location_id.tray_type_id.code,
|
||||
operation.tray_type_code, ml.location_id.location_id.tray_type_id.code
|
||||
)
|
||||
self.assertEqual(operation.tray_x, ml.location_id.posx)
|
||||
self.assertEqual(operation.tray_y, ml.location_id.posy)
|
||||
@@ -80,9 +76,7 @@ class TestPick(VerticalLiftCase):
|
||||
# Move line related fields
|
||||
self.assertEqual(operation.picking_id, ml.picking_id)
|
||||
self.assertEqual(operation.picking_origin, ml.picking_id.origin)
|
||||
self.assertEqual(
|
||||
operation.picking_partner_id, ml.picking_id.partner_id
|
||||
)
|
||||
self.assertEqual(operation.picking_partner_id, ml.picking_id.partner_id)
|
||||
self.assertEqual(operation.product_id, ml.product_id)
|
||||
self.assertEqual(operation.product_uom_id, ml.product_uom_id)
|
||||
self.assertEqual(operation.product_uom_qty, ml.product_uom_qty)
|
||||
@@ -100,13 +94,11 @@ class TestPick(VerticalLiftCase):
|
||||
# ensure that we have stock in some cells, we'll put product1
|
||||
# in the first Shuttle and product2 in the second
|
||||
cell1 = self.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x3y2"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x3y2"
|
||||
)
|
||||
self._update_quantity_in_cell(cell1, product1, 50)
|
||||
cell2 = self.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_2a_x1y1"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_2a_x1y1"
|
||||
)
|
||||
self._update_quantity_in_cell(cell2, product2, 50)
|
||||
|
||||
@@ -203,8 +195,7 @@ class TestPick(VerticalLiftCase):
|
||||
|
||||
def test_tray_qty(self):
|
||||
cell = self.env.ref(
|
||||
"stock_vertical_lift."
|
||||
"stock_location_vertical_lift_demo_tray_1a_x3y2"
|
||||
"stock_vertical_lift." "stock_location_vertical_lift_demo_tray_1a_x3y2"
|
||||
)
|
||||
self.out_move_line.location_id = cell
|
||||
operation = self.shuttle._operation_for_mode()
|
||||
|
||||
@@ -56,13 +56,10 @@ class TestPut(VerticalLiftCase):
|
||||
operation = self.shuttle._operation_for_mode()
|
||||
select = select_model.create({"operation_id": operation.id})
|
||||
select.on_barcode_scanned(self.product_socks.barcode)
|
||||
self.assertRecordValues(
|
||||
select, [{"move_line_ids": put1.move_line_ids.ids}]
|
||||
)
|
||||
self.assertRecordValues(select, [{"move_line_ids": put1.move_line_ids.ids}])
|
||||
select.on_barcode_scanned(self.product_recovery.barcode)
|
||||
self.assertRecordValues(
|
||||
select,
|
||||
[{"move_line_ids": (put1.move_line_ids | put2.move_line_ids).ids}],
|
||||
select, [{"move_line_ids": (put1.move_line_ids | put2.move_line_ids).ids}]
|
||||
)
|
||||
select.action_validate()
|
||||
self.assertEqual(len(operation.operation_line_ids), 2)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<odoo>
|
||||
|
||||
<template id="packagings">
|
||||
<ul class="o_vlift_packaging list-unstyled">
|
||||
<t t-foreach="packagings" t-as="packaging">
|
||||
<li>
|
||||
<span>1</span>
|
||||
<span class="packaging_name" itemprop="name" t-esc="packaging['name']"/>
|
||||
<span>: </span>
|
||||
<span class="packaging_qty" itemprop="qty" t-esc="packaging['qty']"/>
|
||||
<span class="packaging_unit" itemprop="unit" t-esc="packaging['unit']"/>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</template>
|
||||
<template id="packagings">
|
||||
<ul class="o_vlift_packaging list-unstyled">
|
||||
<t t-foreach="packagings" t-as="packaging">
|
||||
<li>
|
||||
<span>1</span>
|
||||
<span class="packaging_name" itemprop="name" t-esc="packaging['name']"/>
|
||||
<span>: </span>
|
||||
<span class="packaging_qty" itemprop="qty" t-esc="packaging['qty']"/>
|
||||
<span class="packaging_unit" itemprop="unit" t-esc="packaging['unit']"/>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="stock_vertical_lift_assets" name="stock.vertical.lift.assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/stock_vertical_lift/static/src/scss/vertical_lift.scss"/>
|
||||
<script type="text/javascript" src="/stock_vertical_lift/static/src/js/vertical_lift.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
<template id="stock_vertical_lift_assets" name="stock.vertical.lift.assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/stock_vertical_lift/static/src/scss/vertical_lift.scss"/>
|
||||
<script type="text/javascript" src="/stock_vertical_lift/static/src/js/vertical_lift.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vertical_lift_operation_pick_screen_view" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.operation.pick.screen.view</field>
|
||||
<field name="model">vertical.lift.operation.pick</field>
|
||||
<field name="inherit_id" ref="vertical_lift_operation_transfer_screen_view"/>
|
||||
<field name="priority">100</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="string">Pick Screen</attribute>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="vertical_lift_operation_pick_screen_view" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.operation.pick.screen.view</field>
|
||||
<field name="model">vertical.lift.operation.pick</field>
|
||||
<field name="inherit_id" ref="vertical_lift_operation_transfer_screen_view"/>
|
||||
<field name="priority">100</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="string">Pick Screen</attribute>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,176 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="vertical_lift_shuttle_form_menu" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.view.form.menu</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="priority">100</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Shuttle">
|
||||
<div class="row o_vlift_shuttle_menu">
|
||||
<div class="col-6">
|
||||
<button name="switch_pick"
|
||||
type="object"
|
||||
string="Pick"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
<button name="switch_put"
|
||||
type="object"
|
||||
string="Put"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
<button name="switch_inventory"
|
||||
type="object"
|
||||
string="Inventory"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<field name="id" string="Back to settings"
|
||||
widget="vlift_shuttle_exit_button" readonly="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<footer></footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vertical_lift_shuttle_manual_barcode_form" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.manual.barcode.view.form</field>
|
||||
<field name="model">vertical.lift.shuttle.manual.barcode</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Shuttle">
|
||||
<div class="row o_vlift_shuttle_popup">
|
||||
<div class="col-8">
|
||||
<field name="barcode"/>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button name="button_save"
|
||||
string="Confirm"
|
||||
type="object"
|
||||
class="btn-primary"/>
|
||||
</div>
|
||||
</div>
|
||||
<footer></footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vertical_lift_shuttle_view_form" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.view.form</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Operations">
|
||||
<group name="main">
|
||||
<group name="left">
|
||||
<field name="name"/>
|
||||
<field name="mode"/>
|
||||
<field name="location_id"/>
|
||||
<field name="hardware"/>
|
||||
</group>
|
||||
<group string="Network" name="network">
|
||||
<field name="server"/>
|
||||
<field name="port"/>
|
||||
<field name="use_tls"/>
|
||||
</group>
|
||||
</group>
|
||||
<group groups="base.group_no_one">
|
||||
<label for="command_ids"/>
|
||||
<field name="command_ids">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="command"/>
|
||||
<field name="answer"/>
|
||||
<field name="error"/>
|
||||
<field name="create_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="vertical_lift_shuttle_view_kanban">
|
||||
<field name="name">vertical.lift.shuttle.kanban</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_dashboard">
|
||||
<field name="name"/>
|
||||
<field name="mode"/>
|
||||
<!-- <field name="number_of_ops"/> -->
|
||||
<!-- <field name="number_of_ops_all"/> -->
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click o_has_icon open_shuttle_screen">
|
||||
<div class="o_vlift_kanban_main">
|
||||
|
||||
<div class="o_kanban_card_content">
|
||||
<div class="o_kanban_primary_left">
|
||||
<div class="o_primary">
|
||||
<strong class="o_kanban_record_title">
|
||||
<span><t t-esc="record.name.value"/></span>
|
||||
</strong>
|
||||
<record id="vertical_lift_shuttle_form_menu" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.view.form.menu</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="priority">100</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Shuttle">
|
||||
<div class="row o_vlift_shuttle_menu">
|
||||
<div class="col-6">
|
||||
<button name="switch_pick"
|
||||
type="object"
|
||||
string="Pick"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
<button name="switch_put"
|
||||
type="object"
|
||||
string="Put"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
<button name="switch_inventory"
|
||||
type="object"
|
||||
string="Inventory"
|
||||
class="btn-primary btn-block btn btn-lg"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
Mode:
|
||||
<div class="col-6">
|
||||
<field name="id" string="Back to settings"
|
||||
widget="vlift_shuttle_exit_button" readonly="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<footer></footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vertical_lift_shuttle_manual_barcode_form" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.manual.barcode.view.form</field>
|
||||
<field name="model">vertical.lift.shuttle.manual.barcode</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Shuttle">
|
||||
<div class="row o_vlift_shuttle_popup">
|
||||
<div class="col-8">
|
||||
<field name="barcode"/>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button name="button_save"
|
||||
string="Confirm"
|
||||
type="object"
|
||||
class="btn-primary"/>
|
||||
</div>
|
||||
</div>
|
||||
<footer></footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vertical_lift_shuttle_view_form" model="ir.ui.view">
|
||||
<field name="name">vertical.lift.shuttle.view.form</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Operations">
|
||||
<group name="main">
|
||||
<group name="left">
|
||||
<field name="name"/>
|
||||
<field name="mode"/>
|
||||
</div>
|
||||
<!-- <div class="col-8"> -->
|
||||
<!-- Operations: -->
|
||||
<!-- <field name="number_of_ops"/> -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="col-8"> -->
|
||||
<!-- All <t t-esc="record.mode.value"/> Operations: -->
|
||||
<!-- <field name="number_of_ops_all"/> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<field name="location_id"/>
|
||||
<field name="hardware"/>
|
||||
</group>
|
||||
<group string="Network" name="network">
|
||||
<field name="server"/>
|
||||
<field name="port"/>
|
||||
<field name="use_tls"/>
|
||||
</group>
|
||||
</group>
|
||||
<group groups="base.group_no_one">
|
||||
<label for="command_ids"/>
|
||||
<field name="command_ids">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="command"/>
|
||||
<field name="answer"/>
|
||||
<field name="error"/>
|
||||
<field name="create_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<div class="o_kanban_card_manage_pane dropdown-menu" groups="stock.group_stock_manager" role="menu">
|
||||
<div class="o_kanban_card_manage_section o_kanban_manage_reports">
|
||||
<div role="menuitem">
|
||||
<a type="edit">Settings</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="o_kanban_manage_toggle_button o_left" href="#" groups="stock.group_stock_manager"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="vertical_lift_shuttle_view_kanban">
|
||||
<field name="name">vertical.lift.shuttle.kanban</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_dashboard">
|
||||
<field name="name"/>
|
||||
<field name="mode"/>
|
||||
<!-- <field name="number_of_ops"/> -->
|
||||
<!-- <field name="number_of_ops_all"/> -->
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click o_has_icon open_shuttle_screen">
|
||||
<div class="o_vlift_kanban_main">
|
||||
|
||||
<record model="ir.ui.view" id="vertical_lift_shuttle_view_tree">
|
||||
<field name="name">vertical.lift.shuttle.tree</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Shuttle">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<div class="o_kanban_card_content">
|
||||
<div class="o_kanban_primary_left">
|
||||
<div class="o_primary">
|
||||
<strong class="o_kanban_record_title">
|
||||
<span><t t-esc="record.name.value"/></span>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
Mode:
|
||||
<field name="mode"/>
|
||||
</div>
|
||||
<!-- <div class="col-8"> -->
|
||||
<!-- Operations: -->
|
||||
<!-- <field name="number_of_ops"/> -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="col-8"> -->
|
||||
<!-- All <t t-esc="record.mode.value"/> Operations: -->
|
||||
<!-- <field name="number_of_ops_all"/> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<record model="ir.actions.act_window" id="vertical_lift_shuttle_action">
|
||||
<field name="name">Vertical Lift Shuttles</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">vertical.lift.shuttle</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="target">current</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Open the Shuttle Interface.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<div class="o_kanban_card_manage_pane dropdown-menu" groups="stock.group_stock_manager" role="menu">
|
||||
<div class="o_kanban_card_manage_section o_kanban_manage_reports">
|
||||
<div role="menuitem">
|
||||
<a type="edit">Settings</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="o_kanban_manage_toggle_button o_left" href="#" groups="stock.group_stock_manager"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="vertical_lift_shuttle"
|
||||
name="Vertical Lift Shuttles"
|
||||
action="vertical_lift_shuttle_action"
|
||||
parent="stock.menu_stock_warehouse_mgmt"
|
||||
sequence="15"/>
|
||||
<record model="ir.ui.view" id="vertical_lift_shuttle_view_tree">
|
||||
<field name="name">vertical.lift.shuttle.tree</field>
|
||||
<field name="model">vertical.lift.shuttle</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Shuttle">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="vertical_lift_shuttle_action">
|
||||
<field name="name">Vertical Lift Shuttles</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">vertical.lift.shuttle</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="target">current</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Open the Shuttle Interface.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="vertical_lift_shuttle"
|
||||
name="Vertical Lift Shuttles"
|
||||
action="vertical_lift_shuttle_action"
|
||||
parent="stock.menu_stock_warehouse_mgmt"
|
||||
sequence="15"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user