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

12.0 mig stock available #540

Closed

Conversation

devang-dreambits
Copy link

No description provided.

Lionel Sausin (Numérigraphe) and others added 26 commits February 7, 2019 16:02
Generic module to compute the stock quantity available to promise using several implementations.
stock_available_immediatly is changed to become the first optional implementation.
Cherry pick of commit 0b060f6 from the v7 branch

[IMP] stock_available* uses new API

[ADD] stock_available_mrp

Module to take immediate manufaturing capability into account in the stock quantity available to promise.

Conflicts:
	stock_available/res_config.py

[DEL] move stock_available_mrp to __unported__

[ADD] stock_available_sale

Take sale quotations into account in the stock quantity available to promise
Cherry-picked from 497068f

Conflicts:
	stock_available/res_config.py

[DEL] move stock_available_sale to __unported__

[IMP] READMEs and TODOs

Cherry-picked from v7 at 8add4be

Conflicts:
	__unported__/stock_available_mrp/__openerp__.py
	stock_available/__openerp__.py
	stock_available_immediately/__openerp__.py

[IMP] respect product decimal precision

odoo/odoo#5512 and odoo-dev/odoo@b3e5a94 makes it clear the standard intends to support decimal precision on the product form.
…uct and

product.template, now takes in account variants and correctly displays value.
[FLAKE8]

Removing duplicate modules and moving README.rst into __unported__

[ADD} location calculations

[FIX] typo
not using internal qty_available that seems not to
take in consideration reserved quants.

[ADD] Tests
Commit 6c16913 changed the way we compute the immediately_usable_qty: instead of using the virtual stock, we used the sum of quants without reservations. But a quant may actually be reserved and still be available (for example it may be reserved for an internal move).
Fixes OCA#79

Remove loop and use correct decorator

Restore the features of stock_available_immediately

The previous fix restored stock_available but then there was no way to exclude the incomming moves from the count. This belongs in stock_available_immediately, restoring it cleanly.
This commit also takes care to respect the distinction between templates and variants, so it should fix OCA#73 too.

Restore the qty avail. to promise on variant treeview

PEP8
* fix the dependencies for the computed field

* use api.multi instead of api.one to avoid calling
  super()._immediately_usable_qty in a loop (this improves perfs on a tree view
  display)
There are cases where we dot NOT want to simply sum the quantities of all the
variants. For example when dealing with manufacturing capacities, we may have
to chose between variants because we can't make ALL of them with the same
components.

So instead of a simple non-modular implementation, we'll let each module define
his own implementation of how to compute the product template's quantity
available for sale.

Conflicts:
	stock_available/__openerp__.py
	stock_available_immediately/__openerp__.py
[CHG] improve code regarding code review

[ADD] add test

[CHG] optimize stock computation by avoiding to call useless compute
… related unit test

Increase version number of the module
Currently translated at 61.9% (13 of 21 strings)

Translation: stock-logistics-warehouse-11.0/stock-logistics-warehouse-11.0-stock_available
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_available/ar/
@oca-clabot
Copy link

Hey @devang-dreambits, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@oca-clabot
Copy link

Hey @devang-dreambits, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@devang-dreambits devang-dreambits mentioned this pull request Feb 7, 2019
54 tasks
@pedrobaeza pedrobaeza added this to the 12.0 milestone Feb 7, 2019
Copy link
Sponsor Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review. Minor comments

@@ -0,0 +1,77 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Could you please follow migration guide about readme fragments : https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0 ?

# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@Nikul-Chaudhary Nikul-Chaudhary left a comment

Choose a reason for hiding this comment

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

Improve Code


{
'name': 'Stock available to promise',
'version': '12.0.1.0.0',
Copy link
Member

Choose a reason for hiding this comment

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

@devang-dreambits Add website key and URL like https://github.com/OCA/stock-logistics-warehouse

@@ -0,0 +1,5 @@
# Copyright 2014 Numérigraphe
Copy link
Member

Choose a reason for hiding this comment

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

remove Copyright from all init file


.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/153/11.0
Copy link
Member

Choose a reason for hiding this comment

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

11.0/12.0

@ray-odoo
Copy link

ray-odoo commented Feb 8, 2019

I will have the opportunity to test this in the next few days. Woo hoo!!

@ray-odoo
Copy link

ray-odoo commented Feb 9, 2019

When testing this, I noticed that I was unable to set the "Exclude incoming goods" boolean via Inventory --> Settings.

I looked into the module code, and it seems that the configuration option "Exclude incoming goods" is designed to install "stock_available_immediately" when set to TRUE as the help for this boolean is "This installs the module stock_available_immediately.".

I don't see that module in this PR, and I don't see it available for testing at v12.

The User Experience when stock_available_immediately isn't available is to appear to do nothing, as the boolean is not set to True, but the user is provided no warning.

It appears that this module also optionally installs: stock_available_sale, sale_delivery_date, stock_available_mrp but I also don't see these modules available for testing at v12.

So I can't really test until these other modules are available. Do I misunderstand something?

I am going to take a look at stock_available_unreserved in an effort to understand the differences between this module and that one.

…init__.py; added development_status & website in manifest.py
@oca-clabot
Copy link

Hey @devang-dreambits, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@rousseldenis
Copy link
Sponsor Contributor

@devang-dreambits Could you add recent improvements from v10.0 like 29b6bcd#diff-2c6955de963025ce90888f7e13128f22 ?

@rousseldenis
Copy link
Sponsor Contributor

rousseldenis commented Apr 27, 2019

When testing this, I noticed that I was unable to set the "Exclude incoming goods" boolean via Inventory --> Settings.

I looked into the module code, and it seems that the configuration option "Exclude incoming goods" is designed to install "stock_available_immediately" when set to TRUE as the help for this boolean is "This installs the module stock_available_immediately.".

I don't see that module in this PR, and I don't see it available for testing at v12.

The User Experience when stock_available_immediately isn't available is to appear to do nothing, as the boolean is not set to True, but the user is provided no warning.

It appears that this module also optionally installs: stock_available_sale, sale_delivery_date, stock_available_mrp but I also don't see these modules available for testing at v12.

So I can't really test until these other modules are available. Do I misunderstand something?

I am going to take a look at stock_available_unreserved in an effort to understand the differences between this module and that one.

Yes indeed, stock_available module was designed like that and options to install other modules that depend on this are present anyway even if modules are not present.

The good solution should be removing all those options here and adding them in each module. It's clearer for user.

@lreficent @jbeficent @Cedric-Pigeon @devang-dreambits What do you think of this? That could be a good improvement for user experience

@rafaelbn
Copy link
Member

rafaelbn commented Jun 7, 2019

Please just notice about performance issues with this module:

@pedrobaeza
Copy link
Member

@karan-dreambits are you interested in continuing this PR? There's another PR for the module in #632 that has an interesting change in the smart-button style, but yours have priority as first in arrive.

@karan-dreambits
Copy link

@pedrobaeza I see #632 is much better so lets close this and let it supersede this :)
@devang-dreambits Please update our project setup to use the #632 PR instead of this one

@sergio-teruel
Copy link
Contributor

@karan-dreambits Please, can you review #632 ??

@pedrobaeza
Copy link
Member

Thanks for your comprehension, so closing.

@pedrobaeza pedrobaeza closed this Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet