mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Add stock_vertical_lift_qty_by_packaging
This commit is contained in:
committed by
nguyen hoang hiep
parent
3c3a67fbf2
commit
153d971262
1
stock_vertical_lift_qty_by_packaging/README.rst
Normal file
1
stock_vertical_lift_qty_by_packaging/README.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
wait fot the bot ;)
|
||||||
1
stock_vertical_lift_qty_by_packaging/__init__.py
Normal file
1
stock_vertical_lift_qty_by_packaging/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
19
stock_vertical_lift_qty_by_packaging/__manifest__.py
Normal file
19
stock_vertical_lift_qty_by_packaging/__manifest__.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Copyright 2021 Camptocamp SA
|
||||||
|
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
|
||||||
|
{
|
||||||
|
"name": "Stock vertical lift qty by packaging",
|
||||||
|
"summary": """
|
||||||
|
Glue module for `stock_product_qty_by_packaging` and `stock_vertical_lift`.
|
||||||
|
""",
|
||||||
|
"version": "13.0.1.0.0",
|
||||||
|
"development_status": "Alpha",
|
||||||
|
"category": "Warehouse Management",
|
||||||
|
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||||
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
|
"license": "LGPL-3",
|
||||||
|
"application": False,
|
||||||
|
"installable": True,
|
||||||
|
"auto_install": True,
|
||||||
|
"depends": ["stock_product_qty_by_packaging", "stock_vertical_lift"],
|
||||||
|
"data": ["views/vertical_lift_operation_base_views.xml"],
|
||||||
|
}
|
||||||
1
stock_vertical_lift_qty_by_packaging/models/__init__.py
Normal file
1
stock_vertical_lift_qty_by_packaging/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import vertical_lift_operation_base
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright 2020 Camptocamp SA
|
||||||
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class VerticalLiftOperationTransfer(models.AbstractModel):
|
||||||
|
_inherit = "vertical.lift.operation.transfer"
|
||||||
|
|
||||||
|
product_qty_by_packaging_display = fields.Char(
|
||||||
|
compute="_compute_product_qty_by_packaging_display"
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends("current_move_line_id.product_qty")
|
||||||
|
def _compute_product_qty_by_packaging_display(self):
|
||||||
|
# Seems the ctx key is not propagated on a related field
|
||||||
|
# nor from the field definition, nor from the field declaration in the view.
|
||||||
|
# Hence, we are forced to use a computed field.
|
||||||
|
for rec in self.with_context(qty_by_pkg_total_units=True):
|
||||||
|
rec.product_qty_by_packaging_display = (
|
||||||
|
rec.current_move_line_id.product_qty_by_packaging_display
|
||||||
|
)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Simone Orsi <simone.orsi@camptocamp.com>
|
||||||
|
Sébastien Alix <sebastien.alix@camptocamp.com>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Glue module for `stock_product_qty_by_packaging` and `stock_vertical_lift`.
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="vertical_lift_operation_transfer_screen_view" model="ir.ui.view">
|
||||||
|
<field name="name">vertical.lift.operation.transfer.screen.view</field>
|
||||||
|
<field name="model">vertical.lift.operation.transfer</field>
|
||||||
|
<field
|
||||||
|
name="inherit_id"
|
||||||
|
ref="stock_vertical_lift.vertical_lift_operation_transfer_screen_view"
|
||||||
|
/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<!-- Display only full qty by packaging and units -->
|
||||||
|
<xpath expr="//field[@name='product_uom_id']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='product_uom_qty']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='product_uom_id']" position="after">
|
||||||
|
<field
|
||||||
|
name="product_qty_by_packaging_display"
|
||||||
|
class="oe_inline ml8 text-white"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user