Add odex25_website

This commit is contained in:
expert 2024-06-24 14:27:09 +03:00
parent 3a3f834c54
commit 6ed1d9ec71
68 changed files with 25038 additions and 1 deletions

View File

@ -1,2 +1,2 @@
# odex25-standard-moduless
# odex25-standard-modules
This Repo contains general standard modules for all projects.

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import models
from . import controllers

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
{
'name' : 'Partnerhip Website Logo',
'summary' : 'Odoo module for partnership logo and details to display on website',
'description' : """
Partnership Website ======================================= Using To display partnership's logos on Website
""",
'author' : 'Expert Co. Ltd.',
'website': 'http://www.exp-sa.com',
'category' : 'Odex25-Website/Odex25-Website',
'version' : '11.0.1.0.0',
'sequence' : 1,
'depends' : ['base','website','web'],
'data': [
'views/partnership_website.xml',
'security/ir.model.access.csv',
],
'qweb' : [
],
'installable': True,
'auto_install': False,
'application': True,
'external_dependancies': [],
}

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import partnership_website

View File

@ -0,0 +1,58 @@
# _*_ coding: utf-
import logging
from odoo import http
from odoo.tools.translate import _
import json
import base64
from odoo.http import request
_logger = logging.getLogger(__name__)
from odoo.addons.web.controllers.main import serialize_exception,content_disposition
class PartnershipWebsite (http.Controller):
@http.route('/partnership_logos',type='http',auth='public', website=True)
def PartnerhsipPage (self,**kw):
partners = http.request.env['partnership.website'].sudo().search([('publish','=',True)],order="id desc")
list = self.get_partners(partners)
status = True
if not list:
status = False
return json.dumps({'status': status, 'content': list})
def get_partners(self,partners):
list = []
for l in partners:
record = {}
record['logo'] = "/web/binary/attachment?id=" + str(l.id) if l.logo else False
record['name'] = l.name
record['url'] = l.url
record['description'] = l.description
record['publish'] = l.publish
list.append(record)
return list
@http.route('/web/binary/attachment', type='http', auth="public", website=True)
# @serialize_exception
def attachment_document(self, id, filename=None, **kw):
res = request.env['partnership.website'].sudo().browse(int(id))
if res.logo:
filecontent = base64.b64decode(res.logo or '')
if not filename:
filename = '%s_%s' % ("partnership.website".replace('.', '_'), id)
status, headers, content = request.env['ir.http'].binary_content(
model='partnership.website',
id=int(id),
field='logo',
default_mimetype='application/octet-stream',
env=request.env
)
mimetype = dict(headers).get('Content-Type')
return request.make_response(filecontent,
[('Content-Type', mimetype),
('Content-Disposition', "attachment")])
return http.request.render("website.404_page")

View File

@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partnership_website
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-05 08:12+0000\n"
"PO-Revision-Date: 2023-08-05 08:12+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partnership_website
#: model:ir.ui.view,arch_db:partnership_website.partners_page
msgid "<i class=\"mdi mdi-arrow-top-right-thin-circle-outline\"/>\n"
" <span>Company Website</span>"
msgstr "<i class=\"mdi mdi-arrow-top-right-thin-circle-outline\"/>\n"
" <span>موقع الشركة</span>"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_description
msgid "About Compnay"
msgstr "عن الشركة"
#. module: partnership_website
#: model:ir.ui.menu,name:partnership_website.partnership_website_menu
msgid "Clients List"
msgstr "قائمة العملاء"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_logo
msgid "Company Logo"
msgstr "شعار الشركة"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_name
msgid "Company Name"
msgstr "اسم الشركة"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_url
msgid "Company Website"
msgstr "الموقع الإلكتروني للشركة"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_create_uid
msgid "Created by"
msgstr "أنشئ بواسطة"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_create_date
msgid "Created on"
msgstr "أنشئ في"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_display_name
msgid "Display Name"
msgstr "الاسم المعروض"
#. module: partnership_website
#: model:ir.ui.view,arch_db:partnership_website.partners_page
msgid "Expert A limited liability company with cadres with distinguished experience working in several fields serving information and communication technology and with a steady and renewed pace that proceeds to draw its vision within sublime standards and values that advance its services with distinguished and international expertise to keep pace with the desire and needs of its customers."
msgstr "خبير شركة ذات مسئوولية محدودة بكوادر ذات خبرة متميزة تعمل في عدة مجالات تخدم تقنية المعلومات و الإتصالات وبخطى ثابته و متجددة تمضي لترسم رؤيتها ضمن معايير وقيم سامية ترقى بخدماتها بخبرات متميزة وعالمية لتواكب رغبة واحتياج عملائها."
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_id
msgid "ID"
msgstr "المعرف"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website___last_update
msgid "Last Modified on"
msgstr "آخر تعديل في"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_write_uid
msgid "Last Updated by"
msgstr "آخر تحديث بواسطة"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_write_date
msgid "Last Updated on"
msgstr "آخر تحديث في"
#. module: partnership_website
#: model:ir.ui.view,arch_db:partnership_website.partners_page
msgid "Our Partners"
msgstr "شركاؤنا"
#. module: partnership_website
#: model:ir.actions.act_window,name:partnership_website.partnership_website_action
#: model:ir.ui.menu,name:partnership_website.partnership_base_menu
msgid "Partnership Website"
msgstr "الشركاء"
#. module: partnership_website
#: model:ir.model,name:partnership_website.model_partnership_website
msgid "Partnerships Website"
msgstr "الشركاء"
#. module: partnership_website
#: model:ir.model.fields,field_description:partnership_website.field_partnership_website_publish
msgid "Publish on Website"
msgstr "نشر على الموقع"

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import partnership_website

View File

@ -0,0 +1,21 @@
from odoo import models,fields,api,_
from datetime import datetime
from odoo.exceptions import ValidationError
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT,DEFAULT_SERVER_DATE_FORMAT
import re
import logging
_logger = logging.getLogger(__name__)
class PartnershipWeb (models.Model):
_name = 'partnership.website'
_description = 'Partnerships Website'
name = fields.Char(string="Company Name",required=True)
url = fields.Char(string="Company Website",required=True)
description = fields.Text(string="About Compnay",sanitize=True,required=True)
logo = fields.Binary(string='Company Logo',required=True)
publish = fields.Boolean(string='Publish on Website')

View File

@ -0,0 +1,2 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_model_partnership_website,access_partnership_website users,model_partnership_website,base.group_user,1,1,1,1
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 access_model_partnership_website access_partnership_website users model_partnership_website base.group_user 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,83 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan"
style="text-align: center;font-size: 25px;font-weight: 600;margin: 0px !important;color:#145374;">
ONE OF ODEX MODULES</h2>
<h6 class="oe_slogan" style="text-align: center;font-size: 18px;">
ODEX system is over than 200+ modules developed by love of Expert Company, based on ODOO system
<br/>
.to effectively suite's Saudi and Arabic market needs.It is the first Arabic open source ERP and all-in-one
solution
</h6>
</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: center;font-size: 25px;font-weight: 600;margin: 0px !important;color:#145374;">
Contact Us
</h2>
<br/>
<br/>
<div style="display:flex;padding-top: 20px;justify-content: space-between;">
<div style="flex-basis: 18%;"></div>
<div style="flex-basis: 18%;">
<div style="width:60px;height:60px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://exp-sa.com" target="_blank">
<img src="internet.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://exp-sa.com/" target="_blank">
www.exp-sa.com
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:60px;height:60px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://twitter.com/expcosa/" target="_blank">
<img src="twitter.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://twitter.com/expcosa/" target="_blank">
exposa
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:60px;height:60px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.linkedin.com/in/expert-company-52b5b812b/" target="_blank">
<img src="linkedin.png" style="width: 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.linkedin.com/in/expert-company-52b5b812b/" target="_blank">
exposa
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:60px;height:60px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://erp.exp-sa.com/contactus/" target="_blank">
<img src="mail.png" style="width: 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://erp.exp-sa.com/contactus/" target="_blank">
Info@exp-sa.com
</a>
</h3>
</div>
<div style="flex-basis: 18%;"></div>
</div>
</div>
</section>
<section class="oe_container oe_separator">
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,76 @@
.page-container {
background: rgb(24, 112, 117);
background: linear-gradient(236deg, rgb(24, 112, 117) 50%, rgb(12, 66, 100) 100%);
padding-top: 100px;
}
.page-container .page-header {
text-align: center;
border: none;
margin-bottom: 50px;
color: #fff;
}
.page-container .page-header h1 {
margin-bottom: 30px;
font-size: 40px;
}
.page-container .page-header p {
font-size: 14px;
padding: 0 100px;
line-height: 27px;
}
.page-container .partner-container {
margin-bottom: 50px;
}
.page-container .partner-container .partner-card {
margin-bottom: 20px;
}
.page-container .partner-container .partner-card .partner-body {
background-color: #fff;
border-radius: 8px;
padding: 0;
height: 300px;
overflow: hidden;
}
.page-container .partner-container .partner-card .partner-body .partner-logo {
height: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.page-container .partner-container .partner-card .partner-body .partner-logo img {
height: 60px;
}
.page-container .partner-container .partner-card .partner-body .partner-content {
height: 150px;
}
.page-container .partner-container .partner-card .partner-body .partner-content h3 {
margin-top: 0;
font-size: 16px;
font-weight: bold;
text-align: center;
color: #0c4264;
}
.page-container .partner-container .partner-card .partner-body .partner-content p {
font-size: 12px;
color: #a9a9a4;
text-align: center;
}
.page-container .partner-container .partner-card .partner-body .partner-link {
height: 50px;
display: flex;
align-items: center;
justify-content: center;
background-color: #e3ecec;
}
.page-container .partner-container .partner-card .partner-body .partner-link a {
margin-bottom: 0;
color: #197276;
}
.page-container .partner-container .partner-card .partner-body .partner-link a i {
font-size: 16px;
}
.page-container .partner-container .partner-card .partner-body .partner-link a:hover {
border-bottom: 1px solid #197276;
}
/*# sourceMappingURL=style.css.map */

View File

@ -0,0 +1 @@
{"version":3,"sourceRoot":"","sources":["../scss/style.scss"],"names":[],"mappings":"AAAA;EAEI;EACA;EACA;;AAEA;EAEI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;EACA;;AAIR;EAEI;;AAEA;EACI;;AACA;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAEA;EACI;;AAGR;EACI;;AACA;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;;AAGR;EACI;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAEA;EACI;;AAIJ;EACI","file":"style.css"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,87 @@
.page-container
{
background: rgb(24,112,117);
background: linear-gradient(236deg, rgba(24,112,117,1) 50%, rgba(12,66,100,1) 100%);
padding-top: 100px;
.page-header
{
text-align: center;
border: none;
margin-bottom: 50px;
color: #fff;
h1{
margin-bottom: 30px;
font-size: 40px;
}
p{
font-size: 14px;
padding: 0 100px;
line-height: 27px;
}
}
.partner-container
{
margin-bottom: 50px;
.partner-card{
margin-bottom: 20px;
.partner-body{
background-color: #fff;
border-radius: 8px;
padding: 0;
height: 300px;
overflow: hidden;
.partner-logo{
height: 100px;
display: flex;
align-items: center;
justify-content: center;
img{
height: 60px;
}
}
.partner-content{
height: 150px;
h3{
margin-top: 0;
font-size: 16px;
font-weight: bold;
text-align: center;
color: #0c4264;
}
p{
font-size: 12px;
color: #a9a9a4;
text-align: center;
}
}
.partner-link{
height: 50px;
display: flex;
align-items: center;
justify-content: center;
background-color: #e3ecec;
a{
margin-bottom: 0;
color: #197276;
i{
font-size: 16px;
}
span{}
&:hover{
border-bottom: 1px solid #197276;
}
}
}
}
}
}
}

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="partners_page" name="Partners">
<t t-call="website.layout">
<!-- Internal Styles -->
<link rel="stylesheet" href="/partnership_website/static/src/css/material_icon/materialdesignicons.css" />
<link rel="stylesheet" href="/partnership_website/static/src/css/style.css"/>
<!-- <script src="/socpa_employee_portal_websites/static/src/js/ads_script.js"></script> -->
<div class="oe_structure"/>
<div id="wrap">
<section class="container-fluid page-container">
<div class="row">
<div class="col-md-12 wrap-body">
<div class="container">
<div class="row">
<div class="col-md-12 page-header">
<h1>Our Partners</h1>
<p>Expert A limited liability company with cadres with distinguished experience working in several fields serving information and communication technology and with a steady and renewed pace that proceeds to draw its vision within sublime standards and values that advance its services with distinguished and international expertise to keep pace with the desire and needs of its customers.</p>
</div>
<div class="col-md-12 partner-container">
<t t-if="lists">
<t t-foreach="lists" t-as="item">
<div class="col-md-3 partner-card">
<div class="col-md-12 partner-body">
<div class="col-md-12 partner-logo">
<img t-att-src="'data:image/png;base64,'+item.logo.decode('utf-8')" />
</div>
<div class="col-md-12 partner-content">
<h3 t-esc="item.name"/>
<p t-esc="item.description"/>
</div>
<div class="col-md-12 partner-link">
<a t-att-href="item.url" target="_blank">
<i class="mdi mdi-arrow-top-right-thin-circle-outline"></i>
<span>Company Website</span>
</a>
</div>
</div>
</div>
</t>
</t>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</t>
</template>
</odoo>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Data records go here -->
<record id='partnership_website_action' model='ir.actions.act_window'>
<field name="name">Partnership Website</field>
<field name="res_model">partnership.website</field>
<field name="view_mode">tree,form</field>
<field name="arch" type="xml">
<form string="_form">
<sheet>
<group>
<field name="logo" widget="image" options="{'size': [90, 90]}"></field>
</group>
<group>
<field name="name" />
</group>
<group>
<field name="description" />
</group>
<group>
<field name="url" />
</group>
</sheet>
</form>
</field>
</record>
<record id="partnerhsip_website_view_tree" model="ir.ui.view">
<field name="name">Partnership List</field>
<field name="model">partnership.website</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="url" />
<field name="publish" />
</tree>
</field>
</record>
<menuitem name="Partnership Website" id="partnership_base_menu" />
<menuitem name="Clients List" id="partnership_website_menu" parent="partnership_base_menu" action="partnership_website_action" />
</odoo>

View File

@ -0,0 +1,14 @@
Most of the files are
Copyright (c) 2018-TODAY Bizople Solutions Pvt. Ltd.
Many files also contain contributions from third
parties. In this case the original copyright of
the contributions can be traced through the
history of the source version control system.
When that is not the case, the files contain a prominent
notice stating the original copyright and applicable
license, or come with their own dedicated COPYRIGHT
and/or LICENSE file.

View File

@ -0,0 +1,27 @@
Odoo Proprietary License v1.0
This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.
The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,6 @@
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
Moyasar Payment Gateway
* Intsall the requirement.txt file (available in document).
* Follow the document for the moyasar account configuration and odoo configuration

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from . import models
from . import controllers

View File

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
{
'name': 'Moyasar Payment Gateway',
'version': '14.0.0.1',
'category': 'Odex25-Website/Odex25-Website',
'sequence': 1,
'summary': 'Odoo Moyasar Payment Gateway',
'description': 'Odoo Moyasar Payment Gateway',
'author': 'Bizople Solutions Pvt. Ltd.',
'website': 'https://www.bizople.com/',
'depends': ['base','website_sale','sale'],
'data': [
'data/moyasar_data.xml',
'views/assets.xml',
'views/payment_acquirer.xml',
'views/moyasar_form.xml',
'views/payment_transaction_view.xml',
],
'images': [
'static/description/banner.png'
],
'installable': True,
'application': True,
'auto_install': False,
'license': 'OPL-1',
'price' : 100,
'currency': 'EUR',
'external_dependencies': {
"python" : ["moyasar"],
},
}

View File

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from . import main

View File

@ -0,0 +1,92 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from odoo import http
from odoo.http import request, content_disposition
import json
import moyasar
import logging
_logger = logging.getLogger(__name__)
class RedirectPayments(http.Controller):
@http.route(['/.well-known/apple-developer-merchantid-domain-association'], type='http', auth="public", website=True, sitemap=False)
def applepay_merchant_file(self,**post):
ir_attach = request.env['ir.attachment'].sudo().search([('res_model','=','payment.acquirer')],order="id desc",limit=1)
values={
'file_data' : ir_attach.raw.decode('ascii'),
}
return request.make_response(ir_attach.raw.decode('ascii'), headers=[
('Content-Type', 'application/pdf'),
('Content-Disposition', content_disposition('apple-developer-merchantid-domain-association')),
])
@http.route(['/payment-status-return'], type='http', auth="public",website=True, sitemap=False)
def get_moyasar_payment_status(self,**post):
status = post.get('status')
payment_id = post.get('id')
payment_aquirer = request.env['payment.acquirer'].sudo().search([('provider','=','moyasar')])
moyasar.api_key = payment_aquirer.moyasar_secret_key
payment = moyasar.Payment.fetch(str(payment_id))
order = request.website.sale_get_order()
_logger.info("****************Order Name*************: %s (%s)",order.name, order)
_logger.info("***************Payment Transaction************** : %s",order.transaction_ids)
_logger.info("***************** payment Response ****************** %s", payment)
if status == 'paid':
last_transaction = order.transaction_ids.search([],order="id desc",limit=1)
data = {
'reference': last_transaction.reference,
'currency' : last_transaction.currency_id.name,
'return_url' : '/payment/process',
'amount': last_transaction.amount
}
request.env['payment.transaction'].sudo().form_feedback(data,"moyasar")
tx = request.env['payment.transaction'].sudo().search([('reference', '=', data['reference'])], limit=1)
tx.write({'moyasar_payment_id' : payment_id })
tx._set_transaction_done()
return request.redirect("/payment/process")
else:
payment_message = str(payment)
payment_message_json = json.loads(payment_message)
error_message = payment_message_json.get('source').get('message')
value={
'error' : error_message,
'redirect' : '/shop/payment/validate',
}
last_transaction = order.transaction_ids.search([],order="id desc",limit=1)
data = {
'reference': last_transaction.reference,
'currency' : last_transaction.currency_id.name,
'return_url' : '/payment/process',
'amount': last_transaction.amount
}
request.env['payment.transaction'].sudo().form_feedback(data,"moyasar")
tx = request.env['payment.transaction'].sudo().search([('reference', '=', data['reference'])], limit=1)
tx._set_transaction_cancel()
return request.render('payment_moyasar_bizople.payment_error_temp',value)
@http.route(['/get/moyasar/order'], type='json', auth="public", website=True)
def savepayments(self, **post):
if 'portal_order' in post:
portal_order = post.get('portal_order')
order = request.env['sale.order'].sudo().browse(int(portal_order))
else:
order = request.website.sudo().sale_get_order()
amount= ''
if order.amount_total:
amount = order.amount_total
base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url')
payment_aquirer = request.env['payment.acquirer'].sudo().search([('provider','=','moyasar')])
values = {
'amount' : amount,
'public_key' : payment_aquirer.moyasar_public_key,
'callback_url' : base_url,
'currency' : order.currency_id.name,
'description' : order.name,
}
return values

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="payment_acquirer_ipay" model="payment.acquirer">
<field name="name">Moyasar</field>
<field name="image_128" type="base64" file="payment_moyasar_bizople/static/description/moyasar.png"/>
<field name="provider">moyasar</field>
<field name="description" type="html">
<p>
Online Payment Gateway from moyasar, Moyasar is a secure and user friendly way to receive online credit card payments.
</p>
<ul class="list-inline">
<li class="list-inline-item"><i class="fa fa-check"/>Online Payment</li>
<li class="list-inline-item"><i class="fa fa-check"/>Payment Status Tracking</li>
</ul>
</field>
<field name="moyasar_public_key">pk_test_cV9ucx9dhh7Vx3oi67Mr52kQu4XDuJrW4m3CZJ</field>
<field name="moyasar_secret_key">sk_test_r25UADVCrrcVnetAv2tUfe1kohZmz4i8Kvd7JA</field>
<field name="payment_icon_ids" eval='[(6, 0, [
ref("payment.payment_icon_cc_mastercard"),
ref("payment.payment_icon_cc_american_express"),
ref("payment.payment_icon_cc_visa")])]'/>
</record>
</data>
</odoo>

View File

@ -0,0 +1 @@
moyasar==0.6.5

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from . import payment_acquirer
from . import payment_transaction

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from odoo import _, api, fields, models
class PaymentAcquirerMoyasar(models.Model):
_inherit = 'payment.acquirer'
def _valid_field_parameter(self, field, name):
return name == 'domain'or super()._valid_field_parameter(field, name)
provider = fields.Selection(selection_add=[('moyasar', 'Moyasar')],ondelete={'moyasar': 'set default'})
moyasar_public_key = fields.Char(string='Public Key', required_if_provider='moyasar', domain="[('provider', '=', 'moyasar')]")
moyasar_secret_key = fields.Char(string='Secret Key', required_if_provider='moyasar', domain="[('provider', '=', 'moyasar')]")
apple_pay_file = fields.Binary("Applepay Merchant file", domain="[('provider', '=', 'moyasar')]")
@api.constrains('apple_pay_file')
def create_ir_attach_applepay(self):
attachment_id = self.env['ir.attachment'].sudo().create({
'name': 'apple-developer-merchantid-domain-association',
'type': 'binary',
'res_model': 'payment.acquirer',
'datas': self.apple_pay_file,
'access_token' : self.env['ir.attachment']._generate_access_token()
})
return attachment_id

View File

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Developed by Bizople Solutions Pvt. Ltd.
# See LICENSE file for full copyright and licensing details
from odoo import _, api, models, fields
class PaymentTransactionMoyasar(models.Model):
_inherit = 'payment.transaction'
moyasar_payment_id = fields.Char("Moyasar Id")

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,215 @@
<section style="padding:35px; background-color: #1b1b1b;">
<div class="row justify-content-md-between justify-content-center align-items-center py-2 mx-0">
<div>
<a href="https://www.bizople.com/" style="text-decoration:none;">
<img class="img img-fluid" style="height: 80px; text-align: center;" src="https://www.bizople.com/web/image/website/1/logo/Bizople%20Solutions%20Pvt.%20Ltd.?unique=6a33a9d"></img>
</a>
</div>
<div class="s_btn text-center pt0" data-name="Button">
<a href="#" target="_blank" class="btn btn-outline-primary btn-lg" style="background-color: transparent !important; border: 1px solid #fff; border-radius: 0px; color:white; font-family:Montserrat;"> <i class="fa fa-check-square-o"></i> Community</a>
<a href="#" target="_blank" class="btn btn-outline-primary btn-lg" style="background-color: transparent !important; border: 1px solid #fff; border-radius: 0px; color:white; font-family:Montserrat;"> <i class="fa fa-check-square-o"></i> Enterprise</a>
<a href="#" target="_blank" class="btn btn-outline-primary btn-lg" style="background-color: transparent !important; border: 1px solid #fff; border-radius: 0px; color:white; font-family:Montserrat;"> <i class="fa fa-check-square-o"></i> Odoo.sh</a>
<div>
<a href="mailto:info@bizople.com" class="btn btn-primary btn-lg mt16" style="background-color: #399DDB; border: 1px solid #399DDB; border-radius: 0px; color:white; font-family: Montserrat;">Email Us</a>
<a href="skype:live:bizoples?chat" class="btn btn-primary btn-lg mt16" style="background-color: #399DDB; border: 1px solid #399DDB; border-radius: 0px; color:white; font-family: Montserrat;">Skype</a>
</div>
</div>
<div>
<img class="img img-fluid" style="height: 80px; text-align: center;" src="odoo_ready_partner_logo.png"></img>
</div>
</div>
</section>
<section class="container">
<div class="row">
<div class="col-md-12">
<h2 class="oe_slogan" style="color: #020a17;font-size: 33px;font-weight: 500;font-family: Montserrat;border: 4px solid #020a17;padding: 27px;">Moyasar Payment Gateway</h2>
</div>
<div class="col-md-12 mb16">
<p class="text-center" style="font-size: 21px;">
This module will plugin the Moyasar Payment Gateway with Odoo, so the customer will be able to use the Moyasar payment acquirer in the payment method for website.
</p>
<p class="text-center" style="font-size: 21px;">Moyasar payment method will provide you with an option of Card payment, STC Pay, and Apple pay.</p>
</div>
</div>
</section>
<section class="container oe_dark mt8" style="padding: 16px 39px;">
<h4 class="mt16" style="font-size: 23px; color: #0e96f6;">Main Features</h4>
<div class="row">
<ul>
<li style="font-size: 19px;padding: 8px 0px;">Cards Payment</li>
<li style="font-size: 19px;padding: 8px 0px;">StcPay</li>
<li style="font-size: 19px;padding: 8px 0px;">ApplePay</li>
</div>
</section>
<section class="container">
<div class="row">
<div class="col-md-12 mt16 mb16">
<h4 class="oe_slogan">Configuration For Moyasar Payment Gateway</h4>
<p class="">
<center style="font-size: 16px;">Go to Website > Configuration > Payment Acquirers</center><br/>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="payment_acquirer.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">Also you have to activate moyasar.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="moyasar_active.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">Configure credentials and enable payment method.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="moyasar_api_conf.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">Choose moyaser method.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="payment_moyasar.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">Fill popup for the payment.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="popup.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">Moyasar also provide ApplePay option.
</center>
</p>
<h4 class="mt16" style="font-size: 16px;">As per Moyasar, Apple Pay is available on the following platforms:</h4>
<div>
<ul>
<li style="font-size: 14px;padding: 8px 0px;">Safari iOS 10 and later</li>
<li style="font-size: 14px;padding: 8px 0px;">Safari macOS 10.12 and later</li>
</ul>
</div>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="applepay.jpeg">
</div>
</div>
<div class="row">
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="account_page.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">If payment is success then you will see confirmation page with suceess message.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="payment_success.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 16px;">If payment is Fail then you will see confirmation page with Failed message.</center>
</p>
</div>
<div class="col-md-12 mt8 text-center">
<img class="img img-fluid oe_screenshot" src="payment_failed.png">
</div>
</div>
<div class="row">
<div class="col-md-12 mt16 mb16">
<h4 class="oe_slogan">Pay with moyasar from the portal</h4>
</div>
<div class="col-md-6 mt8 text-center">
<p class="text-center mb-3" style="font-size: 16px;">
Select Moyasar option in the acquirer list.
</p>
<img class="img img-fluid oe_screenshot" src="portal_payment_option.png">
</div>
<div class="col-md-6 mt8 text-center">
<p class="text-center mb-3" style="font-size: 16px;">
A Modal will be visible for the payment through Moyasar.
</p>
<img class="img img-fluid oe_screenshot" src="portal_moyasar_pay.png">
</div>
<div class="col-md-12 mt8 text-center">
<p class="text-center mb-3" style="font-size: 16px;">
On Payment success, The portal Sales Order will display the success message.
</p>
<img class="img img-fluid oe_screenshot" src="portal_payment_confirm.png">
</div>
<div class="col-md-12 mt16 mb16">
<p class="">
<center style="font-size: 20px;">NOTE: You will find the full documentation in the module folder.</center>
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="alert alert-info mb-0" style="background-color:#399ddb; color:white; font-size:29px; border-radius:0px">
<h1 style="font-size:21px"><strong>Note :- </strong> This Product is developed and tested with Odoo Addons for declared compatible versions and does not guarantee compatibility with any 3rd party module.
<a href="mailto:support@bizople.com" style="color:#020a17">Contact us</a> for more information or in case of any trouble with this module.
</h1>
</div>
</section>
<section class="mb32" style="padding:60px; text-align:center; background-color:#020a17">
<div class="container">
<span href="https://www.bizople.com/" style="text-decoration:none">
<img class="img img-fluid" style="height:80px; text-align:center" src="https://www.bizople.com/web/image/website/1/logo/Bizople Solutions Pvt. Ltd.?unique=6a33a9d">
<p style="color:white; margin:44px 0px; font-size:21px; font-family:Montserrat">Bizople Solutions is a team of technocrats highly experienced in ERP Implementation and Customization.We work everyday to provide the best solutions with our excellence in the various area of digitization to grow the business revenue of our clients. Our young technology people love to help the customer with the most satisfactory service in Odoo ERP and E-commerce + Theme Development.</p>
</span>
<div>
<div class="s_btn text-center pt0 pb16" data-name="Button">
<span href="https://www.bizople.com/services" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid white; border-radius:0px; color:white; font-family:Montserrat"> Our Odoo Services</span>
<span href="https://www.bizople.com/contactus" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid white; border-radius:0px; color:white; font-family:Montserrat"> Hire Odoo Developer</span>
<a href="mailto:info@bizople.com" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid white; border-radius:0px; color:white; font-family:Montserrat">Email Us</a>
<a href="skype:live:bizoples?chat" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid white; border-radius:0px; color:white; font-family:Montserrat">Skype</a>
</div>
<div class="s_btn text-center pt0 pb48" data-name="Button">
<a href="https://apps.odoo.com/apps/modules/browse?search=bizople" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid #399ddb; border-radius:0px; color:white; font-family:Montserrat; font-size:20px"> <i class="fa fa-file-code-o"></i> All Apps</a>
<a href="https://apps.odoo.com/apps/themes/browse?search=bizople" class="btn btn-outline-primary btn-lg mt16 mb16" style="border:1px solid #399ddb; border-radius:0px; color:white; font-family:Montserrat; font-size:20px"> <i class="fa fa-eyedropper"></i> All Themes</a>
</div>
<span class="oe_share_facebook" href="https://www.facebook.com/bizople/" style="margin-right:8px; font-size:20px; width:40px; height:40px; display:inline-block; line-height:40px; text-align:center; color:#399DDB">
<i class="fa fa-facebook"></i>
</span>
<span class="oe_share_twitter" href="https://twitter.com/bizoples" style="margin-right:8px; font-size:20px; width:40px; height:40px; display:inline-block; line-height:40px; text-align:center; color:#399DDB">
<i class="fa fa-twitter"></i>
</span>
<span class="_blank" href="https://www.linkedin.com/company/bizople-solutions" style="margin-right:8px; font-size:20px; width:40px; height:40px; display:inline-block; line-height:40px; text-align:center; color:#399DDB">
<i class="fa fa-linkedin"></i>
</span>
<a class="_blank" href="https://www.youtube.com/channel/UCpAQZ63QOhlINj46Wbtd_HA" style="margin-right:8px; font-size:20px; width:40px; height:40px; display:inline-block; line-height:40px; text-align:center; color:#399DDB">
<i class="fa fa-youtube-play"></i>
</a>
</div>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -0,0 +1,78 @@
odoo.define('payment_moyasar_bizople.payment_moyasara_js', require => {
'use strict';
const core = require('web.core');
var publicWidget = require('web.public.widget');
const ajax = require('web.ajax');
publicWidget.registry.MoyasarModal = publicWidget.Widget.extend({
selector: '.moyasar-modal',
events: {
'click .close-moyasar-form' : '_CloseMoyasarForm',
},
_CloseMoyasarForm : function(){
console.log("CLOSED")
$('#wrapwrap').css('z-index',1051)
window.location.reload();
},
});
publicWidget.registry.MoyasarFormRender = publicWidget.Widget.extend({
selector: '#payment_method',
start : function(){
this._super(...arguments);
var portal_order = $('#quote_content').find('#portal_order_id').val()
ajax.jsonRpc("/get/moyasar/order",'call',{
'data':true,
'portal_order': portal_order,
}).then(function(data){
var amount = data['amount']
var public_key = data['public_key']
var callback_url = data['callback_url']
var currency = data['currency']
var description = data['description']
if(currency == 'SAR'){
amount = amount*100
}else if(currency == 'USD'){
amount = amount*100
}else if(currency == 'KWD'){
amount = amount*1000
}else if (currency == 'JPY'){
amount = amount
}else{
amount = amount*100
}
Moyasar.init({
element: '.mysr-form',
// Amount in the smallest currency unit
// For example:
// 10 SAR = 10 * 100 Halalas
// 10 KWD = 10 * 1000 Fils
// 10 JPY = 10 JPY (Japanese Yen does not have fractions)
amount: amount.toFixed(),
currency: currency,
description: description,
publishable_api_key: public_key,
callback_url: callback_url+'/payment-status-return',
methods: [
'creditcard',
'stcpay',
'applepay'
],
apple_pay: {
country: 'SA',
label: 'Test Merchant',
supported_countries: ['SA', 'US'],
validate_merchant_url: 'https://api.moyasar.com/v1/applepay/initiate',
validation_url: 'https://apple-pay-gateway.apple.com/paymentservices/paymentSession',
}
});
})
},
});
});

View File

@ -0,0 +1,65 @@
odoo.define('payment_moyasar_bizople.payment_form_mixin_moyasar', require => {
'use strict';
var ajax = require('web.ajax');
var core = require('web.core');
var Dialog = require('web.Dialog');
var PaymentForm = require('payment.payment_form');
PaymentForm.include({
payEvent: function (ev) {
ev.preventDefault();
var $checkedRadio = this.$('input[type="radio"]:checked');
if ($checkedRadio.length === 1 && $checkedRadio.data('provider') === 'moyasar') {
return this._createMoyasarToken(ev, $checkedRadio);
} else {
return this._super.apply(this, arguments);
}
},
_createMoyasarToken: function(ev){
ev.preventDefault();
var form = this.el;
var checked_radio = this.$('input[type="radio"]:checked');
var self = this;
if (ev.type === 'submit') {
var button = $(ev.target).find('*[type="submit"]')[0]
}else {
var button = ev.target;
}
if (checked_radio.length === 1) {
checked_radio = checked_radio[0];
var acquirer_id = this.getAcquirerIdFromRadio(checked_radio);
var acquirer_form = false;
if (this.isNewPaymentRadio(checked_radio)) {
acquirer_form = this.$('#o_payment_add_token_acq_' + acquirer_id);
} else {
acquirer_form = this.$('#o_payment_form_acq_' + acquirer_id);
}
var inputs_form = $('input', acquirer_form);
var ds = $('input[name="data_set"]', acquirer_form)[0];
var $tx_url = this.$el.find('input[name="prepare_tx_url"]');
if ($tx_url.length === 1) {
var form_save_token = acquirer_form.find('input[name="o_payment_form_save_token"]').prop('checked');
return this._rpc({
route: $tx_url[0].value,
params: {
'acquirer_id': parseInt(acquirer_id),
'save_token': form_save_token,
'access_token': self.options.accessToken,
'success_url': self.options.successUrl,
'error_url': self.options.errorUrl,
'callback_method': self.options.callbackMethod,
'order_id': self.options.orderId,
'invoice_id': self.options.invoiceId,
},
}).then(function (result) {
if (result) {
$('#moyasarpayment').modal({ show: true, keyboard: false, backdrop: "static" });
$('#wrapwrap').css('z-index',1051)
}
})
}
}
}
})
})

View File

@ -0,0 +1,15 @@
.moyasar-modal{
.modal-header{
padding : 0px;
.close-moyasar-form{
font-size: 20px;
cursor: pointer;
padding:5px;
align-items: center;
width: 29px;
height: 29px;
display: flex;
justify-content: center;
}
}
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="_assets_primary_variables" inherit_id="web.assets_frontend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/payment_moyasar_bizople/static/src/scss/moyasar_form.scss"/>
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/payment_moyasar_bizople/static/src/js/moyasar_form.js"></script>
<script type="text/javascript" src="/payment_moyasar_bizople/static/src/js/payment_mixin.js"></script>
</xpath>
</template>
</odoo>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="moyasar_head_content" name="Website Configurator" inherit_id="web.frontend_layout">
<xpath expr="//head" position="inside">
<!-- Moyasar Styles -->
<link rel="stylesheet" href="https://cdn.moyasar.com/mpf/1.7.3/moyasar.css" />
<!-- Moyasar Scripts -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=fetch"></script>
<script src="https://cdn.moyasar.com/mpf/1.7.3/moyasar.js"></script>
</xpath>
</template>
<template id="moyasar_redirect" name="Moyasar-Form">
<form accept-charset="UTF-8" action="/moyasar/payment" method="POST">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<button type="submit">Pay</button>
</form>
</template>
<template id="payment_error_temp">
<div style="text-align: center;padding: 60px 40px;border-style: groove;margin: 60px 120px;">
<h4 style="margin-bottom: 25px;"><t t-esc="error"/></h4>
<a t-att-href="redirect" style="width: 115px;height: 25px;background: #4E9CAF;padding: 12px 50px;text-align: center;border-radius: 5px;color: white;font-weight: bold;line-height: 25px;text-decoration: none;">Go Back</a>
</div>
</template>
<template id="portal_layout_moyasar_paymeneform_popup" name="Moyasar Popup Form Layout" inherit_id="website_sale.payment">
<xpath expr="//." position="inside">
<t t-if="acquirers or tokens">
<t t-set="moyasar" t-value="request.env['payment.acquirer'].sudo().search([('provider','=','moyasar')])"/>
<t t-if="moyasar.state in ['test','enabled']" t-call="payment_moyasar_bizople.moyasar_popup_form_template"/>
</t>
</xpath>
</template>
<template id="moyasar_popup_form_template" name="Moyasar Form Popup Template">
<div class="modal fade moyasar-modal" id="moyasarpayment" tabindex="-1" role="dialog" aria-labelledby="moyasarpayment" aria-hidden="true" style="z-index:1051;">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content bg-o-color-3">
<div class="modal-header ml-auto border-0">
<a class="btn close-moyasar-form" data-dismiss="modal">
<span class="fa fa-close align-middle"></span>
</a>
</div>
<div class="modal-body p-0">
<div class="row m-0">
<div class="col-md-12">
<div class="w-100">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-moyasar-gateway" role="tabpanel" aria-labelledby="nav-moyasar-form-tab">
<div class="mysr-form mt-5"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<template id="payment_moyasar_sale_order_portal_template" inherit_id="sale.sale_order_portal_template" name="Moyasar Sales Order Portal Template">
<xpath expr="//div[@id='quote_content']/div[@id='modalaccept']" position="before">
<t t-if="pms or acquirers">
<t t-set="moyasar" t-value="request.env['payment.acquirer'].sudo().search([('provider','=','moyasar')])"/>
<t t-if="moyasar.state in ['test','enabled']" t-call="payment_moyasar_bizople.moyasar_popup_form_template"/>
</t>
</xpath>
<xpath expr="//div[@id='quote_content']/*" position="before">
<input id="portal_order_id" type="hidden" t-att-value="sale_order.id"/>
</xpath>
</template>
</odoo>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_acquirer_form_moyasar" model="ir.ui.view">
<field name="name">Moyasar Acquirer Form</field>
<field name="model">payment.acquirer</field>
<field name="inherit_id" ref="payment.acquirer_form"/>
<field name="arch" type="xml">
<xpath expr='//group[@name="acquirer"]' position='inside'>
<group attrs="{'invisible': [('provider', '!=', 'moyasar')]}">
<field name="moyasar_public_key"/>
<field name="moyasar_secret_key"/>
<field name="apple_pay_file"/>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_transaction_form_moyasar" model="ir.ui.view">
<field name="name">Moyasar Acquirer Form</field>
<field name="model">payment.transaction</field>
<field name="inherit_id" ref="payment.transaction_form"/>
<field name="arch" type="xml">
<xpath expr='//field[@name="reference"]' position='after'>
<field name="moyasar_payment_id" attrs="{'invisible': [('provider', '!=', 'moyasar')]}"/>
</xpath>
</field>
</record>
</odoo>