Browse Source

[ADD] Initial Commit

pull/124/head
Ajmalcybrosys 6 years ago
parent
commit
d67b4d12e7
  1. 31
      hr_linkedin_recruitment/README.rst
  2. 24
      hr_linkedin_recruitment/__init__.py
  3. 48
      hr_linkedin_recruitment/__manifest__.py
  4. 14
      hr_linkedin_recruitment/data/auth_linkedin_data.xml
  5. 6
      hr_linkedin_recruitment/doc/RELEASE_NOTES.md
  6. 8
      hr_linkedin_recruitment/doc/requirment.txt
  7. 26
      hr_linkedin_recruitment/models/__init__.py
  8. 33
      hr_linkedin_recruitment/models/auth_outh.py
  9. 172
      hr_linkedin_recruitment/models/hr_job.py
  10. 76
      hr_linkedin_recruitment/models/mechanize_op.py
  11. 50
      hr_linkedin_recruitment/models/recruitment_config.py
  12. BIN
      hr_linkedin_recruitment/static/description/banner.jpg
  13. BIN
      hr_linkedin_recruitment/static/description/cybro_logo.png
  14. BIN
      hr_linkedin_recruitment/static/description/hr-linkedin-integration1.png
  15. BIN
      hr_linkedin_recruitment/static/description/hr-linkedin-integration2.png
  16. BIN
      hr_linkedin_recruitment/static/description/hr-linkedin-integration3.png
  17. BIN
      hr_linkedin_recruitment/static/description/hr-linkedin-integration4.png
  18. BIN
      hr_linkedin_recruitment/static/description/hr-linkedin-integration5.png
  19. BIN
      hr_linkedin_recruitment/static/description/icon.png
  20. 377
      hr_linkedin_recruitment/static/description/index.html
  21. 19
      hr_linkedin_recruitment/views/hr_job_linkedin.xml
  22. 13
      hr_linkedin_recruitment/views/oauth_view.xml
  23. 26
      hr_linkedin_recruitment/views/recruitment_config_settings.xml
  24. 36
      vouchers_pos/README.rst
  25. 23
      vouchers_pos/__init__.py
  26. 44
      vouchers_pos/__manifest__.py
  27. 11
      vouchers_pos/data/product_data.xml
  28. 7
      vouchers_pos/doc/RELEASE_NOTES.md
  29. 23
      vouchers_pos/models/__init__.py
  30. 108
      vouchers_pos/models/gift_voucher.py
  31. 7
      vouchers_pos/security/ir.model.access.csv
  32. BIN
      vouchers_pos/static/description/banner.jpg
  33. BIN
      vouchers_pos/static/description/cybro_logo.png
  34. BIN
      vouchers_pos/static/description/icon.png
  35. 404
      vouchers_pos/static/description/index.html
  36. BIN
      vouchers_pos/static/description/vouchers-pos-1.png
  37. BIN
      vouchers_pos/static/description/vouchers-pos-2.png
  38. BIN
      vouchers_pos/static/description/vouchers-pos-3.png
  39. BIN
      vouchers_pos/static/description/vouchers-pos-4.png
  40. BIN
      vouchers_pos/static/description/vouchers-pos-5.png
  41. BIN
      vouchers_pos/static/description/vouchers-pos-6.png
  42. 23
      vouchers_pos/static/src/css/pos.css
  43. 393
      vouchers_pos/static/src/js/coupons.js
  44. 94
      vouchers_pos/static/src/xml/coupons.xml
  45. 47
      vouchers_pos/views/applied_coupons.xml
  46. 128
      vouchers_pos/views/gift_voucher.xml
  47. 11
      vouchers_pos/views/pos_template.xml

31
hr_linkedin_recruitment/README.rst

@ -0,0 +1,31 @@
==========================================
Basic HR-LinkedIn Connector v12
==========================================
The module integrates LinkedIn with Odoo HR Recruitment.
* Share Job Opening Posts With LinkedIn.
* Automate Odoo HRMS with LinkedIn.
Company
-------
* `Cybrosys Technologies <https://cybrosys.com/>`__
Developers
----------
* `Nilmar Shereef <odoo@cybrosys.com>`__
* `Jesni Banu
* `v11 & v12 Milind Mohan
Contact
-------
* Mail Contact : odoo@cybrosys.com
* Mail Contact : info@cybrosys.com
Related Blog
-------
* `Cybrosys LinkedIn Blog <https://www.cybrosys.com/blog/odoo-linkedin-integration-in-hr/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__
Technical instructions: `<doc/requirement.txt>`__

24
hr_linkedin_recruitment/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

48
hr_linkedin_recruitment/__manifest__.py

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2019-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'HR-LinkedIn Integration',
'summary': "Integrates LinkedIn with HR Recruitment",
'description': "Basic module for LnkedIn-HR Recruitment connector",
'category': 'Generic Modules/Human Resources',
'version': "12.0.1.0.0",
'depends': ['hr_recruitment', 'auth_oauth'],
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'data': [
'data/auth_linkedin_data.xml',
'views/recruitment_config_settings.xml',
'views/hr_job_linkedin.xml',
'views/oauth_view.xml',
],
'external_dependencies':
{
'python': ['mechanize', 'linkedin'],
},
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

14
hr_linkedin_recruitment/data/auth_linkedin_data.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="provider_linkedin" model="auth.oauth.provider">
<field name="name">LinkedIn</field>
<field name="auth_endpoint">https://www.linkedin.com/oauth/v2/authorization</field>
<field name="scope">r_basicprofile r_emailaddress w_share w_member_social</field>
<field name="validation_endpoint">https://api.linkedin.com/v2/me</field>
<field name="data_endpoint">https://api.linkedin.com/v2/me</field>
<field name="css_class">fa fa-linkedin-square</field>
<field name="body">Share post with LinkedIn</field>
</record>
</data>
</odoo>

6
hr_linkedin_recruitment/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <hr_linkedin_recruitment>
#### 03.05.2019
#### Version 12.0.1.0.0
##### ADD
- Initial Commit (linkedin api v2)

8
hr_linkedin_recruitment/doc/requirment.txt

@ -0,0 +1,8 @@
Odoo integration module "hr_linkedin_recruitment" depends on the several external python package.
Please ensure that listed packaged has installed in your system:
* python-linkedin (sudo python-linkedin)
* mechanize (sudo pip install mechanize)

26
hr_linkedin_recruitment/models/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import mechanize_op
from . import recruitment_config
from . import hr_job
from . import auth_outh

33
hr_linkedin_recruitment/models/auth_outh.py

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models, fields, api
class OAuthProviderLinkedin(models.Model):
_inherit = 'auth.oauth.provider'
""" Adding client_secret field because some apps likes twitter,
linkedIn are using this value for its API operations """
client_secret = fields.Char(string='Client Secret', help="Only need LinkedIn, Twitter etc..")

172
hr_linkedin_recruitment/models/hr_job.py

@ -0,0 +1,172 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
import logging
_logger = logging.getLogger(__name__)
try:
import mechanize
from linkedin import linkedin
from urllib.request import HTTPRedirectHandler as MechanizeRedirectHandler
except ImportError:
_logger.error('Odoo module hr_linkedin_recruitment depends on the several external python package'
'Please read the doc/requirement.txt file inside the module.')
import requests
import mechanicalsoup
import json
from urllib.parse import urlsplit
from urllib.parse import parse_qs
from urllib.parse import urlparse
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, Warning
import builtins as exceptions
class HrJobShare(models.Model):
_inherit = 'hr.job'
update_key = fields.Char(string='Update Key', readonly=True)
@api.multi
def share_linkedin(self):
""" Button function for sharing post """
credential_dict = self.get_authorize()
access_token = credential_dict['access_token']
li_credential = credential_dict['li_credential']
share_data = {
"author": "urn:li:person:"+li_credential['profile_urn'],
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": self.description
},
"shareMediaCategory": "NONE"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
# URLS
page_share_url = 'https://api.linkedin.com/v2/ugcPosts'
if self.description:
response = self.share_request('POST', page_share_url, access_token, data=json.dumps(share_data))
share_response_text = response.json()
share_response_code = response.status_code
if share_response_code == 201:
self.update_key = True
elif share_response_code == 404:
raise Warning("Resource does not exist.!")
elif share_response_code == 409:
raise Warning("Already shared!")
else:
raise Warning("Error!! Check your connection...")
else:
raise Warning("Provide a Job description....")
def share_request(self, method, page_share_url, access_token, data):
""" Function will return UPDATED KEY , [201] if sharing is OK """
headers = {'x-li-format': 'json', 'Content-Type': 'application/json'}
params = {}
params.update({'oauth2_access_token': access_token})
kw = dict(data=data, params=params, headers=headers, timeout=60)
req_response = requests.request(method.upper(), page_share_url, **kw)
return req_response
def get_urn(self, method, has_access_url, access_token):
""" Function will return TRUE if credentials user has the access to update """
headers = {'x-li-format': 'json', 'Content-Type': 'application/json'}
params = {}
params.update({'oauth2_access_token': access_token})
kw = dict(params=params, headers=headers, timeout=60)
req_response = requests.request(method.upper(), has_access_url, **kw)
return req_response
def get_authorize(self):
""" Supporting function for authenticating operations """
li_credential = {}
linkedin_auth_provider = self.env.ref('hr_linkedin_recruitment.provider_linkedin')
if linkedin_auth_provider.client_id and linkedin_auth_provider.client_secret:
li_credential['api_key'] = linkedin_auth_provider.client_id
li_credential['secret_key'] = linkedin_auth_provider.client_secret
else:
raise ValidationError(_('LinkedIn Access Credentials are empty.!\n'
'Please fill up in Auth Provider form.'))
if self.env['ir.config_parameter'].sudo().get_param('recruitment.li_username'):
li_credential['un'] = self.env['ir.config_parameter'].sudo().get_param('recruitment.li_username')
else:
raise exceptions.Warning(_('Please fill up username in LinkedIn Credential settings.'))
if self.env['ir.config_parameter'].sudo().get_param('recruitment.li_password'):
li_credential['pw'] = self.env['ir.config_parameter'].sudo().get_param('recruitment.li_password')
else:
raise exceptions.Warning(_('Please fill up password in LinkedIn Credential settings.'))
# Browser Data Posting And Signing
br = mechanicalsoup.StatefulBrowser()
br.set_cookiejar(mechanize.CookieJar())
return_uri = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
li_permissions = ['r_liteprofile', 'r_emailaddress', 'w_share', 'rw_company_admin', 'w_member_social']
auth = linkedin.LinkedInAuthentication(li_credential['api_key'],
li_credential['secret_key'],
return_uri,
li_permissions)
try:
br.open(auth.authorization_url)
br.select_form(selector='form', nr=0)
br['session_key'] = li_credential['un']
br['session_password'] = li_credential['pw']
br.submit_selected()
try:
auth.authorization_code = parse_qs(urlsplit(br.get_url()).query)['code']
except:
br.open(br.get_url())
br.select_form(selector='form', nr=1)
q = br.submit_selected()
auth.authorization_code = parse_qs(urlsplit(br.get_url()).query)['code']
if not auth.authorization_code:
raise Warning("Please check Redirect URLs in the LinkedIn app settings!")
except:
raise Warning("Please check Redirect URLs in the LinkedIn app settings!")
li_suit_credent = {}
li_suit_credent['access_token'] = str(auth.get_access_token().access_token)
member_url = 'https://api.linkedin.com/v2/me'
response = self.get_urn('GET', member_url, li_suit_credent['access_token'])
urn_response_text = response.json()
li_credential['profile_urn'] = urn_response_text['id']
li_suit_credent['li_credential'] = li_credential
return li_suit_credent

76
hr_linkedin_recruitment/models/mechanize_op.py

@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
import logging
import urllib
_logger = logging.getLogger(__name__)
try:
import mechanize
from mechanize import _response
from mechanize import _rfc3986
import re
class MechanizeRedirectHandler(mechanize.HTTPRedirectHandler):
def http_error_302(self, req, fp, code, msg, headers):
# Code from mechanize._urllib2_fork.HTTPRedirectHandler:
if 'location' in headers:
newurl = headers.getheaders('location')[0]
elif 'uri' in headers:
newurl = headers.getheaders('uri')[0]
else:
return
newurl = _rfc3986.clean_url(newurl, "latin-1")
newurl = _rfc3986.urljoin(req.get_full_url(), newurl)
new = self.redirect_request(req, fp, code, msg, headers, newurl)
if new is None:
return
if hasattr(req, 'redirect_dict'):
visited = new.redirect_dict = req.redirect_dict
if (visited.get(newurl, 0) >= self.max_repeats or
len(visited) >= self.max_redirections):
raise urllib.error.HTTPError(req.get_full_url(), code,
self.inf_msg + msg, headers, fp)
else:
visited = new.redirect_dict = req.redirect_dict = {}
visited[newurl] = visited.get(newurl, 0) + 1
fp.read()
fp.close()
# If the redirected URL doesn't match
new_url = new.get_full_url()
if not re.search('^http(?:s)?\:\/\/.*www\.linkedin\.com', new_url):
return _response.make_response('', headers.items(), new_url, 200, 'OK')
else:
return self.parent.open(new)
http_error_301 = http_error_303 = http_error_307 = http_error_302
http_error_refresh = http_error_302
except ImportError:
_logger.warning('Odoo module hr_linkedin_recruitment depends on the several external python package'
'Please read the doc/requirement.txt file inside the module.')

50
hr_linkedin_recruitment/models/recruitment_config.py

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Author: Nilmar Shereef (<shereef@cybrosys.in>)
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models, fields, api
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
li_username = fields.Char(string="User Name", help="Your Linkedin Username")
li_password = fields.Char(string="Password", help="Your Linkedin Password")
def set_values(self):
super(ResConfigSettings, self).set_values()
self.env['ir.config_parameter'].sudo().set_param('recruitment.company_page_id', self.company_page_id)
self.env['ir.config_parameter'].sudo().set_param('recruitment.li_username', self.li_username)
self.env['ir.config_parameter'].sudo().set_param('recruitment.li_password', self.li_password)
def get_values(self):
res = super(ResConfigSettings, self).get_values()
res.update(
company_page_id=self.env['ir.config_parameter'].sudo().get_param('recruitment.company_page_id'),
li_username = self.env['ir.config_parameter'].sudo().get_param('recruitment.li_username'),
li_password = self.env['ir.config_parameter'].sudo().get_param('recruitment.li_password')
)
return res

BIN
hr_linkedin_recruitment/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
hr_linkedin_recruitment/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
hr_linkedin_recruitment/static/description/hr-linkedin-integration1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
hr_linkedin_recruitment/static/description/hr-linkedin-integration2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

BIN
hr_linkedin_recruitment/static/description/hr-linkedin-integration3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
hr_linkedin_recruitment/static/description/hr-linkedin-integration4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
hr_linkedin_recruitment/static/description/hr-linkedin-integration5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
hr_linkedin_recruitment/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

377
hr_linkedin_recruitment/static/description/index.html

@ -0,0 +1,377 @@
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-header-banner.png);background-repeat:no-repeat;background-size:100%;padding: 4% 0% 2% 15%;background-position-y: -107px;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="font-size: 35px;color: #fff;font-weight: 900;text-transform: uppercase;text-align: left;margin: 0;margin-bottom: 16px;">
HR-LinkedIn Integration
</h2>
<h3 class="oe_slogan" style="font-size: 25px;color: #fff;font-weight: 600;text-align: left;opacity: 1;margin: 0 !important;">
Integrates LinkedIn with HR Recruitment
</h3>
<h5 class="oe_slogan" style="text-align: left;background: #fff;width: 293px;padding: 10px;color: #080808 !important;opacity: 1 !important;font-weight: 600;font-size: 20px;">
<a style="color: #080808 !important;" href="https://www.cybrosys.com" target="_blank">Cybrosys Technologies</a>
</h5>
<a style="color: #080808 !important;" href="https://www.cybrosys.com" target="_blank">
<div style="width: 215px;margin-left: 57%;text-align: center;background: #ffffff;height: 215px;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0 0 12px 4px #00000059;">
<img src="https://www.cybrosys.com/images/cybro-logo-oca.png" alt="cybrosys technologies" style="width: 180px;"/>
</div>
</a>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 3% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Overview
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
This integration module makes your HR recruitment better. You can share your posts directly to LinkedIn via authorized login.
</h3>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-banner1.png); background-repeat:no-repeat; background-size:cover;padding: 10% 0% 25% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Features
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Share Recruitment Post to LinkedIn from Odoo.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Enlarge Your Audience Range.
</h3>
</div>
</section>
<section class="oe_container" style="padding: 3% 0% 0% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Screenshots
</h2>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Setup a LinkedIn App with proper information.
</h3>
<div class="oe_row oe_spaced">
<img src="hr-linkedin-integration1.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Fill-up App Credentials
<ul>
<li>Activate developer mode & fill-up API keys</li>
</ul>
</h3>
<div class="oe_row oe_spaced">
<img src="hr-linkedin-integration2.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Configuration of LinkedIn Account Details
<ul>
<li>Username, Password and Page ID.</li>
</ul>
</h3>
<div class="oe_row oe_spaced">
<img src="hr-linkedin-integration3.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Share Job Requirement with LinkedIn
<ul>
<li>Share Job Requirement with LinkedIn by using 'Share on linked' button.</li>
</ul>
</h3>
<div class="oe_row oe_spaced">
<img src="hr-linkedin-integration4.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Shared Post in LinkedIn
<ul>
<li>Takes right candidates from right place.</li>
</ul>
</h3>
<div class="oe_row oe_spaced">
<img src="hr-linkedin-integration5.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
For more details about HR-LinkedIn Connector refer our blog.
</h3>
<h5 style="margin-left: -74px; font-size: 21px;color: #a24689 !important;" class="oe_slogan"><a style="font-size: 21px;color: #a24689 !important;" href="https://www.cybrosys.com/blog/odoo-linkedin-integration-in-hr" target="_blank">Odoo Blog: LinkedIN-HR Integration </a></h5>
</div>
</section>
<section class="oe_container" style="padding: 7px 0% 0% 3%;">
<div class="oe_row oe_spaced">
<a style="color: #080808 !important;" href="https://apps.odoo.com/apps/modules/browse?search=cybrosys" target="_blank"><img src="https://www.cybrosys.com/images/view-more-apps.jpg" alt="cybrosys technologies" style="width: 100%;margin-bottom: 50px;"/></a>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Services
</h2>
<div style="display:flex;padding-top: 20px;justify-content: space-between;">
<div style="flex-basis: 18%;">
<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">
Odoo Customization
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Implementation </a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Integration
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Support</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Hire Odoo Developers</a>
</h3>
</a>
</div>
</div>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Industries
</h2>
<div style="display:flex;justify-content: space-between;flex-wrap:wrap;">
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Trading
</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Easily procure and sell your products.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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;">
<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">
Manufacturing</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Plan, track and schedule your operations.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Restaurant</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Run your bar or restaurant methodical.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
POS</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Easy configuring and convivial selling.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
E-commerce & Website</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Mobile friendly, awe-inspiring product pages.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Hotel Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
An all-inclusive hotel management application.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Education</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
A Collaborative platform for educational management.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Service Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Keep track of services and invoice accordingly.
</h3>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-footer-bg.png); background-repeat:no-repeat; background-size:100%;padding: 13% 0% 6% 0%;">
<div class="oe_slogan" style="margin-top:10px !important;margin-bottom: 0px;">
<div>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="mailto:odoo@cybrosys.com"><i class="fa fa-envelope"></i> Email us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-phone"></i> Contact Us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="https://www.cybrosys.com/images/logo.png" style="width: 190px; margin-bottom: 25px;margin-top: 30px;" class="center-block">
<div>
<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></td>
<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;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<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></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
</div>
</div>
</section>

19
hr_linkedin_recruitment/views/hr_job_linkedin.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- job Form View -->
<record id="hr_job_linkedin_form" model="ir.ui.view">
<field name="name">hr.job.linkedin.form</field>
<field name="model">hr.job</field>
<field name="inherit_id" ref="hr.view_hr_job_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='set_open']" position="after">
<button name="share_linkedin" string="Share on LinkedIn" type="object" attrs="{'invisible': [('update_key', '!=', False)]}" groups="base.group_user"/>
</xpath>
<xpath expr="//field[@name='description']" position="after">
<field name="update_key" invisible="True"/>
</xpath>
</field>
</record>
</data>
</odoo>

13
hr_linkedin_recruitment/views/oauth_view.xml

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<odoo>
<record id="view_auth_oauth_provider_secret_form" model="ir.ui.view">
<field name="name">auth.oauth.provider.secret.form</field>
<field name="model">auth.oauth.provider</field>
<field name="inherit_id" ref="auth_oauth.view_oauth_provider_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='client_id']" position="after">
<field name="client_secret"/>
</xpath>
</field>
</record>
</odoo>

26
hr_linkedin_recruitment/views/recruitment_config_settings.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Configure Recruitment Settings View -->
<record id="hr_linkedin_recruitment_config" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hr.linkedin</field>
<field name="name">LinkedIn Configure Recruitment</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="hr_recruitment.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='recruitment_process_div']" position="after">
<h2>LinkedIn Credentials</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<group>
<field name="li_username"/>
<field name="li_password" password="True"/>
</group>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>

36
vouchers_pos/README.rst

@ -0,0 +1,36 @@
Coupons & Vouchers in Point of Sale V12
=======================================
This module allow special discounts to your customers using Gift Vouchers and Coupon codes.
Depends
=======
[point_of_sale] addon Odoo
Installation
============
- www.odoo.com/documentation/12.0/setup/install.html
- Install our custom addon
Credits
=======
* Cybrosys Techno Solutions<https://www.cybrosys.com>
Author
------
Developers: v10.0 LINTO CT <odoo@cybrosys.com>
v11.0 LINTO CT
v12.0 Kavya Raveendran
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

23
vouchers_pos/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author:LINTO CT(<https://www.cybrosys.com>)
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from. import models

44
vouchers_pos/__manifest__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author:LINTO CT(<https://www.cybrosys.com>)
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'Coupons & Vouchers in Point of Sale',
'version': '12.0.1.0.0',
'category': 'Point of Sale',
'summary': 'Manage Point of Sale Vouchers & Coupon Codes',
'author': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'depends': ['point_of_sale'],
'data': [
'data/product_data.xml',
'views/gift_voucher.xml',
'views/applied_coupons.xml',
'views/pos_template.xml',
'security/ir.model.access.csv'
],
'qweb': ['static/src/xml/coupons.xml'],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'application': False,
'auto_install': False,
}

11
vouchers_pos/data/product_data.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record model="product.product" id="gift_product_pos">
<field name="name">Gift-Coupon</field>
<field name="display_name">Gift-Coupon</field>
<field name="available_in_pos">True</field>
<field name="type">service</field>
<field name="taxes_id"></field>
<field name="supplier_taxes_id"></field>
</record>
</odoo>

7
vouchers_pos/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <vouchers_pos>
#### 29.04.2019
#### Version 12.0.1.0.0
##### ADD
- Initial commit

23
vouchers_pos/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author:LINTO CT(<https://www.cybrosys.com>)
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from . import gift_voucher

108
vouchers_pos/models/gift_voucher.py

@ -0,0 +1,108 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author:LINTO CT(<https://www.cybrosys.com>)
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
import string
import random
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class GiftVoucherPos(models.Model):
_name = 'gift.voucher.pos'
name = fields.Char(string="Name", required=True)
voucher_type = fields.Selection(
selection=[
('product', 'Product'),
('category', 'POS Category'),
('all', 'All Products'),
], string="Applicable on ", default='product'
)
product_id = fields.Many2one('product.product', string="Product")
product_categ = fields.Many2one('pos.category', string="Product Category")
min_value = fields.Integer(string="Minimum Voucher Value", required=True)
max_value = fields.Integer(string="Maximum Voucher Value", required=True)
expiry_date = fields.Date(string="Expiry Date", required=True, help='The expiry date of Voucher.')
class GiftCouponPos(models.Model):
_name = 'gift.coupon.pos'
def get_code(self):
size = 7
chars = string.ascii_uppercase + string.digits
return ''.join(random.choice(chars) for _ in range(size))
_sql_constraints = [
('name_uniq', 'unique (code)', "Code already exists !"),
]
name = fields.Char(string="Name", required=True)
code = fields.Char(string="Code", default=get_code)
voucher = fields.Many2one('gift.voucher.pos', string="Voucher", required=True)
start_date = fields.Date(string="Start Date")
end_date = fields.Date(string="End Date")
partner_id = fields.Many2one('res.partner', string="Limit to a Single Partner", help='Limit to a Single Partner')
limit = fields.Integer(string="Total Available For Each User", default=1, help='Total Available For Each User')
total_avail = fields.Integer(string="Total Available", default=1)
voucher_val = fields.Float(string="Voucher Value", help='The amount for the voucher.')
type = fields.Selection([
('fixed', 'Fixed Amount'),
('percentage', 'Percentage'),
], store=True, default='fixed')
@api.onchange('voucher_val')
def check_val(self):
if self.voucher_val > self.voucher.max_value or self.voucher_val < self.voucher.min_value:
raise UserError(_("Please check the voucher value"))
class CouponPartnerPos(models.Model):
_name = 'partner.coupon.pos'
partner_id = fields.Many2one('res.partner', string="Partner")
coupon_pos = fields.Char(string="Coupon Applied")
number_pos = fields.Integer(string="Number of Times Used")
def update_history(self, vals):
if vals:
h_obj = self.env['partner.coupon.pos']
history = h_obj.search([('coupon_pos', '=', vals['coupon_pos']),('partner_id', '=', vals['partner_id'])], limit=1)
coupon = self.env['gift.coupon.pos'].search([('code', '=', vals['coupon_pos'])], limit=1)
if history:
history.number_pos += 1
coupon.total_avail -= 1
else:
coupon.total_avail -= 1
rec = {
'partner_id': vals['partner_id'],
'number_pos': 1,
'coupon_pos': vals['coupon_pos']
}
h_obj.create(rec)
return True
class PartnerExtendedPos(models.Model):
_inherit = 'res.partner'
applied_coupon_pos = fields.One2many('partner.coupon.pos', 'partner_id', string="Coupons Applied From POS")

7
vouchers_pos/security/ir.model.access.csv

@ -0,0 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
voucher_mgr,access_voucher_mgr,vouchers_pos.model_gift_voucher_pos,point_of_sale.group_pos_manager,1,1,1,1
coupon_mgr,access_coupon_mgr,vouchers_pos.model_gift_coupon_pos,point_of_sale.group_pos_manager,1,1,1,1
partner_coupon_mgr,access_partner_coupon_mgr,vouchers_pos.model_partner_coupon_pos,point_of_sale.group_pos_manager,1,1,1,1
voucher_usr,access_voucher_usr,vouchers_pos.model_gift_voucher_pos,point_of_sale.group_pos_user,1,0,0,0
coupon_usr,access_coupon_usr,vouchers_pos.model_gift_coupon_pos,point_of_sale.group_pos_user,1,0,0,0
partner_coupon_usr,access_partner_coupon_usr,vouchers_pos.model_partner_coupon_pos,point_of_sale.group_pos_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 voucher_mgr access_voucher_mgr vouchers_pos.model_gift_voucher_pos point_of_sale.group_pos_manager 1 1 1 1
3 coupon_mgr access_coupon_mgr vouchers_pos.model_gift_coupon_pos point_of_sale.group_pos_manager 1 1 1 1
4 partner_coupon_mgr access_partner_coupon_mgr vouchers_pos.model_partner_coupon_pos point_of_sale.group_pos_manager 1 1 1 1
5 voucher_usr access_voucher_usr vouchers_pos.model_gift_voucher_pos point_of_sale.group_pos_user 1 0 0 0
6 coupon_usr access_coupon_usr vouchers_pos.model_gift_coupon_pos point_of_sale.group_pos_user 1 0 0 0
7 partner_coupon_usr access_partner_coupon_usr vouchers_pos.model_partner_coupon_pos point_of_sale.group_pos_user 1 0 0 0

BIN
vouchers_pos/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
vouchers_pos/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
vouchers_pos/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

404
vouchers_pos/static/description/index.html

@ -0,0 +1,404 @@
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-header-banner.png);background-repeat:no-repeat;background-size:100%;padding: 4% 0% 2% 15%;background-position-y: -107px;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="font-size: 35px;color: #fff;font-weight: 900;text-transform: uppercase;text-align: left;margin: 0;margin-bottom: 16px;">
Vouchers and Coupons
</h2>
<h3 class="oe_slogan" style="font-size: 25px;color: #fff;font-weight: 600;text-align: left;opacity: 1;margin: 0 !important;">
Manage Gift Vouchers and Coupon Codes in Point of Sale
</h3>
<h5 class="oe_slogan" style="text-align: left;background: #fff;width: 293px;padding: 10px;color: #080808 !important;opacity: 1 !important;font-weight: 600;font-size: 20px;">
<a style="color: #080808 !important;" href="https://www.cybrosys.com">Cybrosys Technologies</a>
</h5>
<a style="color: #080808 !important;" href="https://www.cybrosys.com" target="_blank">
<div style="width: 215px;margin-left: 57%;text-align: center;background: #ffffff;height: 215px;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0 0 12px 4px #00000059;">
<img src="https://www.cybrosys.com/images/cybro-logo-oca.png" alt="cybrosys technologies" style="width: 180px;"/>
</div>
</a>
</div>
</section>
<section class="oe_container" style="padding: 3% 0% 3% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Overview
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
Using the module, one can allow special discounts to their customers via using Gift Vouchers and Coupon codes in their point of sale.
</h3>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-banner.png); background-repeat:no-repeat; background-size:cover;padding:3% 0% 9% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Features
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Create gift vouchers for products.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Create gift vouchers for point of sale category.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Create global gift vouchers.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Create and configure coupon codes.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Apply coupon codes from point of sale.
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Coupon usage tracking.
</h3>
</div>
</section>
<section class="oe_container" style="padding: 3% 0% 0% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Screenshots
</h2>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Coupon menu
</h3>
<ul>
<li>
After installing this module, three menus will be created under
point of sale.
</li>
<li>
One can use these menus to create, configure and track vouchers, coupons and their respective usage.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-1.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Create coupons & vouchers
</h3>
<ul>
<li>
This is the form for creating vouchers.
</li>
<li>
One can create vouchers for a single product, POS category and for all the products.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-2.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Apply Coupons
</h3>
<ul>
<li>
The 'Coupons' button in point of sale can be used to enter the coupon code.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-3.png" alt="" style="width: 95%;"/>
</div>
<ul>
<li>
Enter the coupon code for the selected product.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-4.png" alt="" style="width: 95%;"/>
</div>
<ul>
<li>
Verifying the code will allow to apply the coupon.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-5.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<img src="https://www.cybrosys.com/images/ico-tick.png">
Coupon Tracking
</h3>
<ul>
<li>
Go to the 'Coupon History' menu under 'Vouchers and Coupons' for tracking coupon.
</li>
</ul>
<div class="oe_row oe_spaced">
<img src="vouchers-pos-6.png" alt="" style="width: 95%;"/>
</div>
</div>
</section>
<section class="oe_container" style="padding: 7px 0% 0% 3%;">
<div class="oe_row oe_spaced">
<a style="color: #080808 !important;" href="https://apps.odoo.com/apps/modules/browse?search=cybrosys" target="_blank"><img src="https://www.cybrosys.com/images/view-more-apps.jpg" alt="cybrosys technologies" style="width: 100%;margin-bottom: 50px;"/></a>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Services
</h2>
<div style="display:flex;padding-top: 20px;justify-content: space-between;">
<div style="flex-basis: 18%;">
<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">
Odoo Customization
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Implementation </a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Integration
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Odoo Support</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<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">
Hire Odoo Developers</a>
</h3>
</a>
</div>
</div>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Industries
</h2>
<div style="display:flex;justify-content: space-between;flex-wrap:wrap;">
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Trading
</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Easily procure and sell your products.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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;">
<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">
Manufacturing</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Plan, track and schedule your operations.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Restaurant</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Run your bar or restaurant methodical.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
POS</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Easy configuring and convivial selling.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
E-commerce & Website</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Mobile friendly, awe-inspiring product pages.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Hotel Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
An all-inclusive hotel management application.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Education</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
A Collaborative platform for educational management.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<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">
Service Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;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;">
Keep track of services and invoice accordingly.
</h3>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-footer-bg.png); background-repeat:no-repeat; background-size:100%;padding: 13% 0% 6% 0%;">
<div class="oe_slogan" style="margin-top:10px !important;margin-bottom: 0px;">
<div>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="mailto:odoo@cybrosys.com"><i class="fa fa-envelope"></i> Email us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-phone"></i> Contact Us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="https://www.cybrosys.com/images/logo.png" style="width: 190px; margin-bottom: 25px;margin-top: 30px;" class="center-block">
<div>
<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></td>
<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;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<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></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
</div>
</div>
</section>

BIN
vouchers_pos/static/description/vouchers-pos-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
vouchers_pos/static/description/vouchers-pos-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

BIN
vouchers_pos/static/description/vouchers-pos-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
vouchers_pos/static/description/vouchers-pos-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

BIN
vouchers_pos/static/description/vouchers-pos-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

BIN
vouchers_pos/static/description/vouchers-pos-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

23
vouchers_pos/static/src/css/pos.css

@ -0,0 +1,23 @@
div.coupons{
color: seagreen;
}
button.validate_coupon{
height: 38px;
vertical-align: middle;
background-color: aliceblue;
border-radius: 12px;
}
/*.pos .order-pricelist{*/
/*color: black;*/
/*margin-top: 2%;*/
/*width: 200px;*/
/*}*/
/*.pos .order-pricelist-label{*/
/*color: #e9f6e4;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*height: 85px !important;*/
/*font-size: initial;*/
/*vertical-align: middle;*/
/*text-align: center;*/
/*}*/

393
vouchers_pos/static/src/js/coupons.js

@ -0,0 +1,393 @@
odoo.define("vouchers_pos.coupons", function (require) {
"use strict";
var core = require('web.core');
var pos_screen = require('point_of_sale.screens');
var PosBaseWidget = require('point_of_sale.BaseWidget');
var pos_model = require('point_of_sale.models');
var pos_popup = require('point_of_sale.popups');
var gui = require('point_of_sale.gui');
var models = pos_model.PosModel.prototype.models;
var PosModelSuper = pos_model.PosModel;
var OrderSuper = pos_model.Order;
var rpc = require('web.rpc');
var core = require('web.core');
var _t = core._t;
var utils = require('web.utils');
var round_pr = utils.round_precision;
function find_coupon(code, coupons, vouchers) {
var coupon = [];
for(var i in coupons){
if (coupons[i]['code'] == code){
coupon.push(coupons[i]);
}
}
if(coupon.length > 0){
for(var i in vouchers){
if (vouchers[i]['id'] == coupon[0]['voucher'][0]){
coupon.push(vouchers[i]);
return coupon;
}
}
}
return false
}
function check_validity(coupon, applied_coupons, customer) {
// checking it is already used or not
for (var i in applied_coupons){
if(applied_coupons[i]['coupon_pos'] == coupon[0]['code'] && applied_coupons[i]['partner_id'][0] == customer['id']){
return applied_coupons[i];
}
}
return false;
}
function check_expiry(start, end) {
var today = moment().format('YYYY-MM-DD');
if(start && end) {
if (today < start || today > end)
return false;
}
else if(start){
if (today < start)
return false;
}
else if(end){
if (today > end)
return false;
}
return true;
}
function get_coupon_product(products) {
for (var i in products){
if(products[i]['display_name'] == 'Gift-Coupon')
return products[i]['id'];
}
return false;
}
// getting vouchers and coupons
models.push(
{
model: 'gift.voucher.pos',
fields: ['id', 'voucher_type', 'name', 'product_id', 'expiry_date', 'product_categ'],
loaded: function (self, vouchers) {
self.vouchers = vouchers;
},
},{
model: 'gift.coupon.pos',
fields: ['id', 'name', 'code', 'voucher', 'start_date',
'end_date', 'partner_id', 'limit', 'total_avail', 'voucher_val', 'type'],
loaded: function (self, coupons) {
self.coupons = coupons;
},
},
{
model: 'partner.coupon.pos',
fields: ['partner_id', 'coupon_pos', 'number_pos'],
loaded: function (self, applied_coupon) {
self.applied_coupon = applied_coupon;
},
}
);
var VoucherWidget = pos_screen.ActionButtonWidget.extend({
template:"VoucherWidget",
init: function(parent) {
return this._super(parent);
},
renderElement: function () {
var self = this;
this._super();
this.$(".coupons").click(function () {
self.gui.show_popup('coupon',{
'title': _t('Enter Your Coupon'),
});
});
},
});
pos_screen.ProductScreenWidget.include({
start: function(){
this._super();
this.coupons = new VoucherWidget(this,{});
this.coupons.replace(this.$('.placeholder-VoucherWidget'));
},
});
var CouponPopupWidget = pos_popup.extend({
template: 'CouponPopupWidget',
init: function(parent) {
this.coupon_product = null;
return this._super(parent);
},
show: function(options){
options = options || {};
this._super(options);
if(!this.coupon_product)
this.coupon_product = get_coupon_product(this.pos.db.product_by_id);
this.flag = true;
this.coupon_status = [];
this.renderElement();
this.$('input').focus();
},
click_confirm: function(){
var value = this.$('input').val();
this.gui.close_popup();
if( this.options.confirm ){
this.options.confirm.call(this,value);
}
},
renderElement: function () {
this._super();
var self = this;
this.$(".validate_coupon").click(function () {
// checking the code entered
var current_order = self.pos.get_order();
var coupon = $(".coupon_code").val();
if (current_order.orderlines.models.length == 0){
self.gui.show_popup('error',{
'title': _t('No products !'),
'body': _t('You cannot apply coupon without products.'),
});
}
else if(coupon){
if(self.pos.get_client()){
var customer = self.pos.get_client();
var coupon_res = find_coupon(coupon, self.pos.coupons, self.pos.vouchers);
var flag = true;
// is there a coupon with this code which has balance above zero
if(coupon_res && coupon_res[0]['total_avail'] > 0){
var applied_coupons = self.pos.applied_coupon;
// checking coupon status
var coupon_stat = check_validity(coupon_res, applied_coupons, customer);
// if this coupon was for a particular customer and is not used already
if(coupon_res[0]['partner_id'] && coupon_res[0]['partner_id'][0] != customer['id']){
flag = false;
}
var today = moment().format('YYYY-MM-DD');
// checking coupon balance and expiry
if(flag && coupon_stat && coupon_stat.number_pos < coupon_res[0]['limit'] &&
today <= coupon_res[1]['expiry_date']){
// checking coupon validity
flag = check_expiry(coupon_res[0]['start_date'], coupon_res[0]['end_date']);
}
// this customer has not used this coupon yet
else if(flag && !coupon_stat && today <= coupon_res[1]['expiry_date']){
flag = check_expiry(coupon_res[0]['start_date'], coupon_res[0]['end_date']);
}
else{
flag = false;
$(".coupon_status_p").text("Unable to apply coupon. Check coupon validity.!");
}
}
else{
flag = false;
$(".coupon_status_p").text("Invalid code or no coupons left. Please try again !!");
}
if(flag){
var val = coupon_res[0]['type'] == 'fixed' ?
coupon_res[0]['voucher_val'] : coupon_res[0]['voucher_val'] + "%";
var obj = $(".coupon_status_p").text("Voucher value is : "+val+" \n" +
" Do you want to proceed ? \n This operation cannot be reversed.");
obj.html(obj.html().replace(/\n/g,'<br/>'));
var order = self.pos.get_order();
order.set_coupon_value(coupon_res[0]);
}
self.flag = flag;
if(flag){
$(".confirm-coupon").css("display", "block");
}
else{
var ob = $(".coupon_status_p").text("Invalid code or no coupons left. \nPlease check coupon validity.\n" +
"or check whether the coupon usage is limited to a particular customer.");
ob.html(ob.html().replace(/\n/g,'<br/>'));
}
}
else{
$(".coupon_status_p").text("Please select a customer !!");
}
}
});
this.$(".confirm-coupon").click(function () {
// verifying and applying coupon
if(self.flag){
var order = self.pos.get_order();
var lines = order ? order.orderlines : false;
if(order.coupon){
self.gui.close_popup();
self.gui.show_popup('error',{
'title': _t('Unable to apply Coupon !'),
'body': _t('Either coupon is already applied or you have not selected any products.'),
});
}
else{
if(lines.models.length > 0 && order.check_voucher_validy()) {
var product = self.pos.db.get_product_by_id(self.coupon_product);
var price = -1;
if (order.coupon_status['type'] == 'fixed') {
price *= order.coupon_status['voucher_val'];
}
if (order.coupon_status['type'] == 'percentage') {
price *= order.get_total_with_tax() * order.coupon_status['voucher_val'] / 100;
}
if ((order.get_total_with_tax - price) <= 0) {
self.gui.close_popup();
self.gui.show_popup('error', {
'title': _t('Unable to apply Coupon !'),
'body': _t('Coupon amount is too large to apply. The total amount cannot be negative'),
});
}
else{
order.add_product(product, {quantity: 1, price: price});
order.coupon_applied();
// updating coupon balance after applying coupon
var client = self.pos.get_client();
var temp = {
'partner_id': client['id'],
'coupon_pos': order.coupon_status['code'],
};
rpc.query({
model: 'partner.coupon.pos',
method: 'update_history',
args: ['', temp]
}).done(function (result) {
var applied = self.pos.applied_coupon;
var already_used = false;
for (var j in applied) {
if (applied[j]['partner_id'][0] == client['id'] &&
applied[j]['coupon_pos'] == order.coupon_status['code']) {
applied[j]['number_pos'] += 1;
already_used = true;
break;
}
}
if (!already_used) {
var temp = {
'partner_id': [client['id'], client['name']],
'number_pos': 1,
'coupon_pos': order.coupon_status['code']
};
self.pos.applied_coupon.push(temp);
}
});
}
}
else{
self.gui.close_popup();
self.gui.show_popup('error',{
'title': _t('Unable to apply Coupon !'),
'body': _t('This coupon is not applicable on the products or category you have selected !'),
});
}
}
}
else{
self.gui.close_popup();
self.gui.show_popup('error',{
'title': _t('Unable to apply Coupon !'),
'body': _t('Invalid Code or no Coupons left !'),
});
}
});
},
});
gui.define_popup({name:'coupon', widget: CouponPopupWidget});
// PosModel is extended to store vouchers, & coupon details
pos_model.PosModel = pos_model.PosModel.extend({
initialize: function(session, attributes) {
PosModelSuper.prototype.initialize.call(this, session, attributes)
this.vouchers = [''];
this.coupons = [];
this.applied_coupon = [];
},
});
pos_model.Order = pos_model.Order.extend({
initialize: function(attributes,options){
this.coupon = false;
this.coupon_status = [];
return OrderSuper.prototype.initialize.call(this, attributes,options);;
},
set_coupon_value: function (coupon) {
this.coupon_status = coupon;
return;
},
coupon_applied: function () {
this.coupon = true;
this.export_as_JSON();
return;
},
check_voucher_validy: function () {
var self = this;
var order = self.pos.get_order();
var vouchers = self.pos.vouchers;
var voucher = null;
for (var i in vouchers){
if(vouchers[i]['id'] == self.coupon_status.voucher[0]){
voucher = vouchers[i];
break;
}
}
var flag ;
if(voucher){
switch(voucher.voucher_type){
case 'product': {
var lines = order.orderlines.models;
var products = {};
for (var p in lines){
products[lines[p].product.id] = null;
}
if(voucher.product_id[0] in products){
flag = true;
}
else
flag = false;
break;
}
case 'category':{
var lines = order.orderlines.models;
var category = {};
for (var p in lines){
if(lines[p].product.pos_categ_id){
category[lines[p].product.pos_categ_id[0]] = null;
}
}
if(voucher.product_categ[0] in category){
flag = true;
}
else
flag = false;
break;
}
case 'all': flag = true; break;
default: break;
}
}
return flag;
},
export_as_JSON: function () {
var self = OrderSuper.prototype.export_as_JSON.call(this);
self.coupon = this.coupon;
self.coupon_status = this.coupon_status;
return self;
},
init_from_JSON: function(json) {
this.coupon = json.coupon;
this.coupon_status = json.coupon_status;
OrderSuper.prototype.init_from_JSON.call(this, json);
},
get_total_without_tax: function() {
var res = OrderSuper.prototype.get_total_without_tax.call(this);
var final_res = round_pr(this.orderlines.reduce((function(sum, orderLine) {
return sum + (orderLine.get_unit_price() * orderLine.get_quantity() * (1.0 - (orderLine.get_discount() / 100.0)));
}), 0), this.pos.currency.rounding);
return final_res;
},
});
});

94
vouchers_pos/static/src/xml/coupons.xml

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="coupon_template" xml:space="preserve">
<!--template for coupons-->
<t t-name="VoucherWidget">
<div class='control-button' style="width: 70%;margin-top: 5px;margin-bottom: -5px;">
<div class="coupons">
<i class='fa fa-star' /> Coupons
</div>
</div>
</t>
<t t-name="CouponPopupWidget">
<div class="modal-dialog">
<div class="popup popup-text">
<p class="title"><t t-esc=" widget.options.title || '' " /></p>
<input class="coupon_code" type='text' t-att-value="widget.options.value || ''"></input>
<button class="validate_coupon">Verify</button>
<div class="coupon_status">
<p class="coupon_status_p"></p>
</div>
<div class="footer">
<div class="button confirm-coupon" style="display:none;">
Apply
</div>
<div class="button cancel">
Cancel
</div>
</div>
</div>
</div>
</t>
<!--
<t t-name="ClientLine">
<tr class='client-line' t-att-data-id='partner.id'>
<td><t t-esc='partner.name' /></td>
<td><t t-esc='partner.address' /></td>
<td><t t-esc='partner.phone or partner.mobile or ""' /></td>
<td><t t-esc='partner.pos_pricelist_id[1] or ""' /></td>
</tr>
</t>
-->
<t t-extend="ProductScreenWidget">
<t t-jquery='div.placeholder-ActionpadWidget' t-operation='before'>
<div class="placeholder-VoucherWidget"></div>
</t>
</t>
<!--
<t t-extend="ClientListScreenWidget">
<t t-jquery='.client-list' t-operation='replace'>
<table class='client-list'>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone</th>
<th>POS Pricelist</th>
</tr>
</thead>
<tbody class='client-list-contents'>
</tbody>
</table>
</t>
</t>
-->
<!--
<t t-extend="OrderSelectorWidget">
<t t-jquery="div.order-selector" t-operation="append">
<div>
<span class="order-pricelist-label">
<b> Pricelist: </b>
</span>
<select id ="pos_pricelist" class="order-pricelist" >
<t t-if="widget.pos_pricelist">
<option>
<t t-esc='widget.pos_pricelist'/>
</option>
</t>
<option></option>
<t t-foreach="widget.pos.pricelists || []" t-as="item">
<t t-if="widget.pos_pricelist != item.name">
<option>
<t t-esc='item.name'/>
</option>
</t>
</t>
</select>
</div>
</t>
</t>
-->
</templates>

47
vouchers_pos/views/applied_coupons.xml

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="applied_coupons_pos_view" model="ir.ui.view">
<field name="name">applied_coupons_form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']" position="after">
<page name="coupon_applied" string="Applied Coupons">
<field name="applied_coupon_pos" readonly="1">
<tree>
<field name="partner_id" invisible="1"/>
<field name="coupon_pos" />
<field name="number_pos" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
<record id="gift_coupon_history_pos_tree" model="ir.ui.view">
<field name="name">Gift Coupon History</field>
<field name="model">partner.coupon.pos</field>
<field name="arch" type="xml">
<tree>
<field name="partner_id" />
<field name="coupon_pos" />
<field name="number_pos" />
</tree>
</field>
</record>
<record id="action_gift_coupon_history_pos" model="ir.actions.act_window">
<field name="name">Gift Coupons History</field>
<field name="res_model">partner.coupon.pos</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="gift_coupon_history_pos_tree"/>
<field name="view_mode">tree</field>
</record>
<menuitem name="Coupon History" id="gift_coupon_history_pos" action="action_gift_coupon_history_pos"
parent="vouchers_pos.gift_coupon_main"/>
</data>
</odoo>

128
vouchers_pos/views/gift_voucher.xml

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="gift_voucher_pos_form" model="ir.ui.view">
<field name="name">Gift Voucher</field>
<field name="model">gift.voucher.pos</field>
<field name="arch" type="xml">
<form>
<sheet>
<h1><field name="name"/></h1>
<group>
<group>
<field name="voucher_type" widget="radio"/>
<field name="product_id" attrs="{'invisible': [('voucher_type', 'in', ('category','all'))],
'required':[('voucher_type', '=', 'product')]}"/>
<field name="product_categ" attrs="{'invisible': [('voucher_type', 'in', ('product','all'))],
'required':[('voucher_type', '=', 'category')]}"/>
</group>
<group>
<field name="min_value" />
<field name="max_value" />
<field name="expiry_date" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="gift_voucher_pos_tree" model="ir.ui.view">
<field name="name">Gift Voucher</field>
<field name="model">gift.voucher.pos</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="product_id" />
<field name="min_value" />
<field name="max_value" />
<field name="expiry_date" />
</tree>
</field>
</record>
<record id="gift_coupon_pos_form" model="ir.ui.view">
<field name="name">Gift Coupon</field>
<field name="model">gift.coupon.pos</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_title">
<label for="name" string="Name" />
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="code" />
<field name="start_date" />
</group>
<group>
<field name="voucher" />
<field name="end_date" />
</group>
</group>
<group string="Conditions">
<group>
<field name="total_avail" />
</group>
<group>
<field name="partner_id" />
<field name="limit" />
</group>
</group>
<group string="Pricing">
<group>
<field name="voucher_val" />
</group>
<group>
<field name="type" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="gift_coupon_pos_tree" model="ir.ui.view">
<field name="name">Gift Coupon</field>
<field name="model">gift.coupon.pos</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="code" />
<field name="voucher" />
<field name="start_date" />
<field name="end_date" />
<field name="partner_id" />
<field name="total_avail" />
<field name="type" />
</tree>
</field>
</record>
<record id="action_gift_voucher_pos" model="ir.actions.act_window">
<field name="name">Gift Vouchers</field>
<field name="res_model">gift.voucher.pos</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="gift_voucher_pos_tree"/>
<field name="view_mode">tree,form</field>
</record>
<record id="action_gift_coupon_pos" model="ir.actions.act_window">
<field name="name">Generate Gift Coupons</field>
<field name="res_model">gift.coupon.pos</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="gift_coupon_pos_tree"/>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Vouchers and Coupons" id="gift_coupon_main" sequence="99"
parent="point_of_sale.menu_point_root"/>
<menuitem name="Gift Voucher" id="gift_voucher" action="action_gift_voucher_pos" parent="gift_coupon_main"/>
<menuitem name="Gift Coupon" id="gift_coupon" action="action_gift_coupon_pos" parent="gift_coupon_main"/>
</data>
</odoo>

11
vouchers_pos/views/pos_template.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/vouchers_pos/static/src/js/coupons.js"></script>
<link rel="stylesheet" href="/vouchers_pos/static/src/css/pos.css" id="pos-stylesheet"/>
</xpath>
</template>
</data>
</odoo>
Loading…
Cancel
Save