Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions purchase_sign/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
=============
Purchase Sign
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:56a9aecd4b0b47eda77efd60cc19b8963193fee67e2fe6ad675449af14a3c6c6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_sign
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_sign
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to take online signatures from vendors to confirm
purchase orders.It adds a global configuration (Online signature) which
can be accessed through Purchase->Configuration->Settings and it can
further be handled also on each of the purchase orders.When it is
enabled, it shows a button 'Accept & Sign' on the portal to the vendors
for RFQ which are sent by email to them.Once the vendor accepts and adds
their signature, the RFQ gets confirmed into a purchase order

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_sign%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Onestein

Contributors
------------

- `Onestein <https://www.onestein.nl>`__

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_sign>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions purchase_sign/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Onestein
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
from . import controllers
23 changes: 23 additions & 0 deletions purchase_sign/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Onestein
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Purchase Sign",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"category": "Purchase",
"author": "Onestein, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"depends": ["purchase"],
"data": [
"views/purchase_view.xml",
"views/res_config_settings_view.xml",
"templates/purchase_portal_templates.xml",
"report/purchase_order_template.xml",
],
"assets": {
"web.assets_tests": [
"purchase_sign/static/tests/tours/purchase_signature.esm.js"
],
},
}
2 changes: 2 additions & 0 deletions purchase_sign/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import main
78 changes: 78 additions & 0 deletions purchase_sign/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2024 Onestein
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import binascii

from odoo import _, fields, http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request

from odoo.addons.portal.controllers.portal import CustomerPortal


class PortalPurchase(CustomerPortal):
def _purchase_order_get_page_view_values(self, order, access_token, **kwargs):
response = super()._purchase_order_get_page_view_values(
order=order, access_token=access_token, **kwargs
)
if kwargs.get("message"):
response.update({"message": kwargs.get("message")})
return response

@http.route(
["/my/purchase/<int:order_id>/accept"], type="json", auth="public", website=True
)
def portal_purchase_accept(
self, order_id, access_token=None, name=None, signature=None
):
access_token = access_token or request.httprequest.args.get("access_token")
try:
order_sudo = self._document_check_access(
"purchase.order", order_id, access_token=access_token
)
except (AccessError, MissingError):
return {"error": _("Invalid order.")}

if not order_sudo._has_to_be_signed():
return {
"error": _("The order is not in a state requiring vendor signature.")
}
if not signature:
return {"error": _("Signature is missing.")}

try:
order_sudo.write(
{
"signed_by": name,
"signed_on": fields.Datetime.now(),
"signature": signature,
}
)
request.env.cr.commit()
except (TypeError, binascii.Error):
return {"error": _("Invalid signature data.")}
order_sudo.button_confirm()
pdf = (
request.env["ir.actions.report"]
.sudo()
._render_qweb_pdf("purchase.action_report_purchase_order", [order_sudo.id])[
0
]
)
order_sudo.message_post(
attachments=[(f"{order_sudo.name}.pdf", pdf)],
author_id=(
order_sudo.partner_id.id
if request.env.user._is_public()
else request.env.user.partner_id.id
),
body=_("Order signed by %s", name),
message_type="comment",
subtype_xmlid="mail.mt_comment",
)

query_string = "&message=sign_ok"
return {
"force_refresh": True,
"redirect_url": order_sudo.get_portal_url(query_string=query_string),
}
201 changes: 201 additions & 0 deletions purchase_sign/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_sign
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-17 18:58+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid ""
"<i class=\"fa fa-check\"/>\n"
" Accept &amp; Sign"
msgstr ""
"<i class=\"fa fa-check\"/>\n"
" Accetta e firma"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid ""
"<i class=\"fa fa-check\"/>\n"
" Accept &amp; Sign"
msgstr ""
"<i class=\"fa fa-check\"/>\n"
" Accetta e firma"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid ""
"<i class=\"fa fa-comment\"/>\n"
" Feedback"
msgstr ""
"<i class=\"fa fa-comment\"/>\n"
" Commento"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "<span>Accepted on the behalf of:</span>"
msgstr "<span>Accettato per conto di:</span>"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "<span>By signing this proposal, I agree to the following terms:</span>"
msgstr "<span>Firmando questa proposta accetto i seguenti termini:</span>"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "<span>For an amount of:</span>"
msgstr "<span>Per un valore di:</span>"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "<span>With payment terms:</span>"
msgstr "<span>Con termini di pagamento:</span>"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.report_purchaseorder_document
msgid "<strong>Signature</strong>"
msgstr "<strong>Firma</strong>"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid ""
"<strong>Thank You!</strong><br/>\n"
" Order has been confirmed."
msgstr ""
"<strong>Grazie!</strong><br/>\n"
" L'ordine è stato confermato."

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "Close"
msgstr "Chiudi"

#. module: purchase_sign
#: model:ir.model,name:purchase_sign.model_res_company
msgid "Companies"
msgstr "Aziende"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/controllers/main.py:0
#: code:addons/purchase_sign/tests/test_purchase_sign.py:0
#, python-format
msgid "Invalid order."
msgstr "Ordine non valido."

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/tests/test_purchase_sign.py:0
#, python-format
msgid "Invalid signature data"
msgstr "Data firma non valida"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/controllers/main.py:0
#, python-format
msgid "Invalid signature data."
msgstr "Data firma non valida."

#. module: purchase_sign
#: model:ir.model.fields,field_description:purchase_sign.field_purchase_order__require_signature
#: model_terms:ir.ui.view,arch_db:purchase_sign.res_config_settings_view_form_purchase
msgid "Online Signature"
msgstr "Firma online"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/controllers/main.py:0
#, python-format
msgid "Order signed by %s"
msgstr "Ordine firmato da %s"

#. module: purchase_sign
#: model:ir.model,name:purchase_sign.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "Impostazioni raggruppamento approvvigionamento acquisti"

#. module: purchase_sign
#: model:ir.model.fields,field_description:purchase_sign.field_res_company__purchase_portal_confirmation_sign
#: model:ir.model.fields,field_description:purchase_sign.field_res_config_settings__purchase_portal_confirmation_sign
msgid "Purchase Online Signature"
msgstr "Firma online acquisto"

#. module: purchase_sign
#: model:ir.model,name:purchase_sign.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"

#. module: purchase_sign
#: model:ir.model.fields,help:purchase_sign.field_purchase_order__require_signature
msgid ""
"Request a online signature and/or payment to the customer in order to "
"confirm orders automatically."
msgstr ""
"Richiede una firma online e/o pagamento al cliente per confermare gli ordini "
"automaticamente."

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.res_config_settings_view_form_purchase
msgid "Request an online signature to confirm orders"
msgstr "Richiede una firma online per confermare gli ordini"

#. module: purchase_sign
#: model:ir.model.fields,field_description:purchase_sign.field_purchase_order__signature
#: model_terms:ir.ui.view,arch_db:purchase_sign.purchase_order_portal_content
msgid "Signature"
msgstr "Firma"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/tests/test_purchase_sign.py:0
#, python-format
msgid "Signature is missing"
msgstr "Manca la firma"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/controllers/main.py:0
#, python-format
msgid "Signature is missing."
msgstr "Manca la firma."

#. module: purchase_sign
#: model:ir.model.fields,field_description:purchase_sign.field_purchase_order__signed_by
msgid "Signed By"
msgstr "Firmato da"

#. module: purchase_sign
#: model:ir.model.fields,field_description:purchase_sign.field_purchase_order__signed_on
msgid "Signed On"
msgstr "Firmato il"

#. module: purchase_sign
#. odoo-python
#: code:addons/purchase_sign/controllers/main.py:0
#: code:addons/purchase_sign/tests/test_purchase_sign.py:0
#, python-format
msgid "The order is not in a state requiring vendor signature."
msgstr "L'ordine è in uno stato che non richiede la firma del fornitore."

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.portal_my_purchase_order
msgid "Validate Order"
msgstr "Validazione ordine"

#. module: purchase_sign
#: model_terms:ir.ui.view,arch_db:purchase_sign.purchase_order_view_form_inherit
msgid "Vendor Signature"
msgstr "Firma fornitore"
Loading