diff --git a/bees_custom_webshop_button/README.rst b/bees_custom_webshop_button/README.rst new file mode 100644 index 00000000..bde1387d --- /dev/null +++ b/bees_custom_webshop_button/README.rst @@ -0,0 +1,70 @@ +========================== +Bees Custom Webshop Button +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:167da42127d186f84a5fcaff01997aead3e7f953f0efb16f74a6e38d0341638a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-coopiteasy%2Fcie--custom-lightgray.png?logo=github + :target: https://github.com/coopiteasy/cie-custom/tree/12.0/bees_custom_webshop_button + :alt: coopiteasy/cie-custom + +|badge1| |badge2| |badge3| + +Add a button redirecting to the webshop to Bees' website. + +**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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Coop IT Easy SC + +Contributors +~~~~~~~~~~~~ + +* `Coop IT Easy SC `_: + + * Simon Hick + +Maintainers +~~~~~~~~~~~ + +.. |maintainer-mihien| image:: https://github.com/mihien.png?size=40px + :target: https://github.com/mihien + :alt: mihien + +Current maintainer: + +|maintainer-mihien| + +This module is part of the `coopiteasy/cie-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/bees_custom_webshop_button/__init__.py b/bees_custom_webshop_button/__init__.py new file mode 100644 index 00000000..a6c9053e --- /dev/null +++ b/bees_custom_webshop_button/__init__.py @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from . import models diff --git a/bees_custom_webshop_button/__manifest__.py b/bees_custom_webshop_button/__manifest__.py new file mode 100644 index 00000000..fde84288 --- /dev/null +++ b/bees_custom_webshop_button/__manifest__.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +{ + "name": "Bees Custom Webshop Button", + "summary": "Add a button in Bees' website redirecting to the webshop", + "version": "12.0.1.0.0", + "category": "Uncategorized", + "website": "https://coopiteasy.be", + "author": "Coop IT Easy SC", + "maintainers": ["mihien"], + "license": "AGPL-3", + "depends": [ + "beesdoo_website_theme", + "cooperator", + "partner_firstname", + "website", + ], + "data": [ + "views/assets.xml", + "views/website_templates.xml", + ], +} diff --git a/bees_custom_webshop_button/models/__init__.py b/bees_custom_webshop_button/models/__init__.py new file mode 100644 index 00000000..f6872566 --- /dev/null +++ b/bees_custom_webshop_button/models/__init__.py @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from . import res_users diff --git a/bees_custom_webshop_button/models/res_users.py b/bees_custom_webshop_button/models/res_users.py new file mode 100644 index 00000000..68e1ae71 --- /dev/null +++ b/bees_custom_webshop_button/models/res_users.py @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: 2025 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from odoo import fields, models + + +class Users(models.Model): + _inherit = "res.users" + + webshop_url = fields.Char( + compute="_compute_webshop_url", + help="The URL of the webshop for this user.", + ) + + def _compute_webshop_url(self): + for user in self: + partner = user.partner_id + email = partner.email + coop_number = partner.cooperator_register_number + first_name = partner.firstname or "" + last_name = partner.lastname or "" + if not email or not coop_number: + user.webshop_url = False + else: + user.webshop_url = ( + f"https://webshop.bees-coop.be/?email={email}" + f"&coop={coop_number}&FirstName={first_name}" + f"&LastName={last_name}" + ) diff --git a/bees_custom_webshop_button/readme/CONTRIBUTORS.rst b/bees_custom_webshop_button/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..ce2a5248 --- /dev/null +++ b/bees_custom_webshop_button/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Coop IT Easy SC `_: + + * Simon Hick diff --git a/bees_custom_webshop_button/readme/DESCRIPTION.rst b/bees_custom_webshop_button/readme/DESCRIPTION.rst new file mode 100644 index 00000000..0642b2a1 --- /dev/null +++ b/bees_custom_webshop_button/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Add a button redirecting to the webshop to Bees' website. diff --git a/bees_custom_webshop_button/static/description/index.html b/bees_custom_webshop_button/static/description/index.html new file mode 100644 index 00000000..1db86bbd --- /dev/null +++ b/bees_custom_webshop_button/static/description/index.html @@ -0,0 +1,421 @@ + + + + + +Bees Custom Webshop Button + + + +
+

Bees Custom Webshop Button

+ + +

Beta License: AGPL-3 coopiteasy/cie-custom

+

Add a button redirecting to the webshop to Bees’ website.

+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Coop IT Easy SC
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

Current maintainer:

+

mihien

+

This module is part of the coopiteasy/cie-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/bees_custom_webshop_button/static/src/css/website_shopbutton.css b/bees_custom_webshop_button/static/src/css/website_shopbutton.css new file mode 100644 index 00000000..43c9ddb2 --- /dev/null +++ b/bees_custom_webshop_button/static/src/css/website_shopbutton.css @@ -0,0 +1,11 @@ +/* +SPDX-FileCopyrightText: 2025 Coop IT Easy SC + +SPDX-License-Identifier: AGPL-3.0-or-later +*/ + +.navbar-nav .nav-link.website-shopbutton { + background: #fcc101; + border-radius: 6px; + color: rgba(0, 0, 0, 0.9); +} diff --git a/bees_custom_webshop_button/views/assets.xml b/bees_custom_webshop_button/views/assets.xml new file mode 100644 index 00000000..0009cf7d --- /dev/null +++ b/bees_custom_webshop_button/views/assets.xml @@ -0,0 +1,20 @@ + + + + + diff --git a/bees_custom_webshop_button/views/website_templates.xml b/bees_custom_webshop_button/views/website_templates.xml new file mode 100644 index 00000000..73619e07 --- /dev/null +++ b/bees_custom_webshop_button/views/website_templates.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/setup/bees_custom_webshop_button/odoo/addons/bees_custom_webshop_button b/setup/bees_custom_webshop_button/odoo/addons/bees_custom_webshop_button new file mode 120000 index 00000000..463981c0 --- /dev/null +++ b/setup/bees_custom_webshop_button/odoo/addons/bees_custom_webshop_button @@ -0,0 +1 @@ +../../../../bees_custom_webshop_button \ No newline at end of file diff --git a/setup/bees_custom_webshop_button/setup.py b/setup/bees_custom_webshop_button/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/bees_custom_webshop_button/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt index ef6c9659..a539dcd3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -27,6 +27,7 @@ git+https://github.com/beescoop/obeesdoo@12.0#subdirectory=setup/beesdoo_product git+https://github.com/beescoop/obeesdoo@12.0#subdirectory=setup/pos_shift_partner_can_shop git+https://github.com/beescoop/obeesdoo@12.0#subdirectory=setup/shift_worker_status git+https://github.com/beescoop/obeesdoo@12.0#subdirectory=setup/shift +git+https://github.com/beescoop/obeesdoo@12.0#subdirectory=setup/beesdoo_website_theme git+https://github.com/coopiteasy/addons@12.0#subdirectory=setup/sale_order_volume git+https://github.com/coopiteasy/addons@12.0#subdirectory=setup/company_supplier_context git+https://github.com/coopiteasy/addons@12.0#subdirectory=setup/account_customer_wallet