ADD module stock_inventory_usability
This commit is contained in:
1
stock_inventory_usability/__init__.py
Normal file
1
stock_inventory_usability/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
18
stock_inventory_usability/__manifest__.py
Normal file
18
stock_inventory_usability/__manifest__.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Copyright 2022 Akretion (https://www.akretion.com).
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
{
|
||||||
|
"name": "Stock Inventory Usability",
|
||||||
|
"summary": "Stock inventory usability.",
|
||||||
|
"version": "14.0.1.0.1",
|
||||||
|
"development_status": "Mature",
|
||||||
|
"author": "Akretion",
|
||||||
|
"website": "https://github.com/akretion/odoo-usability",
|
||||||
|
"category": "Warehouse",
|
||||||
|
"depends": ["stock"],
|
||||||
|
"data": [
|
||||||
|
"views/stock_inventory.xml",
|
||||||
|
],
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"installable": True,
|
||||||
|
"application": False,
|
||||||
|
}
|
||||||
1
stock_inventory_usability/models/__init__.py
Normal file
1
stock_inventory_usability/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import stock_inventory
|
||||||
17
stock_inventory_usability/models/stock_inventory.py
Normal file
17
stock_inventory_usability/models/stock_inventory.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Copyright 2022 Akretion (https://www.akretion.com).
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo import _, fields, models, api
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
|
class Inventory(models.Model):
|
||||||
|
_inherit = "stock.inventory"
|
||||||
|
|
||||||
|
prefill_counted_quantity = fields.Selection(default="zero")
|
||||||
|
estimated_inventory_lines = fields.Float(compute="_compute_estimated_inventory_lines") #store ?
|
||||||
|
|
||||||
|
@api.depends("location_ids", "product_ids")
|
||||||
|
def _compute_estimated_inventory_lines(self):
|
||||||
|
for inv in self:
|
||||||
|
inv.estimated_inventory_lines = len(inv._get_quantities())
|
||||||
27
stock_inventory_usability/views/stock_inventory.xml
Normal file
27
stock_inventory_usability/views/stock_inventory.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!-- Copyright 2022 Akretion (https://www.akretion.com).
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||||
|
<odoo>
|
||||||
|
<record id="view_inventory_form" model="ir.ui.view">
|
||||||
|
<field
|
||||||
|
name="name"
|
||||||
|
>Inventory form view - stock_inventory_usability extension</field>
|
||||||
|
<field name="model">stock.inventory</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_inventory_form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="prefill_counted_quantity" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="exhausted" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="accounting_date" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="product_ids" position="after">
|
||||||
|
<field name="estimated_inventory_lines" readonly="1" states="draft"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user