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

[9.0][ADD] stock_inventory_exclude_sublocation #240

Merged

Conversation

LoisRForgeFlow
Copy link
Contributor

Stock Inventory Exclude Sublocation

This module extends the functionality of Inventory Adjustment to allow you to
exclude all the sublocations when doing an inventory adjustment for a
given location.

Usage

To use this module, you simply need to:

  • Create a new inventory adjustment.
  • Select the option inventory of all products.
  • Check the box "Exclude Sublocations".

"summary": "Allow to perform inventories of a location without including "
"its child locations.",
"version": "9.0.1.0.0",
"author": "Eficent Business and IT Consulting Services S.L,"
Copy link
Member

Choose a reason for hiding this comment

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

Replace the long Eficent name with just Eficent

"version": "9.0.1.0.0",
"author": "Eficent Business and IT Consulting Services S.L,"
"Odoo Community Association (OCA)",
"website": "https://www.odoo-community.org",
Copy link
Member

Choose a reason for hiding this comment

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

if inventory.exclude_sublocation:
product_obj = self.env['product.product']
location_ids = self._get_location_ids(inventory)
domain = ' location_id in %s'
Copy link
Member

Choose a reason for hiding this comment

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

As there's only one location, use:

domain = ' location_id = %s'
args = (inventory.location_id.id)

def _get_inventory_lines(self, inventory):
if inventory.exclude_sublocation:
product_obj = self.env['product.product']
location_ids = self._get_location_ids(inventory)
Copy link
Member

Choose a reason for hiding this comment

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

Omit this

<field name="arch" type="xml">
<field name="filter" position="after">
<field name="exclude_sublocation"
attrs="{'invisible': [('filter', '!=', 'none')]}"/>
Copy link
Member

Choose a reason for hiding this comment

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

Only hide if it's multiple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The remaining option is to select only one product and the field to select the product is this (https://github.com/odoo/odoo/blob/9.0/addons/stock/stock_view.xml#L108). Since the domain is not affected by the location of the inventory adjustment I think that the "exclude sublocation" option is still not applicable.

@LoisRForgeFlow LoisRForgeFlow force-pushed the 9.0-stock_inventory_exclude_sublocation branch from 4c99185 to 9a54191 Compare January 12, 2017 17:22
Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Please add some tests

Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

LGTM now 👍

Copy link
Member

@JordiBForgeFlow JordiBForgeFlow left a comment

Choose a reason for hiding this comment

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

Functional and technical review 👍

Nicely done!

@LoisRForgeFlow
Copy link
Contributor Author

@darshan-serpent can you please review?

@JordiBForgeFlow
Copy link
Member

@lreficent Can you squash your commits?

@JordiBForgeFlow JordiBForgeFlow merged commit 9244012 into OCA:9.0 Feb 9, 2017
yk2kus pushed a commit to thinkopensolutions/oca-stock-logistics-warehouse that referenced this pull request Mar 16, 2017
…ce_link_tests

[IMP] Check that stock move_lines are in invoice lines
gfcapalbo pushed a commit to gfcapalbo/stock-logistics-warehouse that referenced this pull request Jun 29, 2017
* [ADD] stock_inventory_exclude_sublocation
MiquelRForgeFlow pushed a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Jul 19, 2017
* [ADD] stock_inventory_exclude_sublocation
MiquelRForgeFlow pushed a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Aug 28, 2017
* [ADD] stock_inventory_exclude_sublocation
@MiquelRForgeFlow MiquelRForgeFlow deleted the 9.0-stock_inventory_exclude_sublocation branch September 6, 2017 10:53
daramousk pushed a commit to daramousk/stock-logistics-warehouse that referenced this pull request Apr 20, 2018
* [ADD] stock_inventory_exclude_sublocation
daramousk pushed a commit to daramousk/stock-logistics-warehouse that referenced this pull request Apr 26, 2018
* [ADD] stock_inventory_exclude_sublocation
LoisRForgeFlow added a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Sep 12, 2018
* [ADD] stock_inventory_exclude_sublocation
LoisRForgeFlow added a commit that referenced this pull request Sep 19, 2018
* [ADD] stock_inventory_exclude_sublocation
bodedra pushed a commit to ursais/stock-logistics-warehouse that referenced this pull request Jun 21, 2019
* [ADD] stock_inventory_exclude_sublocation
HviorForgeFlow pushed a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Jul 30, 2019
* [ADD] stock_inventory_exclude_sublocation
HviorForgeFlow pushed a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Dec 30, 2019
* [ADD] stock_inventory_exclude_sublocation
CarlosRoca13 pushed a commit to Tecnativa/stock-logistics-warehouse that referenced this pull request Aug 16, 2021
* [ADD] stock_inventory_exclude_sublocation
JoanSForgeFlow pushed a commit to ForgeFlow/stock-logistics-warehouse that referenced this pull request Sep 10, 2021
* [ADD] stock_inventory_exclude_sublocation
Chanakya-OSI pushed a commit to ursais/stock-logistics-warehouse that referenced this pull request Dec 8, 2022
* [ADD] stock_inventory_exclude_sublocation
Urvisha-OSI pushed a commit to ursais/stock-logistics-warehouse that referenced this pull request Mar 22, 2023
* [ADD] stock_inventory_exclude_sublocation
mileo pushed a commit to kmee/stock-logistics-warehouse that referenced this pull request Jan 17, 2024
* [ADD] stock_inventory_exclude_sublocation
virendra-aktivsoftware pushed a commit to virendra-aktivsoftware/stock-logistics-warehouse that referenced this pull request Mar 18, 2024
* [ADD] stock_inventory_exclude_sublocation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants