From cbba046461a2609705ced0eb2b7a76d05ab67f39 Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Tue, 20 Feb 2024 16:51:23 +0800 Subject: [PATCH] [ADD] sale_order_get_due_date --- sale_order_delivery_date/__manifest__.py | 2 +- sale_order_delivery_date/models/sale_order.py | 4 - sale_order_get_due_date/README.rst | 52 +++ sale_order_get_due_date/__init__.py | 1 + sale_order_get_due_date/__manifest__.py | 12 + sale_order_get_due_date/models/__init__.py | 1 + .../models/sale_order.py | 2 +- .../readme/DESCRIPTION.rst | 1 + .../static/description/index.html | 407 ++++++++++++++++++ .../odoo/addons/sale_order_get_due_date | 1 + setup/sale_order_get_due_date/setup.py | 6 + .../__manifest__.py | 2 +- .../models/__init__.py | 1 - 13 files changed, 484 insertions(+), 8 deletions(-) create mode 100644 sale_order_get_due_date/README.rst create mode 100644 sale_order_get_due_date/__init__.py create mode 100644 sale_order_get_due_date/__manifest__.py create mode 100644 sale_order_get_due_date/models/__init__.py rename {stock_picking_delivery_due_date => sale_order_get_due_date}/models/sale_order.py (88%) create mode 100644 sale_order_get_due_date/readme/DESCRIPTION.rst create mode 100644 sale_order_get_due_date/static/description/index.html create mode 120000 setup/sale_order_get_due_date/odoo/addons/sale_order_get_due_date create mode 100644 setup/sale_order_get_due_date/setup.py diff --git a/sale_order_delivery_date/__manifest__.py b/sale_order_delivery_date/__manifest__.py index 09bfccf3..74ffb8db 100644 --- a/sale_order_delivery_date/__manifest__.py +++ b/sale_order_delivery_date/__manifest__.py @@ -7,7 +7,7 @@ "website": "https://www.quartile.co", "category": "Sale", "license": "LGPL-3", - "depends": ["sale_stock"], + "depends": ["sale_stock", "sale_order_get_due_date"], "data": ["views/sale_order_views.xml", "views/stock_picking_views.xml"], "installable": True, } diff --git a/sale_order_delivery_date/models/sale_order.py b/sale_order_delivery_date/models/sale_order.py index d65b4dc1..03fb3c9c 100644 --- a/sale_order_delivery_date/models/sale_order.py +++ b/sale_order_delivery_date/models/sale_order.py @@ -15,7 +15,3 @@ class SaleOrder(models.Model): default=fields.Date.context_today, help="The input date will be passed over to the delivery as Scheduled Date.", ) - - def _get_due_date(self): - self.ensure_one() - return self.commitment_date or self.expected_date diff --git a/sale_order_get_due_date/README.rst b/sale_order_get_due_date/README.rst new file mode 100644 index 00000000..34a9637b --- /dev/null +++ b/sale_order_get_due_date/README.rst @@ -0,0 +1,52 @@ +======================= +Sale Order Get Due Date +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-qrtl%2Fhls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/hls-custom/tree/12.0/sale_order_get_due_date + :alt: qrtl/hls-custom + +|badge1| |badge2| |badge3| + +This module adds the functionality to obtain the due date of a sale order. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Quartile Limited + +Maintainers +~~~~~~~~~~~ + +This module is part of the `qrtl/hls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/sale_order_get_due_date/__init__.py b/sale_order_get_due_date/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/sale_order_get_due_date/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_order_get_due_date/__manifest__.py b/sale_order_get_due_date/__manifest__.py new file mode 100644 index 00000000..1b49bbb3 --- /dev/null +++ b/sale_order_get_due_date/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2024 Quartile Limited +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Sale Order Get Due Date", + "version": "12.0.1.0.1", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "category": "Sale", + "license": "AGPL-3", + "depends": ["sale_stock"], + "installable": True, +} diff --git a/sale_order_get_due_date/models/__init__.py b/sale_order_get_due_date/models/__init__.py new file mode 100644 index 00000000..6aacb753 --- /dev/null +++ b/sale_order_get_due_date/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/stock_picking_delivery_due_date/models/sale_order.py b/sale_order_get_due_date/models/sale_order.py similarity index 88% rename from stock_picking_delivery_due_date/models/sale_order.py rename to sale_order_get_due_date/models/sale_order.py index 5d820ebb..54200755 100644 --- a/stock_picking_delivery_due_date/models/sale_order.py +++ b/sale_order_get_due_date/models/sale_order.py @@ -1,4 +1,4 @@ -# Copyright 2019 Quartile Limited +# Copyright 2024 Quartile Limited # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models diff --git a/sale_order_get_due_date/readme/DESCRIPTION.rst b/sale_order_get_due_date/readme/DESCRIPTION.rst new file mode 100644 index 00000000..1b7d75a8 --- /dev/null +++ b/sale_order_get_due_date/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds the functionality to obtain the due date of a sale order. diff --git a/sale_order_get_due_date/static/description/index.html b/sale_order_get_due_date/static/description/index.html new file mode 100644 index 00000000..b8e11f12 --- /dev/null +++ b/sale_order_get_due_date/static/description/index.html @@ -0,0 +1,407 @@ + + + + + + +Sale Order Get Due Date + + + +
+

Sale Order Get Due Date

+ + +

Beta License: AGPL-3 qrtl/hls-custom

+

This module adds the functionality to obtain the due date of a sale order.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile Limited
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/hls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/sale_order_get_due_date/odoo/addons/sale_order_get_due_date b/setup/sale_order_get_due_date/odoo/addons/sale_order_get_due_date new file mode 120000 index 00000000..ca87c2c1 --- /dev/null +++ b/setup/sale_order_get_due_date/odoo/addons/sale_order_get_due_date @@ -0,0 +1 @@ +../../../../sale_order_get_due_date \ No newline at end of file diff --git a/setup/sale_order_get_due_date/setup.py b/setup/sale_order_get_due_date/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/sale_order_get_due_date/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_picking_delivery_due_date/__manifest__.py b/stock_picking_delivery_due_date/__manifest__.py index bfdced43..d6c62bd8 100644 --- a/stock_picking_delivery_due_date/__manifest__.py +++ b/stock_picking_delivery_due_date/__manifest__.py @@ -7,7 +7,7 @@ "website": "https://www.quartile.co", "category": "Stock", "license": "AGPL-3", - "depends": ["sale_stock"], + "depends": ["sale_stock", "sale_order_get_due_date"], "data": ["views/res_partner_views.xml", "views/stock_picking_views.xml"], "installable": True, } diff --git a/stock_picking_delivery_due_date/models/__init__.py b/stock_picking_delivery_due_date/models/__init__.py index b21e68b7..4287eda4 100644 --- a/stock_picking_delivery_due_date/models/__init__.py +++ b/stock_picking_delivery_due_date/models/__init__.py @@ -1,5 +1,4 @@ from . import res_partner -from . import sale_order from . import sale_order_line from . import stock_picking from . import stock_move