-
Notifications
You must be signed in to change notification settings - Fork 2
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
[16.0] [ADD] foodhub_picking_operations #122
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
========================== | ||
Foodhub Picking Operations | ||
========================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:7d681b62ded7841560c15427c9d8b30b35a514b6c31f2c2b36c47419e1e1120c | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Fcie--custom-lightgray.png?logo=github | ||
:target: https://github.com/coopiteasy/cie-custom/tree/16.0/foodhub_picking_operations | ||
:alt: coopiteasy/cie-custom | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Sort picking operations by internal category and internal reference. | ||
|
||
Context : Increase the efficiency of picking by sorting products by location and priority. We cannot use "locations" because some products are of type Consumable and should stay this way : these are products that are received and sent on the same date, we don't want to manage stock on these products. | ||
So instead we sort by internal categories and by reference. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/cie-custom/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/coopiteasy/cie-custom/issues/new?body=module:%20foodhub_picking_operations%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Coop IT Easy SC | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `coopiteasy/cie-custom <https://github.com/coopiteasy/cie-custom/tree/16.0/foodhub_picking_operations>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "Foodhub Picking Operations", | ||
"version": "16.0.1.0.0", | ||
"summary": """ | ||
Foodhub customizations : sort picking operations by category and reference""", | ||
"author": "Coop IT Easy SC", | ||
"website": "https://coopiteasy.be", | ||
"license": "AGPL-3", | ||
"category": "Stock", | ||
"depends": [ | ||
"stock", | ||
], | ||
"data": ["reports/report_picking_operations.xml"], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import stock_move | ||
from . import stock_move_line |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||||||||||
# Copyright 2020 Coop IT Easy SCRL fs | ||||||||||||||
# Robin Keunen <[email protected]> | ||||||||||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||||||||||||||
|
||||||||||||||
from odoo import fields, models | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
class StockMove(models.Model): | ||||||||||||||
_inherit = "stock.move" | ||||||||||||||
_order = "product_category,product_default_code" | ||||||||||||||
|
||||||||||||||
product_category = fields.Many2one(related="product_id.categ_id", store=True) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will sort by the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory I agree with you, but in practice it works ! checkout out this delivery, on the picking operations, valdibela is sorted last, while it's id is 3 (lower than the id from tierra y liberdad). Unless the sorting is descending ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that I will only keep the sorting for move lines, not moves There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my bad: i just checked, and indeed, odoo does it better than i think: if a many2one field is used in |
||||||||||||||
product_default_code = fields.Char(related="product_id.default_code", store=True) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2020 Coop IT Easy SCRL fs | ||
# Robin Keunen <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move.line" | ||
_order = "product_category_name,product_default_code" | ||
|
||
product_default_code = fields.Char(related="product_id.default_code", store=True) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Sort picking operations by internal category and internal reference. | ||
|
||
Context : Increase the efficiency of picking by sorting products by location and priority. We cannot use "locations" because some products are of type Consumable and should stay this way : these are products that are received and sent on the same date, we don't want to manage stock on these products. | ||
So instead we sort by internal categories and by reference. | ||
|
||
- Put the name of the SO in title, rather than the picking reference. Because this picking will be sent to the client, who only knows the reference of the SO. In principle this document should not be sent to the client, but here it's easier to only rely on one document. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="report_picking" inherit_id="stock.report_picking"> | ||
<xpath expr="//h1" position="replace"> | ||
<h1 t-field="o.origin" class="mt0"/> | ||
</xpath> | ||
victor-champonnois marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<xpath expr="//div[@name='div_origin']" position="replace"> | ||
<div t-if="o.origin" class="col-auto" name="div_origin"> | ||
<strong>Picking:</strong> | ||
<p t-field="o.name"/> | ||
</div> | ||
</xpath> | ||
victor-champonnois marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<xpath expr="//th[@name='th_product']" position="before"> | ||
<th> | ||
<strong>Category</strong> | ||
</th> | ||
</xpath> | ||
|
||
<xpath | ||
expr="//span[@t-field='ml.product_id.display_name']/.." | ||
position="before" | ||
> | ||
<td> | ||
<span t-field="ml.product_category_name" /> | ||
</td> | ||
</xpath> | ||
|
||
</template> | ||
</odoo> |
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.
why
_operations
in the module name? suggestion:foodhub_custom_stock_picking
.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.
done, dropped the custom because it's useless I think
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.
then i think
foodhub_stock_picking
is better, becausepicking
alone is a little strange.