Skip to content

Commit

Permalink
[UPD] purchase_sign: pre-commit fixes
Browse files Browse the repository at this point in the history
Test fixes

OCA related changes
  • Loading branch information
ByteMeAsap committed May 8, 2024
1 parent 7b730bb commit fa8bd89
Show file tree
Hide file tree
Showing 11 changed files with 727 additions and 52 deletions.
76 changes: 76 additions & 0 deletions purchase_sign/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
=============
Purchase Sign
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:88ac5c691562f3453857db7210257da345b2b903c05d80b3ed305fab437b14b5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.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-16-0/purchase-workflow-16-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=16.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:%2016.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/16.0/purchase_sign>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 4 additions & 2 deletions purchase_sign/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "AGPL-3",
"category": "Purchase",
"author": "Onestein, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/vertical-association",
"website": "https://github.com/OCA/purchase-workflow",
"depends": ["purchase"],
"data": [
"report/purchase_order_template.xml",
Expand All @@ -16,6 +16,8 @@
"views/res_config_settings_view.xml",
],
"assets": {
"web.assets_tests": ["purchase_sign/static/tests/tours/purchase_signature.js"],
"web.assets_tests": [
"purchase_sign/static/tests/tours/purchase_signature.esm.js"
],
},
}
2 changes: 1 addition & 1 deletion purchase_sign/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def portal_purchase_accept(

if not order_sudo._has_to_be_signed():
return {
"error": _("The order is not in a state requiring customer signature.")
"error": _("The order is not in a state requiring vendor signature.")
}
if not signature:
return {"error": _("Signature is missing.")}
Expand Down
3 changes: 2 additions & 1 deletion purchase_sign/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class PurchaseOrder(models.Model):
readonly=False,
precompute=True,
states=Purchase.READONLY_STATES,
help="Request a online signature and/or payment to the customer in order to confirm orders automatically.",
help="Request a online signature and/or payment to the customer in "
"order to confirm orders automatically.",
)
signature = fields.Image(
copy=False, attachment=True, max_width=1024, max_height=1024
Expand Down
14 changes: 10 additions & 4 deletions purchase_sign/report/purchase_order_template.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_purchaseorder_document" inherit_id="purchase.report_purchaseorder_document">
<template
id="report_purchaseorder_document"
inherit_id="purchase.report_purchaseorder_document"
>
<xpath expr="//p[@t-field='o.notes']" position="before">
<div t-if="o.signature" class="mt-4 ml64 mr4" name="signature">
<div class="offset-8">
<strong>Signature</strong>
</div>
<div class="offset-8">
<img t-att-src="image_data_uri(o.signature)" style="max-height: 4cm; max-width: 8cm;"/>
<img
t-att-src="image_data_uri(o.signature)"
style="max-height: 4cm; max-width: 8cm;"
/>
</div>
<div class="offset-8 text-center">
<p t-field="o.signed_by"/>
<p t-field="o.signed_by" />
</div>
</div>
</xpath>
Expand Down
Loading

0 comments on commit fa8bd89

Please sign in to comment.