Browse Source

Jan 08: [ADD] Initial Commit 'pos_customer_birthday_discount'

pull/298/merge
Shijin V 1 year ago
parent
commit
78c2e9df76
  1. 46
      pos_customer_birthday_discount/README.rst
  2. 20
      pos_customer_birthday_discount/__init__.py
  3. 46
      pos_customer_birthday_discount/__manifest__.py
  4. 6
      pos_customer_birthday_discount/doc/RELEASE_NOTES.md
  5. 21
      pos_customer_birthday_discount/models/__init__.py
  6. 66
      pos_customer_birthday_discount/models/pos_config.py
  7. 28
      pos_customer_birthday_discount/models/res_partner.py
  8. BIN
      pos_customer_birthday_discount/static/description/banner.png
  9. BIN
      pos_customer_birthday_discount/static/description/icon.png
  10. BIN
      pos_customer_birthday_discount/static/description/images/1.png
  11. BIN
      pos_customer_birthday_discount/static/description/images/2.png
  12. BIN
      pos_customer_birthday_discount/static/description/images/3.png
  13. BIN
      pos_customer_birthday_discount/static/description/images/4.png
  14. BIN
      pos_customer_birthday_discount/static/description/images/5.png
  15. BIN
      pos_customer_birthday_discount/static/description/images/6.png
  16. BIN
      pos_customer_birthday_discount/static/description/images/checked.png
  17. BIN
      pos_customer_birthday_discount/static/description/images/cybrosys.png
  18. BIN
      pos_customer_birthday_discount/static/description/images/hero.gif
  19. BIN
      pos_customer_birthday_discount/static/description/images/image_1.png
  20. BIN
      pos_customer_birthday_discount/static/description/images/image_2.png
  21. BIN
      pos_customer_birthday_discount/static/description/images/image_3.png
  22. BIN
      pos_customer_birthday_discount/static/description/images/image_4.png
  23. BIN
      pos_customer_birthday_discount/static/description/images/image_5.png
  24. 655
      pos_customer_birthday_discount/static/description/index.html
  25. 46
      pos_customer_birthday_discount/static/src/js/PaymentScreen.js
  26. 66
      pos_customer_birthday_discount/static/src/js/ProductScreenInherit.js
  27. 40
      pos_customer_birthday_discount/static/src/js/birthday_discount.js
  28. 38
      pos_customer_birthday_discount/static/src/js/models.js
  29. 12
      pos_customer_birthday_discount/static/src/xml/ActionpadWidgetInherit.xml
  30. 51
      pos_customer_birthday_discount/static/src/xml/OrderlineInherit.xml
  31. 11
      pos_customer_birthday_discount/views/assets.xml
  32. 43
      pos_customer_birthday_discount/views/pos_config_views.xml
  33. 17
      pos_customer_birthday_discount/views/res_partner_views.xml

46
pos_customer_birthday_discount/README.rst

