Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] stock_quantity_history_location #316

Open
wants to merge 34 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cd713fc
[11.0][ADD] stock_quantity_history_location & stock_account_quantity_…
JordiBForgeFlow Jan 10, 2019
dbdeb8a
[MIG] stock_quantity_history_location: Migration to 12.0
HviorForgeFlow Jul 9, 2019
81d42ba
[FIX] stock_quantity_history_location: stock.quant action fixup!
HviorForgeFlow Aug 30, 2019
1887fd0
[IMP] stock_quantity_history_location: black, isort
HviorForgeFlow Dec 20, 2019
ac2a70e
[MIG] stock_quantity_history_location: Migration to 13.0
HviorForgeFlow Dec 20, 2019
bba840d
[13.0][IMP] stock_quantity_history_location: Block location selection…
HviorForgeFlow Dec 23, 2019
c641bb6
Added translation using Weblate (Romanian)
erik-bzcl Sep 29, 2020
a03ce5f
Translated using Weblate (Romanian)
erik-bzcl Sep 29, 2020
41a3a99
Apply pre-commit
joao-p-marques Feb 17, 2021
d661120
Added translation using Weblate (Italian)
alessandro-fiorino Apr 8, 2021
2cc4d0e
Translated using Weblate (Italian)
alessandro-fiorino Apr 8, 2021
b81e427
[IMP] stock_quantity_history_location: Add functions in test to allow…
victoralmau May 5, 2021
7d4426f
[FIX] stock_quantity_history_location: Add literal_eval to prevent er…
victoralmau May 10, 2021
68390d3
[IMP] stock_quantity_history_location: black, isort, prettier
atchuthan Jun 24, 2021
517e976
[MIG] stock_quantity_history_location: Migration to 14.0
atchuthan Jun 24, 2021
3efd430
Added translation using Weblate (Japanese)
kakurai8 Jan 21, 2022
0bb64b3
Translated using Weblate (Japanese)
kakurai8 Jan 21, 2022
b6773d7
[MIG] stock_quantity_history_location: Migration 15.0
AnnaPForgeFlow Jul 6, 2022
47f0c50
[UPD] Update stock_quantity_history_location.pot
Mar 29, 2023
d21357b
[UPD] README.rst
OCA-git-bot Mar 29, 2023
1879ea9
Update translation files
weblate Mar 29, 2023
aeffac2
[MIG] stock_quantity_history_location: Migration to 16.0
slitheryduke11 May 3, 2023
1cdf9f5
[UPD] Update stock_quantity_history_location.pot
May 15, 2023
e9b6f97
[UPD] README.rst
OCA-git-bot May 15, 2023
82983d9
Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
0d74f2b
[FIX] stock_quantity_history_location: Migrate js to OWL
rolandojduartem Aug 18, 2023
86d29b7
[UPD] README.rst
OCA-git-bot Aug 22, 2023
e4dcc6d
Update translation files
weblate Sep 2, 2023
163985e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
62e4ad8
Translated using Weblate (Italian)
mymage Nov 24, 2023
8ac0689
Added translation using Weblate (Spanish)
Ivorra78 Dec 9, 2023
2c3417f
Translated using Weblate (Spanish)
Ivorra78 Dec 9, 2023
9069636
[IMP] stock_quantity_history_location: pre-commit auto fixes
AnaisLForgeFlow Apr 30, 2024
760f848
[MIG] stock_quantity_history_location: Migration to 17.0
AnaisLForgeFlow May 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion stock_quantity_history_location/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ report by location, for a past date or for current date.
Usage
=====

- Go to: *Inventory / Reporting / Inventory or Inventory Valuation*
First, you need to activate Storage Locations. To do so, go to Inventory
/ Configuration / Settings / Warehouse and activate it.

To use this module, go to:

- *Inventory / Reporting / Locations*

- Select Inventory at Date & Location

- Filter by location

Expand Down
1 change: 1 addition & 0 deletions stock_quantity_history_location/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import wizards
from . import models
14 changes: 3 additions & 11 deletions stock_quantity_history_location/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2019 ForgeFlow S.L.
# Copyright 2019 Aleph Objects, Inc.
# Copyright 2019-2024 ForgeFlow S.L.
# Copyright 2019-2024 Aleph Objects, Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Stock Quantity History Location",
"summary": "Provides stock quantity by location on past date",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"maintainers": [
Expand All @@ -15,12 +15,4 @@
"website": "https://github.com/OCA/stock-logistics-reporting",
"depends": ["stock"],
"data": ["wizards/stock_quantity_history.xml"],
"assets": {
"web.assets_backend": [
"stock_quantity_history_location/static/src/components"
"/inventory_report/inventory_report.esm.js",
"stock_quantity_history_location/static/src/components/"
"inventory_report/inventory_report.xml",
],
},
}
1 change: 1 addition & 0 deletions stock_quantity_history_location/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_quant
25 changes: 25 additions & 0 deletions stock_quantity_history_location/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from lxml import etree

