summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-03-31 14:01:35 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-03-31 14:01:35 +0700
commit92ca4ca8d5e16a90c1cfa8d00248c1e12c95d9fd (patch)
tree2069fd0295c5538e8023dc7c3331e6470dd7acea /indoteknik_custom
parent690903a2cc7a83e8ec2453a703241539016036b6 (diff)
parent4cbb23cd48f70788d440a55b552b6fa3be44ddfe (diff)
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
Diffstat (limited to 'indoteknik_custom')
-rwxr-xr-xindoteknik_custom/__init__.py3
-rw-r--r--indoteknik_custom/controllers/__init__.py1
-rw-r--r--indoteknik_custom/controllers/website.py36
-rw-r--r--indoteknik_custom/views/account_move.xml2
4 files changed, 41 insertions, 1 deletions
diff --git a/indoteknik_custom/__init__.py b/indoteknik_custom/__init__.py
index 0650744f..19240f4e 100755
--- a/indoteknik_custom/__init__.py
+++ b/indoteknik_custom/__init__.py
@@ -1 +1,2 @@
-from . import models
+from . import controllers
+from . import models \ No newline at end of file
diff --git a/indoteknik_custom/controllers/__init__.py b/indoteknik_custom/controllers/__init__.py
new file mode 100644
index 00000000..02ab5287
--- /dev/null
+++ b/indoteknik_custom/controllers/__init__.py
@@ -0,0 +1 @@
+from . import website \ No newline at end of file
diff --git a/indoteknik_custom/controllers/website.py b/indoteknik_custom/controllers/website.py
new file mode 100644
index 00000000..2e3df519
--- /dev/null
+++ b/indoteknik_custom/controllers/website.py
@@ -0,0 +1,36 @@
+from odoo.http import request, Controller
+from odoo import http, _
+
+class Website(Controller):
+ @http.route('/content', auth='public')
+ def content(self, **kw):
+ url = kw.get('url', '')
+ iframe = f"<iframe src='{url}' onload='hideHeader(this)' ></iframe>"
+ style = '''
+ <style>
+ iframe {
+ border: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 100vh;
+ }
+ </style>
+ '''
+ script = '''
+ <script>
+ const hideHeader = (iframe) => {
+ var header = iframe.contentWindow.document.querySelector('header');
+ if (header) {
+ header.style.display = 'none';
+ }
+ var footer = iframe.contentWindow.document.querySelector('footer');
+ if (footer) {
+ footer.style.display = 'none';
+ }
+ }
+ </script>
+ '''
+ content = '<!DOCTYPE html><html>' + '<body>' + iframe + style + script + '</body>' + '</html>'
+ return request.make_response(content, [('Access-Control-Allow-Origin', '*'), ('Access-Control-Allow-Headers', '*')]) \ No newline at end of file
diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml
index 4c99692d..9faf3149 100644
--- a/indoteknik_custom/views/account_move.xml
+++ b/indoteknik_custom/views/account_move.xml
@@ -34,6 +34,8 @@
<field name="payment_state" position="after">
<field name="invoice_payment_term_id"/>
<field name="date_kirim_tukar_faktur"/>
+ <field name="shipper_faktur_id" optional="1"/>
+ <field name="resi_tukar_faktur" optional="1"/>
<field name="date_terima_tukar_faktur"/>
</field>
</field>