Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
70 changes: 70 additions & 0 deletions bees_custom_webshop_button/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/coopiteasy/cie-custom/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/coopiteasy/cie-custom/issues/new?body=module:%20bees_custom_webshop_button%0Aversion:%2012.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
~~~~~~~

* Coop IT Easy SC

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

* `Coop IT Easy SC <https://coopiteasy.be>`_:

* 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 <https://github.com/coopiteasy/cie-custom/tree/12.0/bees_custom_webshop_button>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions bees_custom_webshop_button/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2025 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import models
24 changes: 24 additions & 0 deletions bees_custom_webshop_button/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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",
],
}
5 changes: 5 additions & 0 deletions bees_custom_webshop_button/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2025 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import res_users
30 changes: 30 additions & 0 deletions bees_custom_webshop_button/models/res_users.py
Original file line number Diff line number Diff line change
@@ -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}"
)
3 changes: 3 additions & 0 deletions bees_custom_webshop_button/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Simon Hick
1 change: 1 addition & 0 deletions bees_custom_webshop_button/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a button redirecting to the webshop to Bees' website.
Loading