-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
[MIG] stock_average_daily_sale: Backporting to 14.0 from 16.0 #342
base: 14.0
Are you sure you want to change the base?
[MIG] stock_average_daily_sale: Backporting to 14.0 from 16.0 #342
Conversation
…evel + add demo The configurations are now stored on abc profiles. Some demo data are loaded in order to show this module features more easily.
…ame to recommended_qty
By default the priority in odoo is set to '0'. Before this change the daily sale was never computed for moves done in a normal process. There is no need to filter out moves based on the priority from the computation.
Co-authored-by: Jacques-Etienne Baudoux <je@bcim.be>
As tests create a Savepoint, there is a concurrent query when checking the view existence.
As for x reason, some products appear more than one time in the report, id generated by the concatenation of product_id and warehouse_id is irrelevant (as duplicate values possible). Use row_number() instead
Currently translated at 100.0% (58 of 58 strings) Translation: stock-logistics-reporting-16.0/stock-logistics-reporting-16.0-stock_average_daily_sale Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-16-0/stock-logistics-reporting-16-0-stock_average_daily_sale/it/
Remove product_abc_classification dependency. This module is not essential for the current module to function properly.
Only stock_user can see config and report; stock_manager can create and delete config entries
Set default average_daily_sale_root_location on WH create. Default stock location of the new WH is used for this purpose
Allow to decide if weekends should be included or excluded in average daily sale calculation.
Take also production location as dest location for daily usage calculation
…ny_id stock_average_daily_sale: - add form view for config - add company_id to config - allow editing ABC classification level and make sure the level is unique per warehouse
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-reporting-16.0/stock-logistics-reporting-16.0-stock_average_daily_sale Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-16-0/stock-logistics-reporting-16-0-stock_average_daily_sale/
@twalter-c2c we have a maturity level conflict See https://github.com/OCA/stock-logistics-warehouse/blob/14.0/stock_location_warehouse/__manifest__.py#L14 |
948400d
to
4543eba
Compare
4543eba
to
6e5145f
Compare
6e5145f
to
3c460e1
Compare
@rousseldenis would you mind to have a look? 🙏 |
|
||
@classmethod | ||
def _create_inventory(cls): | ||
inventory = cls.env["stock.inventory"].create( |
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.
inventory = cls.env["stock.inventory"].create( | |
inventory = cls.inventory_obj.create( |
@@ -50,20 +50,34 @@ def setUpClass(cls): | |||
|
|||
@classmethod | |||
def _create_inventory(cls): | |||
cls.inventory_obj.create( | |||
inventory = cls.env["stock.inventory"].create( |
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.
Not sure why we switched from stock.quant
to stock.inventory
to put goods in stock, we can also use quant model to do that in v14. E.g:
cls.env["stock.quant"]._update_available_quantity(
product,
location,
quantity,
package_id=package,
lot_id=lot,
in_date=in_date,
)
Or if we want to state the current qty in stock (not adding new ones), we can use this helper method:
@classmethod
def _update_qty_in_location(
cls, location, product, quantity, package=None, lot=None, in_date=None
):
quants = cls.env["stock.quant"]._gather(
product, location, lot_id=lot, package_id=package, strict=True
)
# this method adds the quantity to the current quantity, so remove it
quantity -= sum(quants.mapped("quantity"))
cls.env["stock.quant"]._update_available_quantity(
product,
location,
quantity,
package_id=package,
lot_id=lot,
in_date=in_date,
)
But probably not blocking for a backport.
/ocabot migration stock_average_daily_sale |
I found an issue, if there is no EDIT: fixed |
… if not defined on move
Because of a datetime to date conversion, yesterday was excluded from calculation while being set as a date_to value. With this commit we include all the stock moves until up to 23:59:59 of the previous day.
No description provided.