-
-
Notifications
You must be signed in to change notification settings - Fork 654
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][MIG] stock_picking_group_by_partner_by_carrier_by_date: Migration to 16.0 #1528
Merged
OCA-git-bot
merged 11 commits into
OCA:16.0
from
tuantrantg:16.0-mig-stock_picking_group_by_partner_by_carrier_by_date
May 7, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ced6ef3
Add stock_picking_group_by_partner_by_carrier_by_date
simahawk b2fead9
s_picking_group_by_partner_by_carrier_by_date: rely on picking type flag
simahawk 6ac0bef
stock_picking_group_by_* rebase on stock_move_assign_picking_hook
simahawk 2eabbfe
s_picking_group_by_partner_by_carrier: add merge wizard
simahawk 9282593
[MIG] stock_picking_group_by_partner_by_carrier_by_date: Migration to…
phuctranfxvn a3393cb
[FIX] s_by_carrier_by_date: group same day different time
sebalix 7bfb6f3
Added translation using Weblate (Italian)
mymage de2fbe1
Translated using Weblate (Italian)
mymage 1c5b5af
[IMP] stock_picking_group_by_partner_by_carrier_by_date: pre-commit s…
tuantrantg c087351
[MIG] stock_picking_group_by_partner_by_carrier_by_date: Migration to…
tuantrantg 6996df1
[FIX] stock_picking_group_by_partner_by_carrier_by_date: Fix timezone…
tuantrantg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
..._partner_by_carrier_by_date/odoo/addons/stock_picking_group_by_partner_by_carrier_by_date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_picking_group_by_partner_by_carrier_by_date |
6 changes: 6 additions & 0 deletions
6
setup/stock_picking_group_by_partner_by_carrier_by_date/setup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
98 changes: 98 additions & 0 deletions
98
stock_picking_group_by_partner_by_carrier_by_date/README.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
============================================================== | ||
Stock Picking: group by partner and carrier and scheduled date | ||
============================================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:e7c76c2b68fdb9355b885ad9bbc225bafc6f8014d92df44108e674dd0bb80fbb | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Alpha | ||
.. |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-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_group_by_partner_by_carrier_by_date | ||
:alt: OCA/stock-logistics-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_group_by_partner_by_carrier_by_date | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Group delivery orders by partner, carrier and scheduled date. | ||
|
||
.. IMPORTANT:: | ||
This is an alpha version, the data model and design can change at any time without warning. | ||
Only for development or testing purpose, do not use in production. | ||
`More details on development status <https://odoo-community.org/page/development-status>`_ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
See `stock_picking_group_by_partner_by_carrier` configuration. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_group_by_partner_by_carrier_by_date%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 | ||
~~~~~~~ | ||
|
||
* Camptocamp | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Simone Orsi <simahawk@gmail.com> | ||
|
||
* Camptocamp: | ||
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com> | ||
|
||
* Phuc Tran Thanh <phuc@trobz.com> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_group_by_partner_by_carrier_by_date>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
20 changes: 20 additions & 0 deletions
20
stock_picking_group_by_partner_by_carrier_by_date/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2020 Camptocamp | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Stock Picking: group by partner and carrier and scheduled date", | ||
"Summary": """Delivery orders will be matched by date too. | ||
""", | ||
"version": "16.0.1.0.0", | ||
"development_status": "Alpha", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/stock-logistics-workflow", | ||
"category": "Warehouse Management", | ||
# TODO: consider splitting the hook for `_assign_picking` defined in | ||
# `stock_picking_group_by_partner_by_carrier` | ||
# to avoid depending on `stock_picking_group_by_partner_by_carrier`. | ||
"depends": ["partner_tz", "stock_picking_group_by_partner_by_carrier"], | ||
"data": ["views/stock_picking_type.xml"], | ||
"installable": True, | ||
"license": "AGPL-3", | ||
} |
55 changes: 55 additions & 0 deletions
55
stock_picking_group_by_partner_by_carrier_by_date/i18n/it.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_picking_group_by_partner_by_carrier_by_date | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-12-26 14:33+0000\n" | ||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move__display_name | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__display_name | ||
msgid "Display Name" | ||
msgstr "Nome visualizzato" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__group_pickings_by_date | ||
msgid "Group pickings by date" | ||
msgstr "Raggruppa prelievi per data" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move__id | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,help:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__group_pickings_by_date | ||
msgid "If `Group pickings` is enabled they will be grouped by date too." | ||
msgstr "Se `Raggruppa prelievi`è abilitato verranno raggruppati ancheper data." | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move____last_update | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type____last_update | ||
msgid "Last Modified on" | ||
msgstr "Ultima modifica il" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model,name:stock_picking_group_by_partner_by_carrier_by_date.model_stock_picking_type | ||
msgid "Picking Type" | ||
msgstr "Tipologia prelievo" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model,name:stock_picking_group_by_partner_by_carrier_by_date.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "Movimento di magazzino" |
52 changes: 52 additions & 0 deletions
52
..._by_partner_by_carrier_by_date/i18n/stock_picking_group_by_partner_by_carrier_by_date.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_picking_group_by_partner_by_carrier_by_date | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move__display_name | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__group_pickings_by_date | ||
msgid "Group pickings by date" | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move__id | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,help:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type__group_pickings_by_date | ||
msgid "If `Group pickings` is enabled they will be grouped by date too." | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_move____last_update | ||
#: model:ir.model.fields,field_description:stock_picking_group_by_partner_by_carrier_by_date.field_stock_picking_type____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model,name:stock_picking_group_by_partner_by_carrier_by_date.model_stock_picking_type | ||
msgid "Picking Type" | ||
msgstr "" | ||
|
||
#. module: stock_picking_group_by_partner_by_carrier_by_date | ||
#: model:ir.model,name:stock_picking_group_by_partner_by_carrier_by_date.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "" |
2 changes: 2 additions & 0 deletions
2
stock_picking_group_by_partner_by_carrier_by_date/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import stock_move | ||
from . import stock_picking_type |
53 changes: 53 additions & 0 deletions
53
stock_picking_group_by_partner_by_carrier_by_date/models/stock_move.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2020 Camptocamp (https://www.camptocamp.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from datetime import timedelta | ||
|
||
from odoo import models | ||
|
||
from odoo.addons.partner_tz.tools.tz_utils import ( | ||
tz_to_utc_naive_datetime, | ||
utc_to_tz_naive_datetime, | ||
) | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
def _assign_picking_group_domain(self): | ||
domain = super()._assign_picking_group_domain() | ||
by_date_domain = self._assign_picking_group_domain_by_date() | ||
domain.extend(by_date_domain) | ||
return domain | ||
|
||
def _skip_assign_picking_group_domain_by_date(self): | ||
return ( | ||
not self.picking_type_id.group_pickings_by_date | ||
or not self.picking_type_id.group_pickings | ||
or self.group_id.sale_id.picking_policy == "one" | ||
or self.env.context.get("picking_manual_merge") | ||
) | ||
|
||
def _assign_picking_group_domain_by_date(self): | ||
domain = [] | ||
if self._skip_assign_picking_group_domain_by_date(): | ||
return domain | ||
tz = ( | ||
self.warehouse_id.partner_id.tz | ||
or self.env.company.partner_id.tz | ||
or self.env.user.tz | ||
) | ||
date_tz = utc_to_tz_naive_datetime(tz, self.date) | ||
dt_start_tz = date_tz.replace( | ||
hour=0, | ||
minute=0, | ||
second=0, | ||
microsecond=0, | ||
) | ||
dt_start = tz_to_utc_naive_datetime(tz, dt_start_tz) | ||
dt_end = dt_start + timedelta(days=1) | ||
domain = [ | ||
("scheduled_date", "<", dt_end), | ||
("scheduled_date", ">=", dt_start), | ||
] | ||
return domain |
10 changes: 10 additions & 0 deletions
10
stock_picking_group_by_partner_by_carrier_by_date/models/stock_picking_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class StockPickingType(models.Model): | ||
_inherit = "stock.picking.type" | ||
|
||
group_pickings_by_date = fields.Boolean( | ||
"Group pickings by date", | ||
help="If `Group pickings` is enabled they will be grouped by date too.", | ||
) |
6 changes: 6 additions & 0 deletions
6
stock_picking_group_by_partner_by_carrier_by_date/readme/CONTRIBUTORS.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
* Simone Orsi <simahawk@gmail.com> | ||
|
||
* Camptocamp: | ||
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com> | ||
|
||
* Phuc Tran Thanh <phuc@trobz.com> |
3 changes: 3 additions & 0 deletions
3
stock_picking_group_by_partner_by_carrier_by_date/readme/CREDITS.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp |
1 change: 1 addition & 0 deletions
1
stock_picking_group_by_partner_by_carrier_by_date/readme/DESCRIPTION.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Group delivery orders by partner, carrier and scheduled date. |
1 change: 1 addition & 0 deletions
1
stock_picking_group_by_partner_by_carrier_by_date/readme/USAGE.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See `stock_picking_group_by_partner_by_carrier` configuration. |
Binary file added
BIN
+9.23 KB
stock_picking_group_by_partner_by_carrier_by_date/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@tuantrantg Is there a test for timezones ?
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.
@tuantrantg little ping, any news here ?
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.
I'm a little bit busy right now, I will come back soon
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.
hi @rousseldenis the test is added, could you please take a look