-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8272680
commit 06e16d2
Showing
8 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
sign_oca/static/src/components/sign_oca_preview/sign_oca_preview.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
odoo.define( | ||
"sign_oca/static/src/components/sign_oca_preview/sign_oca_preview.js", | ||
function (require) { | ||
"use strict"; | ||
|
||
const {ComponentWrapper} = require("web.OwlCompatibility"); | ||
const AbstractAction = require("web.AbstractAction"); | ||
const Dialog = require("web.Dialog"); | ||
const core = require("web.core"); | ||
var ControlPanel = require("web.ControlPanel"); | ||
const SignOcaPdfCommon = require("sign_oca/static/src/components/sign_oca_pdf_common/sign_oca_pdf_common.js"); | ||
const _t = core._t; | ||
|
||
const SignOcaPreviewAction = AbstractAction.extend({ | ||
hasControlPanel: true, | ||
init: function (parent, action) { | ||
this._super.apply(this, arguments); | ||
this.model = | ||
(action.params.res_model !== undefined && | ||
action.params.res_model) || | ||
action.context.params.res_model; | ||
this.res_id = | ||
(action.params.res_id !== undefined && action.params.res_id) || | ||
action.context.params.id; | ||
}, | ||
async start() { | ||
await this._super(...arguments); | ||
this.component = new ComponentWrapper(this, SignOcaPdfCommon, { | ||
model: this.model, | ||
res_id: this.res_id, | ||
}); | ||
this.$el.addClass("o_sign_oca_action"); | ||
return this.component.mount(this.$(".o_content")[0]); | ||
}, | ||
getState: function () { | ||
var result = this._super(...arguments); | ||
result = _.extend({}, result, { | ||
res_model: this.model, | ||
res_id: this.res_id, | ||
}); | ||
return result; | ||
}, | ||
}); | ||
|
||
core.action_registry.add("sign_oca_preview", SignOcaPreviewAction); | ||
|
||
return { | ||
SignOcaPreviewAction, | ||
}; | ||
} | ||
); |
9 changes: 9 additions & 0 deletions
9
sign_oca/static/src/components/sign_oca_preview/sign_oca_preview.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates xml:space="preserve"> | ||
<t | ||
t-name="sign_oca.SignOcaPreview" | ||
t-inherit="sign_oca.SignOcaPdfCommon" | ||
t-inherit-mode="primary" | ||
owl="1" | ||
/> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters