Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Redner Odoo Module
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Redner Odoo Module
Commits
675d6b46fd69
Commit
675d6b46fd69
authored
7 months ago
by
Axel Prel
Browse files
Options
Downloads
Patches
Plain Diff
add 'view in redner' button in form
parent
17eaa0a5ce23
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/redner_template.py
+20
-1
20 additions, 1 deletion
models/redner_template.py
views/redner_template.xml
+10
-0
10 additions, 0 deletions
views/redner_template.xml
with
30 additions
and
1 deletion
models/redner_template.py
+
20
−
1
View file @
675d6b46
...
...
@@ -23,7 +23,7 @@
from
odoo
import
_
,
api
,
fields
,
models
from
odoo.exceptions
import
ValidationError
from
..redner
import
Redner
from
..redner
import
REDNER_API_PATH
,
Redner
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -271,3 +271,22 @@
body_format
=
body_format
,
version
=
fields
.
Datetime
.
to_string
(
fields
.
Datetime
.
now
()),
)
def
redner_url
(
self
):
if
self
.
redner_id
is
None
:
return
""
return
(
self
.
redner
.
server_url
.
removesuffix
(
REDNER_API_PATH
)
+
"
template/
"
+
self
.
redner
.
account
+
"
/
"
+
self
.
redner_id
)
def
view_in_redner
(
self
):
return
{
"
type
"
:
"
ir.actions.act_url
"
,
"
url
"
:
self
.
redner_url
(),
"
target
"
:
"
new
"
,
}
This diff is collapsed.
Click to expand it.
views/redner_template.xml
+
10
−
0
View file @
675d6b46
...
...
@@ -32,6 +32,16 @@
<field
name=
"model"
>
redner.template
</field>
<field
name=
"arch"
type=
"xml"
>
<form>
<header>
<field
name=
"redner_id"
invisible=
"1"
/>
<button
name=
"view_in_redner"
type=
"object"
string=
"View in Redner"
class=
"oe_highlight"
invisible=
"redner_id == False"
/>
</header>
<sheet>
<div
class=
"oe_button_box"
name=
"button_box"
>
<button
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment