-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
[9.0][ADD] stock_inventory_exclude_sublocation #240
Conversation
"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," |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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')]}"/> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
[FIX] Delete not needed method.
4c99185
to
9a54191
Compare
There was a problem hiding this 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
[FIX] Copyright year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now 👍
There was a problem hiding this 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!
@darshan-serpent can you please review? |
@lreficent Can you squash your commits? |
…ce_link_tests [IMP] Check that stock move_lines are in invoice lines
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
* [ADD] stock_inventory_exclude_sublocation
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: