diff --git a/odex25_donation/ensan_dynamic_dedicationcard/__init__.py b/odex25_donation/ensan_dynamic_dedicationcard/__init__.py index 13a2c14d5..5397a5692 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/__init__.py +++ b/odex25_donation/ensan_dynamic_dedicationcard/__init__.py @@ -1,2 +1 @@ from . import controller -from . import models \ No newline at end of file diff --git a/odex25_donation/ensan_dynamic_dedicationcard/__manifest__.py b/odex25_donation/ensan_dynamic_dedicationcard/__manifest__.py index 1d4ad3075..593192f29 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/__manifest__.py +++ b/odex25_donation/ensan_dynamic_dedicationcard/__manifest__.py @@ -1,30 +1,16 @@ # -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. { - 'name' : 'ensan dynamic dedicationcard', - 'version' : '1.0', + 'name': 'ensan dynamic dedicationcard', + 'version': '1.0', 'summary': 'ensan dynamic dedicationcard', 'description': """ -ensan dynamic dedicationcard -==================== -get dynamic dedicationcard via url """, - 'depends' : ['product'], - 'assets': { - 'web.assets_backend': [ - 'ensan_dynamic_dedicationcard/static/src/css/style.css', - ], - # 'web.assets_frontend': [ - # 'ensan_dynamic_dedicationcard/static/src/css/style.css', - # ], - }, - 'data': [ - 'views/gift_template.xml', - #'views/product_template_view.xml', - - - - ], - "images": ['img/7_page-0001.jpg','img/top121.jpg','img/bottom121.jpg'], + ensan dynamic dedicationcard + ==================== + get dynamic dedicationcard via url + """, + 'depends': ['product', 'sale', 'ensan_sale_management'], + 'data': ['views/gift_template.xml'], + "images": ['img/7_page-0001.jpg', 'img/top121.jpg', 'img/bottom121.jpg'], } diff --git a/odex25_donation/ensan_dynamic_dedicationcard/controller/__init__.py b/odex25_donation/ensan_dynamic_dedicationcard/controller/__init__.py index aeb925232..5397a5692 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/controller/__init__.py +++ b/odex25_donation/ensan_dynamic_dedicationcard/controller/__init__.py @@ -1,2 +1 @@ from . import controller -#from . import mycontroller \ No newline at end of file diff --git a/odex25_donation/ensan_dynamic_dedicationcard/controller/controller.py b/odex25_donation/ensan_dynamic_dedicationcard/controller/controller.py index 516713db2..a315a8570 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/controller/controller.py +++ b/odex25_donation/ensan_dynamic_dedicationcard/controller/controller.py @@ -1,58 +1,21 @@ from odoo import http -from odoo.exceptions import AccessError, UserError from odoo.http import request -from odoo.tools import consteq, file_open -from odoo.tools.misc import get_lang from odoo.tools.translate import _ -from werkzeug.exceptions import NotFound -import datetime -import logging -import os -import re -import tempfile - -from lxml import html - -import odoo -import odoo.modules.registry -from odoo import http -from odoo.http import content_disposition, dispatch_rpc, request, Response -from odoo.service import db -from odoo.tools.misc import file_open, str2bool -from odoo.tools.translate import _ - -from odoo.addons.base.models.ir_qweb import render as qweb_render -import logging -from cryptography.fernet import Fernet - -_logger = logging.getLogger(__name__) - - - class Controller(http.Controller): - @http.route( - ['/card/', - '/ar/card/', - '/en/card/', - ], - methods=['GET'], type='http', auth='public') - def mail_init_messaging_custom(self,order='', **kwargs): - values = dict(kwargs) - - + @http.route(['/card/'], methods=['GET'], type='http', auth='public') + def mail_init_messaging_custom(self, order='', **kwargs): name = None from_person = 'فاعل خير ' to_person = 'المهدى إليه' - sale_order_extra_donators_line = request.env['sale.order.extra_donators'].sudo().search([('id','=',order[3:-3])]) + sale_order_extra_donators_line = request.env['sale.order.extra_donators'].sudo().search([('id', '=', order[3:-3])]) if sale_order_extra_donators_line.product_id.name: - name =sale_order_extra_donators_line.product_id.name + name = sale_order_extra_donators_line.product_id.name if sale_order_extra_donators_line.sale_id.order_name: - from_person = sale_order_extra_donators_line.sale_id.order_name + from_person = sale_order_extra_donators_line.sale_id.order_name if sale_order_extra_donators_line.donator_name: - to_person = sale_order_extra_donators_line.donator_name - + to_person = sale_order_extra_donators_line.donator_name return request.render('ensan_dynamic_dedicationcard.gift_template_id', {'records': [name], 'from_persons': [from_person], 'to_persons': [to_person]}) diff --git a/odex25_donation/ensan_dynamic_dedicationcard/controller/mycontroller.py b/odex25_donation/ensan_dynamic_dedicationcard/controller/mycontroller.py deleted file mode 100644 index d31dbf578..000000000 --- a/odex25_donation/ensan_dynamic_dedicationcard/controller/mycontroller.py +++ /dev/null @@ -1,24 +0,0 @@ -from odoo import http -from odoo.http import request - -class MyController(http.Controller): - - @http.route('/my_controller/post', type='http', auth="public", methods=['GET', 'POST']) - def post_method(self, **post): - - # Access the posted data using the 'post' dictionary - name = post.get('name') - from_person = post.get('from_person') - to_person = post.get('to_person') - - print(name,'name') - print(from_person,'from_person') - print(to_person,'to_person') - - - # Perform necessary actions with the posted data - # Add your code here - - # Return an HTTP response if needed - return request.render('ensan_dynamic_dedicationcard.gift_template_id', - {'records': [name], 'from_persons': [from_person], 'to_persons': [to_person]}) \ No newline at end of file diff --git a/odex25_donation/ensan_dynamic_dedicationcard/models/__init__.py b/odex25_donation/ensan_dynamic_dedicationcard/models/__init__.py deleted file mode 100644 index d2e1a251b..000000000 --- a/odex25_donation/ensan_dynamic_dedicationcard/models/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#from . import product_template \ No newline at end of file diff --git a/odex25_donation/ensan_dynamic_dedicationcard/models/product_template.py b/odex25_donation/ensan_dynamic_dedicationcard/models/product_template.py deleted file mode 100644 index e143331cd..000000000 --- a/odex25_donation/ensan_dynamic_dedicationcard/models/product_template.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, models,fields -import requests - - -class ProductTemplate(models.Model): - _inherit = 'product.template' - - - def do_post_request(self,name='dedication',from_person='shehab',to_person='gamal'): - - url = 'http://ensan.varietyit.com/my_controller/post' # Replace with your Odoo server URL and route - # Define the data to be sent in the POST request - data = { - 'name':name, - 'from_person': from_person, - 'to_person': to_person, - } - - # Make the POST request - response = requests.post(url, data=data) - - # Check the response status code and content - if response.status_code == 200: - print('POST request successful!') - print('Response:', response.content.decode()) - else: - print('POST request failed!') - print('Response:', response.content.decode()) diff --git a/odex25_donation/ensan_dynamic_dedicationcard/static/src/css/style.css b/odex25_donation/ensan_dynamic_dedicationcard/static/src/css/style.css index d81279eae..2bfef74ed 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/static/src/css/style.css +++ b/odex25_donation/ensan_dynamic_dedicationcard/static/src/css/style.css @@ -19,7 +19,69 @@ font-family:'traditional_arabic';;font-weight:100;font-size: 13px; .arabic{ font-family:GretaArabicBold !important; +} +.container { + width: 100%; +} + +.name-heading { + border-bottom: 5px solid #216b5e; + width: 100%; + text-align: center; + font-size: 8vw !important; + color: #216b5e; + font-weight: bold; + font-family: GretaArabicBold; +} + +.person-table { + border-radius: 50px; + border-right-style: solid; + border-left-style: solid; + border-bottom-style: solid; + border-top-style: solid; + border-bottom-right-radius: 22px; + border-top-right-radius: 22px; + border-top-left-radius: 22px; + border-bottom-left-radius: 22px; + border-spacing: 0 11px; + margin-top: -20px; + margin-bottom: -10px; + color: black; + border-color: white; +} + +.person-row { + border-radius: 25px; + padding: 1pt; + margin: 0pt; + font-weight: bold; + text-align: center; + background-color: #eaecee; + border: 2px solid red; + border-radius: 25px; + border-color: white; +} + +.person-cell { + padding-left: 20px; + padding-right: 20px; + font-size: 4.5vw; + color: #2bab98; + font-weight: bold; + text-align: center; + border-color: white; + font-family: GretaArabicBold; +} + +.person-label { + font-size: 4.5vw; + color: #2bab98; + font-weight: bold; + text-align: center; + border-color: white; + font-family: GretaArabicBold; } diff --git a/odex25_donation/ensan_dynamic_dedicationcard/views/gift_template.xml b/odex25_donation/ensan_dynamic_dedicationcard/views/gift_template.xml index 0fc9391d5..00c49d309 100644 --- a/odex25_donation/ensan_dynamic_dedicationcard/views/gift_template.xml +++ b/odex25_donation/ensan_dynamic_dedicationcard/views/gift_template.xml @@ -1,100 +1,49 @@ -