Skip to content

Commit

Permalink
[ADD] delivery_state_manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisho99 committed Jan 2, 2025
1 parent 8021362 commit cade345
Show file tree
Hide file tree
Showing 17 changed files with 816 additions and 0 deletions.
114 changes: 114 additions & 0 deletions delivery_state_manual/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
=====================
Delivery State Manual
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8fb487db32e26e5e5f56b5d1fa7e7d45e0b9f3001e1f0f5f8d14c7786f718f08
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OCA%2Fdelivery--carrier-lightgray.png?logo=github
:target: https://github.com/OCA/delivery-carrier/tree/16.0/delivery_state_manual
:alt: OCA/delivery-carrier
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-0-delivery_state_manual
: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/delivery-carrier&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of delivery_state to allow you to
manually edit the delivery state of pickings with specific delivery
carriers

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to Inventory / Configuration / Shipping Methods and open the
desired method to be manual.
2. Mark the "Manual" field

Usage
=====

To use this module, you need to:

1. Go to Inventory / Operations and open or create an outgoing pending
picking.
2. In the Additional Info tab, assign it a delivery carrier which is
manual.
3. Validate the picking and you’ll see in the same tab the delivery
state info with the shipping date and the shipping state.
4. You will be able to edit the delivery_state field. If you set the
field to "Customer delivered" or "Shipping recorded in carrier", the
"Delivery Date" field will be automatically set.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/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/delivery-carrier/issues/new?body=module:%20delivery_state_manual%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
-------

* Sygel

Contributors
------------

- `Sygel <https://www.sygel.es>`__:

- Alberto Martínez
- Jaime Ruiz Maccione
- Valentin Vinagre

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.

.. |maintainer-tisho99| image:: https://github.com/tisho99.png?size=40px
:target: https://github.com/tisho99
:alt: tisho99

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-tisho99|

This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/16.0/delivery_state_manual>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions delivery_state_manual/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions delivery_state_manual/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Delivery State Manual",
"summary": "Manually edit the delivery state of pickings",
"version": "16.0.1.0.0",
"category": "Delivery",
"website": "https://github.com/OCA/delivery-carrier",
"author": "Sygel, Odoo Community Association (OCA)",
"maintainers": ["tisho99"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"delivery_state",
],
"data": [
"views/delivery_carrier_views.xml",
"views/stock_picking_views.xml",
],
}
4 changes: 4 additions & 0 deletions delivery_state_manual/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import delivery_carrier
from . import stock_picking
10 changes: 10 additions & 0 deletions delivery_state_manual/models/delivery_carrier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class DeliveryCarrier(models.Model):
_inherit = "delivery.carrier"

delivery_state_manual = fields.Boolean(string="Manual Delivery State")
25 changes: 25 additions & 0 deletions delivery_state_manual/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import datetime

from odoo import api, fields, models


class StockPicking(models.Model):
_inherit = "stock.picking"

delivery_state = fields.Selection(
readonly=False,
)
delivery_state_manual = fields.Boolean(related="carrier_id.delivery_state_manual")

@api.onchange("delivery_state")
def _onchange_delivery_state(self):
for rec in self.filtered("delivery_state_manual"):
rec.date_delivered = (

Check warning on line 20 in delivery_state_manual/models/stock_picking.py

View check run for this annotation

Codecov / codecov/patch

delivery_state_manual/models/stock_picking.py#L20

Added line #L20 was not covered by tests
datetime.datetime.now()
if rec.delivery_state
in ["customer_delivered", "shipping_recorded_in_carrier"]
else False
)
4 changes: 4 additions & 0 deletions delivery_state_manual/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To configure this module, you need to:

1. Go to Inventory / Configuration / Shipping Methods and open the desired method to be manual.
2. Mark the "Manual" field
4 changes: 4 additions & 0 deletions delivery_state_manual/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Sygel](https://www.sygel.es):
- Alberto Martínez
- Jaime Ruiz Maccione
- Valentin Vinagre
1 change: 1 addition & 0 deletions delivery_state_manual/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module extends the functionality of delivery_state to allow you to manually edit the delivery state of pickings with specific delivery carriers
6 changes: 6 additions & 0 deletions delivery_state_manual/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:

1. Go to Inventory / Operations and open or create an outgoing pending picking.
2. In the Additional Info tab, assign it a delivery carrier which is manual.
3. Validate the picking and you’ll see in the same tab the delivery state info with the shipping date and the shipping state.
4. You will be able to edit the delivery_state field. If you set the field to "Customer delivered" or "Shipping recorded in carrier", the "Delivery Date" field will be automatically set.
Binary file added delivery_state_manual/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.
79 changes: 79 additions & 0 deletions delivery_state_manual/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cade345

Please sign in to comment.