Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions sale_order_week_day/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Sale Order Day of Week
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:62241057d7b23cb1e6849a9079e04c6705e61a842c418a24dc5919de41c18cc9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fsale--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/sale-reporting/tree/14.0/sale_order_week_day
:alt: OCA/sale-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-reporting-14-0/sale-reporting-14-0-sale_order_week_day
: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/sale-reporting&target_branch=14.0
:alt: Try me on Runboat

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

This module adds the week day to the sale order and allows to filter/group by such field.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-reporting/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/sale-reporting/issues/new?body=module:%20sale_order_week_day%0Aversion:%2014.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
~~~~~~~

* PyTech

Contributors
~~~~~~~~~~~~

* `PyTech <https://www.pytech.it>`_:

* Simone Rubino <simone.rubino@pytech.it>

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-SirPyTech| image:: https://github.com/SirPyTech.png?size=40px
:target: https://github.com/SirPyTech
:alt: SirPyTech

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

|maintainer-SirPyTech|

This module is part of the `OCA/sale-reporting <https://github.com/OCA/sale-reporting/tree/14.0/sale_order_week_day>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions sale_order_week_day/__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 models
from .hooks import pre_init_hook
22 changes: 22 additions & 0 deletions sale_order_week_day/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2026 Simone Rubino - PyTech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Order Day of Week",
"summary": "Filter/group Sale Orders by Day of Week",
"version": "14.0.1.0.0",
"author": "PyTech, Odoo Community Association (OCA)",
"maintainers": [
"SirPyTech",
],
"website": "https://github.com/OCA/sale-reporting",
"license": "AGPL-3",
"depends": [
"base_week_day",
"sale",
],
"data": [
"views/sale_order_views.xml",
],
"pre_init_hook": "pre_init_hook",
}
24 changes: 24 additions & 0 deletions sale_order_week_day/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2026 Simone Rubino - PyTech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api

from odoo.addons.base_week_day.hooks import populate_date_order_week_day


def pre_init_hook(cr):
env = api.Environment(cr, SUPERUSER_ID, {})
populate_date_order_week_day(
env,
"sale_order_week_day",
"sale.order",
"date_order_week_day",
"date_order",
)
populate_date_order_week_day(
env,
"sale_order_week_day",
"sale.order",
"create_date_week_day",
"create_date",
)
3 changes: 3 additions & 0 deletions sale_order_week_day/models/__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 sale_order
41 changes: 41 additions & 0 deletions sale_order_week_day/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2026 Simone Rubino - PyTech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models

from odoo.addons.base_week_day.models.mixin import WEEKDAYS


class SaleOrder(models.Model):
_inherit = [
"base_week_day.mixin",
"sale.order",
]
_name = "sale.order"

create_date_week_day = fields.Selection(
selection=WEEKDAYS,
compute="_compute_create_date_week_day",
store=True,
string="Creation Day of Week",
)
date_order_week_day = fields.Selection(
selection=WEEKDAYS,
compute="_compute_date_order_week_day",
store=True,
string="Order Day of Week",
)

@api.depends(
"create_date",
)
def _compute_create_date_week_day(self):
for order in self:
order.create_date_week_day = order._get_week_day(order.create_date)

@api.depends(
"date_order",
)
def _compute_date_order_week_day(self):
for order in self:
order.date_order_week_day = order._get_week_day(order.date_order)
3 changes: 3 additions & 0 deletions sale_order_week_day/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `PyTech <https://www.pytech.it>`_:

* Simone Rubino <simone.rubino@pytech.it>
1 change: 1 addition & 0 deletions sale_order_week_day/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds the week day to the sale order and allows to filter/group by such field.
Loading
Loading