@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
POS Birthday Discount
======================
This module aims in providing special discount for customers in POS on their respective birthdate.
Configuration
=============
No additional configuration required
Company
=======
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
License
=======
GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3)
(https://www.gnu.org/licenses/agpl-3.0-standalone.html)
Credits
=======
* Developer: (V14) RAHUL C K, Contact: odoo@cybrosys.com
Contacts
========
* Mail Contact : odoo@cybrosys.com
* Website : https://cybrosys.com
Bug Tracker
===========
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
----------
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.
Further information
===================
HTML Description: `<static/description/index.html>`__

20
pos_customer_birthday_discount/__init__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2023-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Rahul CK(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU AFFERO GENERAL
# PUBLIC LICENSE (AGPL v3), Version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC
# LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import models

46
pos_customer_birthday_discount/__manifest__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2023-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Rahul CK(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU AFFERO GENERAL
# PUBLIC LICENSE (AGPL v3), Version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC
# LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "POS Birthday Discount",
'version': '14.0.1.0.0',
'category': 'Point of Sale',
'summary': """Extra discount on customer birthday""",
'description': """Customers get extra discount for their orders in POS
in odoo on the month of their birth date.""",
'author': "Cybrosys Techno Solutions",
'company': "Cybrosys Techno Solutions",
'maintainer': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'depends': ['base', 'point_of_sale'],
'data': [
'views/res_partner_views.xml',
'views/pos_config_views.xml',
'views/assets.xml'
],
'qweb': [
'static/src/xml/ActionpadWidgetInherit.xml',
'static/src/xml/OrderlineInherit.xml'
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

6
pos_customer_birthday_discount/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <pos_customer_birthday_discount>
#### 08.01.2024
#### Version 14.0.1.0.0
#### ADD
- Initial commit for POS Birthday Discount

21
pos_customer_birthday_discount/models/__init__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2023-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Rahul CK(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU AFFERO GENERAL
# PUBLIC LICENSE (AGPL v3), Version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC
# LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import pos_config
from . import res_partner

66
pos_customer_birthday_discount/models/pos_config.py

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2023-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Rahul CK(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU AFFERO GENERAL
# PUBLIC LICENSE (AGPL v3), Version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC
# LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import api, fields, models
class PosConfig(models.Model):
"""Set the Birthday discount fields in pos_config model"""
_inherit = 'pos.config'
birthday_discount = fields.Boolean(string="Birthday Discount",
help="Enable this field to activate "
"birthday discount")
discount = fields.Float(string="Discount", help="Percentage of birthday "
"discount")
first_order = fields.Boolean(string="Only Apply the discount on the "
"first order on Birthday",
help="Restrict discount to apply only on "
"first order on birthday")
@api.model
def check_birthday(self, args):
"""Check the birthday of selected partner"""
data = {}
for rec in self.search([]):
partner_id = self.env['res.partner'].browse(args)
today = fields.Date.today()
if rec.birthday_discount and partner_id.birthdate:
if (partner_id.birthdate.day == today.day and
partner_id.birthdate.month == today.month):
data = {'birthday': 'True'}
break
return data
@api.model
def check_pos_order(self, args):
"""Check if any other pos order is created by partner on birthday"""
data = {'order': 'False'}
today = fields.Date.today()
partner_id = self.env['res.partner'].browse(args[0])
if partner_id.birthdate:
if (partner_id.birthdate.day == today.day and
partner_id.birthdate.month == today.month):
data['birthday'] = 'True'
if args[1]:
orders = self.env['pos.order'].search(
[('partner_id', '=', args[0])]).filtered(
lambda r: r.date_order.date() == today)
data['order'] = 'True' if len(orders) > 0 else 'False'
return data

28
pos_customer_birthday_discount/models/res_partner.py

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2023-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Rahul CK(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU AFFERO GENERAL
# PUBLIC LICENSE (AGPL v3), Version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC
# LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import fields, models
class ResPartner(models.Model):
"""New field birthdate is added in res_partner"""
_inherit = 'res.partner'
birthdate = fields.Date(string="Birth Date",
help="Birthdate of the partner")

BIN
pos_customer_birthday_discount/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
pos_customer_birthday_discount/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
pos_customer_birthday_discount/static/description/images/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_customer_birthday_discount/static/description/images/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_customer_birthday_discount/static/description/images/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_customer_birthday_discount/static/description/images/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_customer_birthday_discount/static/description/images/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
pos_customer_birthday_discount/static/description/images/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_customer_birthday_discount/static/description/images/checked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
pos_customer_birthday_discount/static/description/images/cybrosys.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
pos_customer_birthday_discount/static/description/images/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

BIN
pos_customer_birthday_discount/static/description/images/image_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
pos_customer_birthday_discount/static/description/images/image_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
pos_customer_birthday_discount/static/description/images/image_3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
pos_customer_birthday_discount/static/description/images/image_4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
pos_customer_birthday_discount/static/description/images/image_5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

655
pos_customer_birthday_discount/static/description/index.html

@ -0,0 +1,655 @@
<div class="container"
style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom: 1px solid #d5d5d5;">
<div class="my-3">
<img src="images/cybrosys.png"
style="width: auto !important; height: 40px !important;">
</div>
<div class="my-3 d-flex align-items-center">
<div style="background-color: #7C7BAD !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Community
</div>
<div style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
</div>
</div>
</div>
</div>
<div class="row"
style="margin:75px 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4; padding-bottom: 30px;">
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
<div style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">
POS Birthday Discount</h1>
<h3 style="font-size: 21px;margin-top: 8px;position: relative;">
Special discount on customer birthday</h3>
</div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key
Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i> Special discount for
products in POS on customer birthday.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i> Birthday greetings
will be shown near customer name.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>Can be configured in
settings if the discount should be applied only for first order
of customer on birthday
</li>
</ul>
</div>
<div class="col-lg-5 d-flex align-items-center"
style="border-radius: 0px 10px 10px 0px; background-repeat: no-repeat; background-size: cover;">
<img src='images/hero.gif'
style="width:90%; height: auto; margin: 0 auto;"/>
</div>
</div>
<div>
<section class="oe_container"
style="padding: 1rem 0rem 1rem; background-color: #ffffff !important;">
<div class="row py-4 px-3">
<div class="w-100"
style="padding-top:30px;padding-bottom:45px;border-radius: 10px;">
<ul role="tablist" class="nav nav-pills justify-content-center"
data-tabs="tabs" id="pills-tab"
style="border: none;background: unset;">
<li class="nav-item mr-1 mb-3"
style="font-size: 1.05rem;font-weight: 400;transition: all .15s ease;color: #d31c22;background-color: #d31c22;box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);border: 0;font-family: 'Open Sans',sans-serif;width: 140px;border-radius: 0.30rem;">
<a id="pills-home-tab" data-toggle="pill"
href="#pills-home" role="tab"
aria-controls="pills-home" aria-selected="true"
class="nav-link active show" style="color: #000000;line-height: 33px;border: 0;border-radius: .25rem;font-weight: 400;text-align: center;
color: #fff;">Overview </a></li>
<li class="nav-item mr-1 mb-3"
style="font-size: 1.05rem;font-weight: 400;transition: all .15s ease;color: #d31c22;background-color: #d31c22;box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);border: 0;font-family: 'Open Sans',sans-serif;width: 140px;border-radius: 0.30rem;">
<a data-toggle="pill" href="#pills-home1" role="tab"
aria-controls="pills-home" aria-selected="true"
class="nav-link " style="color: #000000;line-height: 33px;border: 0;border-radius: .25rem;font-weight: 400; text-align: center;
color: #fff;">Features </a></li>
<li class="nav-item mr-1 mb-3"
style="font-size: 1.05rem;font-weight: 400;transition: all .15s ease;color: #ffffff;background-color: #d31c22;box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);border: 0;font-family: 'Open Sans',sans-serif;width: 140px;border-radius: 0.30rem;">
<a class="nav-link" id="pills-profile-tab"
data-toggle="pill" href="#pills-profile" role="tab"
aria-controls="pills-profile" aria-selected="false"
style="color: #000000;line-height: 33px;border: 0;border-radius: .25rem;font-weight: 400; text-align: center;
color: #fff;">Screenshots </a></li>
</ul>
<div class="tab-content" id="pills-tabContent"
style="padding-top: 30px; padding-bottom: 30px; padding: 30px;">
<div class="px-3 pt-1 tab-pane fade active show"
id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">
<!-- Overview-->
<h2 style="font-weight: 600;text-align: center;width: 100%;">
Overview</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<h3 class="oe_slogan"
style="text-align: center;font-size: 19px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 31px;font-weight: 400;letter-spacing: .5px;margin-bottom: 21px;">
This module aims in providing special discount for
customers in POS on their respective birthdate.
</h3>
</div>
<div class="px-3 pt-1 tab-pane fade " id="pills-home1"
role="tabpanel" aria-labelledby="pills-home-tab">
<!-- feature tab-->
<h2 style="font-weight: 600;text-align: center;width: 100%;">
POS Birthday Discount</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<ul>
<li class="mb8"
style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>Discount
will be automatically applied to products while
creating pos order.
</li>
<li class="mb8"
style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>
Discount Percentage can be set in POS settings.
</li>
<li class="mb8"
style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i> New
field 'Birth Date' is added in customer form.
</li>
</ul>
</div>
<!-- Screenshot tab-->
<div class="px-3 tab-pane fade" id="pills-profile"
role="tabpanel" aria-labelledby="pills-profile-tab">
<div class="tab-pane">
<h2 style="font-weight: 600;text-align: center;width: 100%;">
Screenshots</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<div>
<section class="oe_container">
<div id="demo"
class="row carousel slide mb32"
data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active"
style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16"
style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>
Point of Sale </h3>
<div style=""><img
class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/image_1.png">
</div>
</div>
</div>
<div class="carousel-item"
style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16"
style="float: left;">
<div style=""><img
class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/image_2.png">
</div>
</div>
</div>
<div class="carousel-item"
style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16"
style="float: left;">
<div style=""><img
class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/image_3.png">
</div>
</div>
</div>
<div class="carousel-item"
style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16"
style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>
Customer Form </h3>
<div style=""><img
class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/image_4.png">
</div>
</div>
</div>
<div class="carousel-item"
style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16"
style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o"
style="width:40px; color:#07B700"></i>
New Pos session </h3>
<div style=""><img
class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/image_5.png">
</div>
</div>
</div>
</div>
<a class="carousel-control-prev"
href="#demo" data-slide="prev"
style="left:-25px;width: 35px;color: #000;">
<span class="carousel-control-prev-icon"><i
class="fa fa-chevron-left"
style="font-size:24px"></i></span>
</a> <a class="carousel-control-next"
href="#demo" data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i
class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</section>
</div>
</div>
</div>
<!-- faq tab-->
<div class="px-2 px-lg-4 pt-3 tab-pane fade"
id="pills-contact" role="tabpanel"
aria-labelledby="pills-contact-tab">
<ul class="list-unstyled">
</ul>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container" style="padding: 2rem 3rem 1rem;">
<h2 style="font-weight: 600;text-align: center;margin-bottom: 25px;width: 100%;">
Suggested Products</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active" style="min-height: 0px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/pos_order_types/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/1.png"></div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/pos_product_addons/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/2.png"></div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/dashboard_pos/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/3.png"></div>
</a>
</div>
</div>
<div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/product_return_pos/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/4.png"></div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/point_of_sale_logo/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/5.png"></div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float: left;">
<a href="https://apps.odoo.com/apps/modules/14.0/invoice_format_editor/"
target="_blank">
<div style="box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);border-radius: 10px;">
<img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;"
src="images/6.png"></div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="left:-25px;width: 35px;color: #000;"> <span
class="carousel-control-prev-icon"><i
class="fa fa-chevron-left"
style="font-size:24px"></i></span> </a> <a
class="carousel-control-next" href="#demo1" data-slide="next"
style="right:-25px;width: 35px;color: #000;"> <span
class="carousel-control-next-icon"><i
class="fa fa-chevron-right" style="font-size:24px"></i></span>
</a>
</div>
</section>
<section class="row" style="padding: 2rem 3rem 1rem;margin:0px">
<h2 style="font-weight: 600;margin-bottom: 20px;text-align: center;width: 100%;">
Our Service</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<div class="row"
style=" display: flex; justify-content: center; flex-wrap: wrap;width: 100%; ">
<!-- <div style="display:flex;padding-top: 20px;justify-content: space-between;"> -->
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-customization-and-installation/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-customization.png"
style="width: 100%;border-radius: 100%;"/> </a>
</div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-customization-and-installation/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Customization </a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-implementation/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-erp-implementation.png"
style="width: 100%;border-radius: 100%;"/> </a>
</div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-implementation/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Implementation </a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-integration/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-erp-integration.png"
style="width: 100%;border-radius: 100%;"/> </a>
</div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-integration/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Integration </a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-support/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-erp-support.png"
style="width: 100%;border-radius: 100%;"/> </a>
</div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-support/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Odoo Support</a></h3>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/hire-odoo-developer/"
target="_blank"> <img
src="https://www.cybrosys.com/images/hire-odoo-developer.png"
style="width: 100%;border-radius: 100%;"/> </a>
</div>
<h3 class="oe_slogan"
style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/hire-odoo-developer/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Hire Odoo Developers</a></h3>
</div>
<!-- </div> -->
</div>
</section>
<section class="row" style="padding: 2rem 3rem 1rem;margin:0px">
<div class="row" style="margin: 0">
<h2 style="font-weight: 600;margin-bottom: 20px;text-align: center;width: 100%;">
Our Industries</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<!-- <div style="display:flex;justify-content: space-between;flex-wrap:wrap;"> -->
<div class="row" style="width: 100%">
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/best-trading-erp/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-1.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/best-trading-erp/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Trading </a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Easily procure and sell your products. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/manufacturing-erp-software/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-2.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;margin-bottom: 10px;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/manufacturing-erp-software/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Manufacturing</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
Plan, track and schedule your operations. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/restaurant-management/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-3.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/restaurant-management/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
Restaurant</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
Run your bar or restaurant methodical. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/pos/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-4.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/pos/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none;font-family: 'Montserrat',sans-serif;">
POS</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;font-family: 'Montserrat',sans-serif;">
Easy configuring and convivial selling. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/ecommerce-website/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-5.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 0px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/ecommerce-website/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
E-commerce & Website</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Mobile friendly, awe-inspiring product pages. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/hotel-management-erp/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-6.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/hotel-management-erp/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Hotel Management</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
An all-inclusive hotel management
application. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/education-erp-software/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-7.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/education-erp-software/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Education</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
A Collaborative platform for educational
management. </h3>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12"
style=" margin-bottom: 10px; ">
<div>
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/service-management/"
target="_blank"> <img
src="https://www.cybrosys.com/images/odoo-index-industry-8.png"
alt="Odoo Industry"
style=" border-radius: 100%;width:100%;"/>
</a></div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan"
style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/service-management/"
target="_blank"
style="list-style: none; color:#000; text-decoration: none; font-family: 'Montserrat',sans-serif;">
Service Management</a></h3>
<h3 class="oe_slogan"
style=" text-align: left;font-size: 12px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px; font-family: 'Montserrat',sans-serif;">
Keep track of services and invoice
accordingly. </h3>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container" style="padding: 0% 0% 6% 0%;">
<div class="col-md-12" style="margin: auto !important;
width: 70%;
padding: 30px;">
<h2 style="font-weight: 600;text-align: center;width: 100%;">
Need Any Help?</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<h4 style="font-size:16px;"> If you have anything to share with
us based on your use of this module, please let us know. We
are ready to offer our support. </h4>
<div class="col-md-6" style="float:left; padding:20px;">
<h4><i class="fa fa-envelope"></i>Email us </h4>
<p>odoo@cybrosys.com</p>
</div>
<div class="col-md-6" style="float:left; padding:20px;">
<h4><i class="fa fa-phone"></i> Contact Us </h4>
<a href="https://www.cybrosys.com/contact/"
target="_blank"> www.cybrosys.com</a>
</div>
</div>
</section>
<section class="oe_container" style="padding: 0% 0% 6% 0%;">
<div class="oe_slogan" style="margin-bottom: 0px;">
<div style=" display: flex; justify-content: center; flex-wrap: wrap; ">
</div>
<br>
<img src="https://www.cybrosys.com/images/logo.png"
style="width: 190px; margin-bottom: 25px;margin-top: 30px;"
class="center-block">
<div style=" display: flex; justify-content: center; flex-wrap: wrap; ">
<a href="https://twitter.com/cybrosys" target="_blank"><i
class="fa fa-2x fa-twitter"
style="color:white;background: #00a0d1;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd"
target="_blank"><i class="fa fa-2x fa-linkedin"
style="color:white;background: #31a3d6;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
<a href="https://www.facebook.com/cybrosystechnologies"
target="_blank"><i class="fa fa-2x fa-facebook"
style="color:white;background: #3b5998;width:35px; height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i
class="fa fa-2x fa-pinterest"
style="color:white;background: #ac0f18;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a>
</div>
</div>
</section>
</div>

46
pos_customer_birthday_discount/static/src/js/PaymentScreen.js

@ -0,0 +1,46 @@
odoo.define('point_of_sale.BirthdayPaymentScreen', function(require) {
'use strict';
const PaymentScreen = require('point_of_sale.PaymentScreen');
const Registries = require('point_of_sale.Registries');
var rpc = require('web.rpc');
/**
* selectClient function is inherited to check if the current day is the birthday
* of selected partner and apply the discount.
*/
const BirthdayPaymentScreen = (PaymentScreen) =>
class extends PaymentScreen {
async selectClient() {
// IMPROVEMENT: This code snippet is repeated multiple times.
// Maybe it's better to create a function for it.
const currentClient = this.currentOrder.get_client();
const { confirmed, payload: newClient } = await this.showTempScreen(
'ClientListScreen',
{ client: currentClient }
);
if (confirmed) {
var val = 0;
var orderLines = this.currentOrder.orderlines
if(newClient){
var first_order = this.env.pos.config.first_order;
var self = this;
await rpc.query({model: "pos.config", method: "check_pos_order", args: [[newClient['id'],first_order]]
})
.then(function (data) {
if(data['birthday'] == 'True' && data['order'] == 'False'){
val = self.env.pos.config.discount * 100;
}
});
}
for(var order_id=0; order_id<orderLines.length; order_id++){
orderLines.models[order_id].discount = val;
orderLines.models[order_id].discountStr = '' + val;
}
this.currentOrder.set_client(newClient);
this.currentOrder.updatePricelist(newClient);
}
}
}
Registries.Component.extend(PaymentScreen, BirthdayPaymentScreen);
return PaymentScreen;
})

66
pos_customer_birthday_discount/static/src/js/ProductScreenInherit.js

@ -0,0 +1,66 @@
odoo.define('point_of_sale.ClickProductDiscount', function(require) {
'use strict';
const Registries = require("point_of_sale.Registries");
const ProductScreen = require("point_of_sale.ProductScreen");
const NumberBuffer = require('point_of_sale.NumberBuffer');
var rpc = require('web.rpc');
const ClickProductDiscount = (ProductScreen) =>
class extends ProductScreen{
/**
* Function executes when product is added to the pos orderLine and checks if the
* customer is eligible for birthday discount and triggers the set discount function
* to set the discount percentage.
*
* @param {Object} event Details of the product added to the orderline
*/
async _clickProduct(event) {
if(this.env.pos.config.birthday_discount && this.currentOrder.attributes.client){
var val = this.env.pos.config.discount * 100;
for (let order_line of this.currentOrder.orderlines.models){
if(order_line.product.id == event.detail.id){
var qty = order_line.quantity + 1;
order_line.set_quantity(qty)
return;
}
}
// Code of original function
if (!this.currentOrder) {
this.env.pos.add_new_order();
}
const product = event.detail;
const options = await this._getAddProductOptions(product);
// Do not add product if options is undefined.
if (!options) return;
// Add the product after having the extra information.
this.currentOrder.add_product(product, options);
NumberBuffer.reset();
// End of original function code
var self = this;
var first_order = self.env.pos.config.first_order;
var partner_id = self.currentOrder.attributes.client.id;
await rpc.query({model: "pos.config", method: "check_pos_order", args: [[partner_id,first_order]]
})
.then(function (data) {
if(data['birthday'] == 'True' && data['order'] == 'False'){
self.currentOrder.get_selected_orderline().set_discount(val);
}
});
}
else {
if (!this.currentOrder) {
this.env.pos.add_new_order();
}
const product = event.detail;
const options = await this._getAddProductOptions(product);
// Do not add product if options is undefined.
if (!options) return;
// Add the product after having the extra information.
this.currentOrder.add_product(product, options);
NumberBuffer.reset();
}
}
}
Registries.Component.extend(ProductScreen, ClickProductDiscount);
});

40
pos_customer_birthday_discount/static/src/js/birthday_discount.js

@ -0,0 +1,40 @@
odoo.define('point_of_sale.BirthdayDiscount', function(require) {
'use strict';
const ActionpadWidget = require('point_of_sale.ActionpadWidget');
const Registries = require('point_of_sale.Registries');
var rpc = require('web.rpc');
const BirthdayDiscount = (ActionpadWidget) =>
class extends ActionpadWidget{
/**
* isLong function is inherited to check if the current day is the birthday
* of selected partner and return the result.
* constructor is used to make the function async
*/
constructor() {
super(...arguments);
Object.defineProperty(this,'isLongName', {
get: async function() {
var self = this
if(self.env.pos.config.birthday_discount && self.props.client){
self.client['disc'] = 0 ;
var orderLines = self.env.pos.attributes.selectedOrder.orderlines.models;
rpc.query({model: "pos.config", method: "check_birthday", args: [self.props.client.id]
}).then(function (data) {
if(data['birthday']){
self.client['birthday'] = 'True';
self.client['disc'] = self.env.pos.config.discount * 100;
}
for(var order_id=0; order_id<orderLines.length; order_id++){
orderLines[order_id].set_discount(self.client['disc']);
}
});
}
return this.client && this.client.name.length > 10;
}
});
}
}
Registries.Component.extend(ActionpadWidget, BirthdayDiscount);
});

38
pos_customer_birthday_discount/static/src/js/models.js

@ -0,0 +1,38 @@
odoo.define('point_of_sale.discountOrderLine', function(require) {
'use strict';
const field_utils = require('web.field_utils');
var models = require('point_of_sale.models');
var rpc = require('web.rpc');
models.Orderline = models.Orderline.extend({
/**
* Set the discount to order of customer or replaces the current discount with birthday discount to the order placed by the customer.
*
* @param {string} discount Discount to be applied
*/
async set_discount(discount){
var self = this;
if(self.pos.config.birthday_discount && self.order.attributes.client){
var partner_id = self.order.attributes.client.id;
var first_order = self.pos.config.first_order;
await rpc.query({model: "pos.config", method: "check_pos_order", args: [[partner_id,first_order]]
})
.then(function (data){
if(data['birthday'] == 'True' && data['order'] == 'False'){
self['check_birthday'] = true
}
else{
self['check_birthday'] = false
}
});
}
var parsed_discount = typeof(discount) ===
'number' ? discount : isNaN(parseFloat(discount)) ? 0 : field_utils.parse.float('' + discount);
var disc = Math.min(Math.max(parsed_discount || 0, 0),100);
this.discount = disc;
this.discountStr = '' + disc;
this.trigger('change',this);
}
});
});

12
pos_customer_birthday_discount/static/src/xml/ActionpadWidgetInherit.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.ActionpadWidget" t-inherit-mode="extension">
<xpath expr="//button[hasclass('set-customer')]" position="inside">
<t t-if="props.client">
<t t-if="props.client['birthday'] == 'True'">
<div>(Happy birthday)</div>
</t>
</t>
</xpath>
</t>
</templates>

51
pos_customer_birthday_discount/static/src/xml/OrderlineInherit.xml

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.Orderline" t-inherit-mode="extension">
<xpath expr="//ul[hasclass('info-list')]" position="replace">
<ul class="info-list">
<t t-if="props.line.get_quantity_str() !== '1' || props.line.selected ">
<li class="info">
<em>
<t t-esc="props.line.get_quantity_str()" />
</em>
<span> </span><t t-esc="props.line.get_unit().name" />
at
<t t-if="props.line.display_discount_policy() == 'without_discount' and
props.line.get_unit_display_price() &lt; props.line.get_taxed_lst_unit_price()">
<s>
<t t-esc="env.pos.format_currency(props.line.get_taxed_lst_unit_price(),
'Product Price')" />
</s>
<t t-esc="env.pos.format_currency(props.line.get_unit_display_price(),'Product Price')" />
</t>
<t t-else="">
<t t-esc="env.pos.format_currency(props.line.get_unit_display_price(),'Product Price')" />
</t>
/
<t t-esc="props.line.get_unit().name" />
</li>
</t>
<t t-if="props.line.get_discount_str() !== '0'">
<t t-if="props.line.check_birthday">
<li class="info">
With a
<em>
<t t-esc="props.line.get_discount_str()" />%
</em>
Birthday discount
</li>
</t>
<t t-else="">
<li class="info">
With a
<em>
<t t-esc="props.line.get_discount_str()" />%
</em>
discount
</li>
</t>
</t>
</ul>
</xpath>
</t>
</templates>

11
pos_customer_birthday_discount/views/assets.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="pos_assets" name="add pos assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_customer_birthday_discount/static/src/js/birthday_discount.js"></script>
<script type="text/javascript" src="/pos_customer_birthday_discount/static/src/js/ProductScreenInherit.js"></script>
<script type="text/javascript" src="/pos_customer_birthday_discount/static/src/js/models.js"></script>
<script type="text/javascript" src="/pos_customer_birthday_discount/static/src/js/PaymentScreen.js"></script>
</xpath>
</template>
</odoo>

43
pos_customer_birthday_discount/views/pos_config_views.xml

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Xpath expression specified to add new fields in pos_config model-->
<record id="pos_config_view_form" model="ir.ui.view">
<field name="name">pos.config.view.form.inherit.pos.customer.birthday.discount</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='pricing']" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="birthday_discount"/>
</div>
<div class="o_setting_right_pane">
<label for="birthday_discount"/>
<div class="text-muted">
Provides extra discount for customers on their Birthday
</div>
<div attrs="{'invisible': [('birthday_discount', '=', False)]}">
<div>
<label for="discount"/>
<div>
<field name="discount" widget="percentage" style="width:80px;"/>
</div>
</div>
</div>
</div>
<div attrs="{'invisible': [('birthday_discount', '=', False)]}">
<div class="o_setting_left_pane">
<field name="first_order"/>
</div>
<div class="o_setting_right_pane">
<label for="first_order"/>
<div class="text-muted">
Apply the discount only for the first order of the customer on Birthday
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

17
pos_customer_birthday_discount/views/res_partner_views.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Added new field birthdate in partner form-->
<record id="view_partner_form" model="ir.ui.view">
<field name="name">view.partner.form.inherit.pos.customer.birthday.discount</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='email']" position="before">
<label for="birthdate" string="Birth Date"/>
<div>
<field name="birthdate" widget="date" options="{'noWeekends': true, 'format': 'YYYY-MM-DD'}"/>
</div>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save