from odoo import api, models


class StockQuant(models.Model):
_inherit = "stock.quant"

@api.model
def get_views(self, views, options=None):
res = super().get_views(views, options=options)
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnaisLForgeFlow Maybe a good improvement should be adding a little test calling the view.

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rousseldenis sure, we can add this for better test coverage

user_has_group = self.user_has_groups("stock.group_stock_multi_locations")
list_view = res.get("views", {}).get("list", {})

Check warning on line 16 in stock_quantity_history_location/models/stock_quant.py

View check run for this annotation

Codecov / codecov/patch

stock_quantity_history_location/models/stock_quant.py#L14-L16

Added lines #L14 - L16 were not covered by tests
if user_has_group and list_view:
arch = list_view.get("arch", "")
arch_tree = etree.XML(arch)
buttons = arch_tree.xpath('//button[@name="action_inventory_at_date"]')

Check warning on line 20 in stock_quantity_history_location/models/stock_quant.py

View check run for this annotation

Codecov / codecov/patch

stock_quantity_history_location/models/stock_quant.py#L18-L20

Added lines #L18 - L20 were not covered by tests
for button in buttons:
button.set("string", "Inventory at Date & Location")
new_arch = etree.tostring(arch_tree, encoding="unicode")
list_view["arch"] = new_arch
return res

Check warning on line 25 in stock_quantity_history_location/models/stock_quant.py

View check run for this annotation

Codecov / codecov/patch

stock_quantity_history_location/models/stock_quant.py#L22-L25

Added lines #L22 - L25 were not covered by tests
10 changes: 8 additions & 2 deletions stock_quantity_history_location/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
- Go to: *Inventory / Reporting / Inventory or Inventory Valuation*
First, you need to activate Storage Locations. To do so, go to
Inventory / Configuration / Settings / Warehouse and activate it.

To use this module, go to:
- *Inventory / Reporting / Locations*

- Select Inventory at Date & Location

- Filter by location

- **Optionally: Mark if you want to include child location**

- Choose a moment in time:
- Choose a moment in time:
- Current Inventory
- At a Specific Date
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,12 @@ <h1 class="title">Stock Quantity History Location</h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>First, you need to activate Storage Locations. To do so, go to Inventory
/ Configuration / Settings / Warehouse and activate it.</p>
<p>To use this module, go to:</p>
<ul class="simple">
<li>Go to: <em>Inventory / Reporting / Inventory or Inventory Valuation</em></li>
<li><em>Inventory / Reporting / Locations</em></li>
<li>Select Inventory at Date &amp; Location</li>
<li>Filter by location</li>
<li><strong>Optionally: Mark if you want to include child location</strong></li>
<li>Choose a moment in time:<ul>
Expand Down

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions stock_quantity_history_location/tests/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Tecnativa - Víctor Martínez
# Copyright 2021-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests.common import TransactionCase
Expand All @@ -22,7 +22,8 @@ def _create_stock_move(self, location_dest_id, qty):
)
move._action_confirm()
move._action_assign()
move_line = move.move_line_ids[0]
move_line.qty_done = qty
for move_line in move.move_line_ids:
move_line.quantity = qty
move_line.picked = True
move._action_done()
return move
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2019 ForgeFlow S.L.
# Copyright 2021 Tecnativa - Víctor Martínez
# Copyright 2019-2024 ForgeFlow S.L.
# Copyright 2021-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2019 ForgeFlow S.L.
# Copyright 2019 Aleph Objects, Inc.
# Copyright 2021 Tecnativa - Víctor Martínez
# Copyright 2019-2024 ForgeFlow S.L.
# Copyright 2019-2024 Aleph Objects, Inc.
# Copyright 2021-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
<odoo>

<record id="view_stock_quantity_history_location" model="ir.ui.view">
<field name="name">Inventory Report</field>
<field
name="name"
>stock.quantity.history.form - stock_quantity_history_location</field>
<field name="model">stock.quantity.history</field>
<field name="inherit_id" ref="stock.view_stock_quantity_history" />
<field name="arch" type="xml">
<field name="inventory_datetime" position="before">
<field name="location_id" groups="stock.group_stock_multi_locations" />
<field
name="include_child_locations"
attrs="{'invisible': [('location_id', '=', False)]}"
invisible="not location_id"
groups="stock.group_stock_multi_locations"
/>
</field>
Expand Down
Loading