From 5cc65c2f37e9104c8b9d12529cde37a1b015684d Mon Sep 17 00:00:00 2001 From: Zina Rasoamanana Date: Fri, 23 Jun 2023 15:20:07 +0200 Subject: [PATCH 1/4] add shopinvader_api_address_shipping_note and shopinvader_address_shipping_note --- .../addons/shopinvader_address_shipping_note | 1 + .../setup.py | 6 + .../shopinvader_api_address_shipping_note | 1 + .../setup.py | 6 + shopinvader_address_shipping_note/README.rst | 57 +++ shopinvader_address_shipping_note/__init__.py | 1 + .../__manifest__.py | 19 + .../models/__init__.py | 1 + .../models/res_partner.py | 14 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 1 + .../static/description/index.html | 414 ++++++++++++++++++ .../views/res_partner.xml | 19 + .../README.rst | 57 +++ .../__init__.py | 1 + .../__manifest__.py | 18 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 1 + .../schemas.py | 53 +++ .../static/description/index.html | 414 ++++++++++++++++++ .../tests/__init__.py | 1 + ...t_shopinvader_api_address_shipping_note.py | 146 ++++++ 22 files changed, 1233 insertions(+) create mode 120000 setup/shopinvader_address_shipping_note/odoo/addons/shopinvader_address_shipping_note create mode 100644 setup/shopinvader_address_shipping_note/setup.py create mode 120000 setup/shopinvader_api_address_shipping_note/odoo/addons/shopinvader_api_address_shipping_note create mode 100644 setup/shopinvader_api_address_shipping_note/setup.py create mode 100644 shopinvader_address_shipping_note/README.rst create mode 100644 shopinvader_address_shipping_note/__init__.py create mode 100644 shopinvader_address_shipping_note/__manifest__.py create mode 100644 shopinvader_address_shipping_note/models/__init__.py create mode 100644 shopinvader_address_shipping_note/models/res_partner.py create mode 100644 shopinvader_address_shipping_note/readme/CONTRIBUTORS.rst create mode 100644 shopinvader_address_shipping_note/readme/DESCRIPTION.rst create mode 100644 shopinvader_address_shipping_note/static/description/index.html create mode 100644 shopinvader_address_shipping_note/views/res_partner.xml create mode 100644 shopinvader_api_address_shipping_note/README.rst create mode 100644 shopinvader_api_address_shipping_note/__init__.py create mode 100644 shopinvader_api_address_shipping_note/__manifest__.py create mode 100644 shopinvader_api_address_shipping_note/readme/CONTRIBUTORS.rst create mode 100644 shopinvader_api_address_shipping_note/readme/DESCRIPTION.rst create mode 100644 shopinvader_api_address_shipping_note/schemas.py create mode 100644 shopinvader_api_address_shipping_note/static/description/index.html create mode 100644 shopinvader_api_address_shipping_note/tests/__init__.py create mode 100644 shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py diff --git a/setup/shopinvader_address_shipping_note/odoo/addons/shopinvader_address_shipping_note b/setup/shopinvader_address_shipping_note/odoo/addons/shopinvader_address_shipping_note new file mode 120000 index 0000000000..c645f9df91 --- /dev/null +++ b/setup/shopinvader_address_shipping_note/odoo/addons/shopinvader_address_shipping_note @@ -0,0 +1 @@ +../../../../shopinvader_address_shipping_note \ No newline at end of file diff --git a/setup/shopinvader_address_shipping_note/setup.py b/setup/shopinvader_address_shipping_note/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopinvader_address_shipping_note/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/shopinvader_api_address_shipping_note/odoo/addons/shopinvader_api_address_shipping_note b/setup/shopinvader_api_address_shipping_note/odoo/addons/shopinvader_api_address_shipping_note new file mode 120000 index 0000000000..81c90e4768 --- /dev/null +++ b/setup/shopinvader_api_address_shipping_note/odoo/addons/shopinvader_api_address_shipping_note @@ -0,0 +1 @@ +../../../../shopinvader_api_address_shipping_note \ No newline at end of file diff --git a/setup/shopinvader_api_address_shipping_note/setup.py b/setup/shopinvader_api_address_shipping_note/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopinvader_api_address_shipping_note/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopinvader_address_shipping_note/README.rst b/shopinvader_address_shipping_note/README.rst new file mode 100644 index 0000000000..0338d737f8 --- /dev/null +++ b/shopinvader_address_shipping_note/README.rst @@ -0,0 +1,57 @@ +================================= +Shopinvader Address Shipping Note +================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github + :target: https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_address_shipping_note + :alt: shopinvader/odoo-shopinvader + +|badge1| |badge2| |badge3| + +Adds a field shipping note on res.partner + +**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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Zina Rasoamanana + +Maintainers +~~~~~~~~~~~ + +This module is part of the `shopinvader/odoo-shopinvader `_ project on GitHub. + +You are welcome to contribute. diff --git a/shopinvader_address_shipping_note/__init__.py b/shopinvader_address_shipping_note/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/shopinvader_address_shipping_note/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/shopinvader_address_shipping_note/__manifest__.py b/shopinvader_address_shipping_note/__manifest__.py new file mode 100644 index 0000000000..dd87cc1078 --- /dev/null +++ b/shopinvader_address_shipping_note/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopinvader Address Shipping Note", + "summary": """ + Adds a field shipping note on res.partner""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV", + "website": "https://github.com/shopinvader/odoo-shopinvader", + "depends": [ + "base", + ], + "data": [ + "views/res_partner.xml", + ], + "demo": [], +} diff --git a/shopinvader_address_shipping_note/models/__init__.py b/shopinvader_address_shipping_note/models/__init__.py new file mode 100644 index 0000000000..91fed54d40 --- /dev/null +++ b/shopinvader_address_shipping_note/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/shopinvader_address_shipping_note/models/res_partner.py b/shopinvader_address_shipping_note/models/res_partner.py new file mode 100644 index 0000000000..27e90486b0 --- /dev/null +++ b/shopinvader_address_shipping_note/models/res_partner.py @@ -0,0 +1,14 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResPartner(models.Model): + + _inherit = "res.partner" + + shipping_note = fields.Char( + string="Delivery Note", + help="Instruction for the delivery person in case of absence", + ) diff --git a/shopinvader_address_shipping_note/readme/CONTRIBUTORS.rst b/shopinvader_address_shipping_note/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..3ee6196e83 --- /dev/null +++ b/shopinvader_address_shipping_note/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Zina Rasoamanana diff --git a/shopinvader_address_shipping_note/readme/DESCRIPTION.rst b/shopinvader_address_shipping_note/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..e8fae2dc0c --- /dev/null +++ b/shopinvader_address_shipping_note/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds a field shipping note on res.partner diff --git a/shopinvader_address_shipping_note/static/description/index.html b/shopinvader_address_shipping_note/static/description/index.html new file mode 100644 index 0000000000..a69160714a --- /dev/null +++ b/shopinvader_address_shipping_note/static/description/index.html @@ -0,0 +1,414 @@ + + + + + + +Shopinvader Address Shipping Note + + + +
+

Shopinvader Address Shipping Note

+ + +

Beta License: AGPL-3 shopinvader/odoo-shopinvader

+

Adds a field shipping note on res.partner

+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the shopinvader/odoo-shopinvader project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/shopinvader_address_shipping_note/views/res_partner.xml b/shopinvader_address_shipping_note/views/res_partner.xml new file mode 100644 index 0000000000..50c1135400 --- /dev/null +++ b/shopinvader_address_shipping_note/views/res_partner.xml @@ -0,0 +1,19 @@ + + + + + + res.partner.form (in shopinvader_address_shipping_note) + res.partner + + + + + + + + + diff --git a/shopinvader_api_address_shipping_note/README.rst b/shopinvader_api_address_shipping_note/README.rst new file mode 100644 index 0000000000..9e12f30e9d --- /dev/null +++ b/shopinvader_api_address_shipping_note/README.rst @@ -0,0 +1,57 @@ +===================================== +Shopinvader Api Address Shipping Note +===================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github + :target: https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_api_address_shipping_note + :alt: shopinvader/odoo-shopinvader + +|badge1| |badge2| |badge3| + +Adds a shipping note on schemas of services to manage Shipping Addresses + +**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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Zina Rasoamanana + +Maintainers +~~~~~~~~~~~ + +This module is part of the `shopinvader/odoo-shopinvader `_ project on GitHub. + +You are welcome to contribute. diff --git a/shopinvader_api_address_shipping_note/__init__.py b/shopinvader_api_address_shipping_note/__init__.py new file mode 100644 index 0000000000..a51a83a6f8 --- /dev/null +++ b/shopinvader_api_address_shipping_note/__init__.py @@ -0,0 +1 @@ +from . import schemas diff --git a/shopinvader_api_address_shipping_note/__manifest__.py b/shopinvader_api_address_shipping_note/__manifest__.py new file mode 100644 index 0000000000..e78d6b1d60 --- /dev/null +++ b/shopinvader_api_address_shipping_note/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Shopinvader Api Address Shipping Note", + "summary": """ + Adds a shipping note on schemas of services to manage Shipping Addresses""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV", + "website": "https://github.com/shopinvader/odoo-shopinvader", + "depends": [ + "shopinvader_api_address", + "shopinvader_address_shipping_note", + ], + "data": [], + "demo": [], +} diff --git a/shopinvader_api_address_shipping_note/readme/CONTRIBUTORS.rst b/shopinvader_api_address_shipping_note/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..3ee6196e83 --- /dev/null +++ b/shopinvader_api_address_shipping_note/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Zina Rasoamanana diff --git a/shopinvader_api_address_shipping_note/readme/DESCRIPTION.rst b/shopinvader_api_address_shipping_note/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..b925cd3071 --- /dev/null +++ b/shopinvader_api_address_shipping_note/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds a shipping note on schemas of services to manage Shipping Addresses diff --git a/shopinvader_api_address_shipping_note/schemas.py b/shopinvader_api_address_shipping_note/schemas.py new file mode 100644 index 0000000000..d482616d17 --- /dev/null +++ b/shopinvader_api_address_shipping_note/schemas.py @@ -0,0 +1,53 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.addons.shopinvader_api_address.schemas import ( + ShippingAddressCreate, + ShippingAddressUpdate, +) +from odoo.addons.shopinvader_schema_address.schemas import ShippingAddress + + +class ShippingAddress(ShippingAddress, extends=ShippingAddress): + """ + Shipping Address + """ + + shipping_note: str | None + + @classmethod + def from_res_partner(cls, odoo_rec): + res = super().from_res_partner(odoo_rec) + res.shipping_note = odoo_rec.shipping_note or None + + return res + + +class ShippingAddressCreate(ShippingAddressCreate, extends=ShippingAddressCreate): + """ + Creation of Shipping Address + """ + + shipping_note: str | None + + def to_res_partner_vals(self) -> dict: + vals = super().to_res_partner_vals() + + vals["shipping_note"] = self.shipping_note + + return vals + + +class ShippingAddressUpdate(ShippingAddressUpdate, extends=ShippingAddressUpdate): + """ + Update of Shipping Address + """ + + shipping_note: str | None + + def to_res_partner_vals(self) -> dict: + vals = super().to_res_partner_vals() + + vals["shipping_note"] = self.shipping_note + + return vals diff --git a/shopinvader_api_address_shipping_note/static/description/index.html b/shopinvader_api_address_shipping_note/static/description/index.html new file mode 100644 index 0000000000..0fcedf5cac --- /dev/null +++ b/shopinvader_api_address_shipping_note/static/description/index.html @@ -0,0 +1,414 @@ + + + + + + +Shopinvader Api Address Shipping Note + + + +
+

Shopinvader Api Address Shipping Note

+ + +

Beta License: AGPL-3 shopinvader/odoo-shopinvader

+

Adds a shipping note on schemas of services to manage Shipping Addresses

+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the shopinvader/odoo-shopinvader project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/shopinvader_api_address_shipping_note/tests/__init__.py b/shopinvader_api_address_shipping_note/tests/__init__.py new file mode 100644 index 0000000000..8dcb00a80e --- /dev/null +++ b/shopinvader_api_address_shipping_note/tests/__init__.py @@ -0,0 +1 @@ +from . import test_shopinvader_api_address_shipping_note diff --git a/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py b/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py new file mode 100644 index 0000000000..c0db418ea7 --- /dev/null +++ b/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py @@ -0,0 +1,146 @@ +# Copyright 2023 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import json + +from extendable import context +from fastapi import status +from requests import Response + +from odoo.tests.common import tagged + +from odoo.addons.extendable.registry import _extendable_registries_database +from odoo.addons.fastapi.tests.common import FastAPITransactionCase +from odoo.addons.shopinvader_api_address.routers import address_router + + +@tagged("post_install", "-at_install") +class TestShopinvaderApiAddressShippingNote(FastAPITransactionCase): + @classmethod + def setUpClass(cls) -> None: + super().setUpClass() + extendable_registry = _extendable_registries_database.get(cls.env.cr.dbname) + cls.token = context.extendable_registry.set(extendable_registry) + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + + cls.env["res.users"].create( + { + "name": "Test User", + "login": "test_user", + "groups_id": [ + ( + 6, + 0, + [ + cls.env.ref( + "shopinvader_api_address.shopinvader_address_user_group" + ).id + ], + ) + ], + } + ) + + cls.test_partner = cls.env["res.partner"].create( + { + "name": "FastAPI Shopinvader Address Demo", + "street": "rue test", + "zip": "1410", + "city": "Waterloo", + "country_id": cls.env.ref("base.be").id, + } + ) + + cls.default_fastapi_authenticated_partner = cls.test_partner + cls.default_fastapi_router = address_router + + @classmethod + def tearDownClass(cls) -> None: + context.extendable_registry.reset(cls.token) + super().tearDownClass() + + def test_get_shipping_address(self): + """ + Test to get shipping address of authenticated_partner + """ + + with self._create_test_client(router=address_router) as test_client: + response: Response = test_client.get( + "/addresses/shipping", + ) + + self.assertEqual( + response.status_code, + status.HTTP_200_OK, + msg=f"error message: {response.text}", + ) + + response_json = response.json() + self.assertEqual(0, len(response_json)) + + # add shipping address + new_address = self.env["res.partner"].create( + { + "name": "test New Addr", + "street": "test Street", + "zip": "5000", + "city": "Namur", + "country_id": self.env.ref("base.be").id, + "parent_id": self.test_partner.id, + "type": "delivery", + "shipping_note": "test note", + } + ) + + with self._create_test_client(router=address_router) as test_client: + response: Response = test_client.get( + "/addresses/shipping", + ) + + self.assertEqual( + response.status_code, + status.HTTP_200_OK, + msg=f"error message: {response.text}", + ) + + response_json = response.json() + self.assertTrue(response_json) + + address = response_json[0] + + self.assertEqual(address.get("name"), new_address.name) + self.assertEqual(address.get("street"), new_address.street) + self.assertEqual(address.get("zip"), new_address.zip) + self.assertEqual(address.get("city"), new_address.city) + self.assertEqual(address.get("country_id"), new_address.country_id.id) + self.assertEqual(address.get("id"), new_address.id) + self.assertEqual(address.get("shipping_note"), new_address.shipping_note) + + def test_create_shipping_address(self): + """ + Test to create shipping address + """ + data = { + "name": "test Addr", + "street": "test Street", + "zip": "5000", + "city": "Namur", + "country_id": self.env.ref("base.be").id, + "shipping_note": "test note", + } + + with self._create_test_client(router=address_router) as test_client: + response: Response = test_client.post( + "/addresses/shipping", content=json.dumps(data) + ) + + self.assertEqual( + response.status_code, + status.HTTP_201_CREATED, + msg=f"error message: {response.text}", + ) + response_json = response.json() + self.assertTrue(response_json) + + address = response_json + + self.assertEqual(address.get("shipping_note"), "test note") From 3a595396f06e91870e43a0ad1e60b83e830e3204 Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Tue, 4 Jun 2024 17:28:13 +0200 Subject: [PATCH 2/4] [FIX] fixed used schemas + api address --- shopinvader_api_address_shipping_note/schemas.py | 12 ++++++------ .../test_shopinvader_api_address_shipping_note.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shopinvader_api_address_shipping_note/schemas.py b/shopinvader_api_address_shipping_note/schemas.py index d482616d17..2e08b6c635 100644 --- a/shopinvader_api_address_shipping_note/schemas.py +++ b/shopinvader_api_address_shipping_note/schemas.py @@ -2,13 +2,13 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo.addons.shopinvader_api_address.schemas import ( - ShippingAddressCreate, - ShippingAddressUpdate, + DeliveryAddressCreate, + DeliveryAddressUpdate, ) -from odoo.addons.shopinvader_schema_address.schemas import ShippingAddress +from odoo.addons.shopinvader_schema_address.schemas import DeliveryAddress -class ShippingAddress(ShippingAddress, extends=ShippingAddress): +class ShippingAddressNote(DeliveryAddress, extends=DeliveryAddress): """ Shipping Address """ @@ -23,7 +23,7 @@ def from_res_partner(cls, odoo_rec): return res -class ShippingAddressCreate(ShippingAddressCreate, extends=ShippingAddressCreate): +class ShippingAddressNoteCreate(DeliveryAddressCreate, extends=DeliveryAddressCreate): """ Creation of Shipping Address """ @@ -38,7 +38,7 @@ def to_res_partner_vals(self) -> dict: return vals -class ShippingAddressUpdate(ShippingAddressUpdate, extends=ShippingAddressUpdate): +class ShippingAddressNoteUpdate(DeliveryAddressUpdate, extends=DeliveryAddressUpdate): """ Update of Shipping Address """ diff --git a/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py b/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py index c0db418ea7..2df00a0503 100644 --- a/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py +++ b/shopinvader_api_address_shipping_note/tests/test_shopinvader_api_address_shipping_note.py @@ -65,7 +65,7 @@ def test_get_shipping_address(self): with self._create_test_client(router=address_router) as test_client: response: Response = test_client.get( - "/addresses/shipping", + "/addresses/delivery", ) self.assertEqual( @@ -93,7 +93,7 @@ def test_get_shipping_address(self): with self._create_test_client(router=address_router) as test_client: response: Response = test_client.get( - "/addresses/shipping", + "/addresses/delivery", ) self.assertEqual( @@ -130,7 +130,7 @@ def test_create_shipping_address(self): with self._create_test_client(router=address_router) as test_client: response: Response = test_client.post( - "/addresses/shipping", content=json.dumps(data) + "/addresses/delivery", content=json.dumps(data) ) self.assertEqual( From 6d94f4651f4ce182baf07236e2e7adddbff5e706 Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Wed, 5 Jun 2024 09:55:58 +0200 Subject: [PATCH 3/4] [FIX] set default value for shipping_note to make it optional --- shopinvader_address_shipping_note/README.rst | 9 +++-- .../static/description/index.html | 34 ++++++++++--------- .../README.rst | 9 +++-- .../schemas.py | 12 +++---- .../static/description/index.html | 34 ++++++++++--------- 5 files changed, 54 insertions(+), 44 deletions(-) diff --git a/shopinvader_address_shipping_note/README.rst b/shopinvader_address_shipping_note/README.rst index 0338d737f8..3a78f53a8f 100644 --- a/shopinvader_address_shipping_note/README.rst +++ b/shopinvader_address_shipping_note/README.rst @@ -2,10 +2,13 @@ Shopinvader Address Shipping Note ================================= -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ee046daab60d1b3b9ca2cade67300beeef018ad55570bfc16f3539c485293eb7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -17,7 +20,7 @@ Shopinvader Address Shipping Note :target: https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_address_shipping_note :alt: shopinvader/odoo-shopinvader -|badge1| |badge2| |badge3| +|badge1| |badge2| |badge3| Adds a field shipping note on res.partner @@ -31,7 +34,7 @@ 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 +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/shopinvader_address_shipping_note/static/description/index.html b/shopinvader_address_shipping_note/static/description/index.html index a69160714a..b333666701 100644 --- a/shopinvader_address_shipping_note/static/description/index.html +++ b/shopinvader_address_shipping_note/static/description/index.html @@ -1,20 +1,20 @@ - + - + Shopinvader Address Shipping Note