@ -0,0 +1,50 @@ |
|||
.. image:: https://img.shields.io/badge/license-OPL--1-red.svg |
|||
:target: https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps |
|||
:alt: License: OPL-1 |
|||
|
|||
Website Sign Sending By Priority |
|||
================================= |
|||
This module helps to send the mail or document in a hierarchical |
|||
manner for signing the documents. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
|
|||
Odoo Proprietary License v1.0 (OPL-1) |
|||
(https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps) |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V18) Raneesha MK, |
|||
(V17) Ammu Raj |
|||
Contact : odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Raneesha MK (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License |
|||
# v1.0 (OPL-1). It is forbidden to publish, distribute, sublicense, or sell |
|||
# copies of the Software or modified copies 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 NON INFRINGEMENT. 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. |
|||
# |
|||
############################################################################### |
|||
from . import wizard |
@ -0,0 +1,48 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Raneesha MK (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License |
|||
# v1.0 (OPL-1). It is forbidden to publish, distribute, sublicense, or sell |
|||
# copies of the Software or modified copies 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 NON INFRINGEMENT. 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. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'name': 'Website Sign Sending By Priority', |
|||
'version': '1.0.0', |
|||
'category': 'Document Management', |
|||
'summary': 'Digital Signature In Odoo by Priority', |
|||
'description': 'This system ensures document security by sending files to' |
|||
'the correct recipients and enables hierarchical signing, ' |
|||
'prioritizing signatures based on roles, such as obtaining' |
|||
'approval from a sales manager before a warehouse manager.', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['sign'], |
|||
'data': ['wizard/sign_send_request_views.xml'], |
|||
'assets': { |
|||
'web.assets_backend': [ |
|||
'website_sign_sending_by_priority/static/src/js/signer_x2many.js', |
|||
'website_sign_sending_by_priority/static/src/xml/signer_x2many.xml', |
|||
], |
|||
}, |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'OPL-1', |
|||
'installable': True, |
|||
'application': False, |
|||
'auto_install': False |
|||
} |
@ -0,0 +1,5 @@ |
|||
## Module <website_sign_sending_by_priority> |
|||
#### 03.11.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial Commit for Website Sign Sending By Priority. |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 172 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 172 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 316 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,39 @@ |
|||
/** @odoo-module **/ |
|||
import { registry } from "@web/core/registry"; |
|||
import { _t } from "@web/core/l10n/translation"; |
|||
import { SignerX2Many } from "@sign/fields/signer_x2many"; |
|||
//Extended SignerX2Many widget of the field signer_ids and created new widget,
|
|||
//because we cant add the field to the existing widget
|
|||
export class SignerX2ManyWithPriority extends SignerX2Many { |
|||
static template = "website_sign_sending_by_priority.SignerX2ManyWithPriority"; |
|||
static components = { |
|||
...SignerX2Many.components, |
|||
}; |
|||
|
|||
get priorityFieldInfo() { |
|||
return { |
|||
name: "priority", |
|||
additionalProps: { |
|||
readonly: false, |
|||
}, |
|||
}; |
|||
} |
|||
} |
|||
|
|||
const signerX2ManyWithPriority = { |
|||
component: SignerX2ManyWithPriority, |
|||
displayName: _t("Signer One 2 Many with Priority"), |
|||
additionalClasses: ["o_required_modifier"], |
|||
supportedTypes: ["one2many"], |
|||
relatedFields: () => { |
|||
return [ |
|||
{ name: "role_id", type: "many2one", relation: "sign.item.role", readonly: false }, |
|||
{ name: "partner_id", type: "many2one", relation: "res.partner", readonly: false }, |
|||
{ name: "priority", type: "integer", readonly: false }, |
|||
{ name: "mail_sent_order", type: "integer", readonly: false }, |
|||
]; |
|||
}, |
|||
fieldDependencies: [{ name: "set_sign_order", type: "boolean" }], |
|||
}; |
|||
|
|||
registry.category("fields").add("signer_x2many_with_priority", signerX2ManyWithPriority); |
@ -0,0 +1,31 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<templates> |
|||
<!-- Template for SignerX2ManyWithPriority widget--> |
|||
<t t-name="website_sign_sending_by_priority.SignerX2ManyWithPriority"> |
|||
<div class="d-flex gap-2 mb-2 d-contents o_cell o_wrap_label flex-grow-1 flex-sm-grow-0 w-100 text-break text-900" |
|||
t-foreach="list.records" t-as="record" t-key="record.id"> |
|||
<div class="d-flex flex-row align-items-center"> |
|||
<div t-if="shouldShowOrder" |
|||
class="o_signer_one2many_mail_sent_order me-1" |
|||
t-att-class="{ 'small': env.isSmall }"> |
|||
<IntegerField name="'mail_sent_order'" record="record"/> |
|||
</div> |
|||
<t t-set="labelId" |
|||
t-value="record.id + partnerIdFieldInfo.name"/> |
|||
<label t-att-for="labelId" t-out="record.data['role_id'][1]" |
|||
class="o_form_label"/> |
|||
</div> |
|||
<div class="o_field_wrap d-flex align-items-center"> |
|||
<div> |
|||
<Many2OneField id="labelId" name="partnerIdFieldInfo.name" |
|||
record="record" |
|||
t-props="partnerIdFieldInfo.additionalProps"/> |
|||
</div> |
|||
<div class="ms-2"> |
|||
<label for="prio">Priority</label> |
|||
<IntegerField id="prio" name="'priority'" record="record"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu raj (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License |
|||
# v1.0 (OPL-1). It is forbidden to publish, distribute, sublicense, or sell |
|||
# copies of the Software or modified copies 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 NON INFRINGEMENT. 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. |
|||
# |
|||
############################################################################### |
|||
from . import sign_send_request |
|||
from . import sign_send_request_signer |
@ -0,0 +1,76 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Raneesha MK (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License |
|||
# v1.0 (OPL-1). It is forbidden to publish, distribute, sublicense, or sell |
|||
# copies of the Software or modified copies 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 NON INFRINGEMENT. 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. |
|||
# |
|||
############################################################################### |
|||
from odoo import Command, models |
|||
from odoo.exceptions import ValidationError |
|||
|
|||
|
|||
class SignSendRequest(models.TransientModel): |
|||
"""Inheriting the model and a field""" |
|||
_inherit = 'sign.send.request' |
|||
|
|||
def create_request(self): |
|||
"""Creating the request based on the signers""" |
|||
template_id = self.template_id.id |
|||
signers = [ |
|||
{'partner_id': signer.partner_id.id, 'role_id': signer.role_id.id, |
|||
'priority': signer.priority} for signer in self.signer_ids] |
|||
# Check for duplicate priorities |
|||
priority_set = set() |
|||
for signer in signers: |
|||
if signer['priority'] in priority_set: |
|||
raise ValidationError("Duplicate priority found. Please set") |
|||
priority_set.add(signer['priority']) |
|||
# Sort signers based on priority |
|||
signers = sorted(signers, key=lambda x: x['priority']) |
|||
# Assign mail_sent_order and create the sign request |
|||
for index, signer in enumerate(signers): |
|||
signer['mail_sent_order'] = index + 1 |
|||
cc_partner_ids = self.cc_partner_ids.ids |
|||
sign_request = self.env['sign.request'].create({ |
|||
'template_id': template_id, |
|||
'request_item_ids': [Command.create({ |
|||
'partner_id': signer['partner_id'], |
|||
'role_id': signer['role_id'], |
|||
'mail_sent_order': signer['mail_sent_order'], |
|||
}) for signer in signers], |
|||
'reference': self.filename, |
|||
'subject': self.subject, |
|||
'message': self.message, |
|||
'message_cc': self.message_cc, |
|||
'attachment_ids': [Command.set(self.attachment_ids.ids)], |
|||
}) |
|||
sign_request.message_subscribe(partner_ids=cc_partner_ids) |
|||
return sign_request |
|||
|
|||
def send_request(self): |
|||
"""Sending the request to the corresponding signers based on |
|||
the priority """ |
|||
request = self.create_request() |
|||
current_signer = self.signer_ids.filtered( |
|||
lambda s: s.partner_id == self.env.user.partner_id) |
|||
if current_signer.priority == 1: |
|||
if self.activity_id: |
|||
self._activity_done() |
|||
return {'type': 'ir.actions.act_window_close'} |
|||
return request.go_to_document() |
|||
else: |
|||
return request.go_to_document() |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Raneesha MK (odoo@cybrosys.com) |
|||
# |
|||
# This program is under the terms of the Odoo Proprietary License |
|||
# v1.0 (OPL-1). It is Software or modified copies 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 NON INFRINGEMENT. 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. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SignSendRequestSigner(models.TransientModel): |
|||
"""Inheriting the model and add the priority field to manage the sign |
|||
sending priority""" |
|||
_inherit = 'sign.send.request.signer' |
|||
|
|||
priority = fields.Integer(string='Priority', |
|||
help='Setting the priority of the mail send ' |
|||
'to the signers.') |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Adding the priority field to identify the priority of the document |
|||
signing--> |
|||
<record id="sign_send_request_view_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
sign.send.request.view.form.inherit.website.sign.by.priority |
|||
</field> |
|||
<field name="model">sign.send.request</field> |
|||
<field name="inherit_id" ref="sign.sign_send_request_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='signer_ids']" position="attributes"> |
|||
<attribute name="widget">signer_x2many_with_priority</attribute> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |