Skip to content

Commit

Permalink
[MIG] sale_order_digitized_signature: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
osi-mgosai authored and pedrobaeza committed Aug 10, 2019
1 parent 9ebc69b commit 3b6aeb9
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 20 deletions.
1 change: 1 addition & 0 deletions oca_dependencies.txt
@@ -1 +1,2 @@
server-tools
web
29 changes: 21 additions & 8 deletions sale_order_digitized_signature/README.rst
Expand Up @@ -7,20 +7,20 @@ Sale Order Digitized Signature
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
:alt: Production/Stable
.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/11.0/sale_order_digitized_signature
:target: https://github.com/OCA/sale-workflow/tree/12.0/sale_order_digitized_signature
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-11-0/sale-workflow-11-0-sale_order_digitized_signature
:target: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_order_digitized_signature
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/167/11.0
:target: https://runbot.odoo-community.org/runbot/167/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -57,7 +57,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_digitized_signature%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_digitized_signature%0Aversion:%2012.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.

Expand All @@ -73,10 +73,15 @@ Contributors
~~~~~~~~~~~~

* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* `Tecnativa <https://www.tecnatica.com>`_:
* `Tecnativa <https://www.tecnativa.com>`_:

* Vicent Cubells

* `Open Source Integrators <https://www.opensourceintegrators.com>`_:

* Mayank Gosai <mgosai@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>

Maintainers
~~~~~~~~~~~

Expand All @@ -90,6 +95,14 @@ 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/sale-workflow <https://github.com/OCA/sale-workflow/tree/11.0/sale_order_digitized_signature>`_ project on GitHub.
.. |maintainer-mgosai| image:: https://github.com/mgosai.png?size=40px
:target: https://github.com/mgosai
:alt: mgosai

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-mgosai|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/12.0/sale_order_digitized_signature>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_order_digitized_signature/__init__.py
@@ -1 +1,4 @@
# Copyright 2017 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
7 changes: 5 additions & 2 deletions sale_order_digitized_signature/__manifest__.py
Expand Up @@ -3,9 +3,10 @@

{
"name": "Sale Order Digitized Signature",
"version": "11.0.1.0.0",
"summary": "Capture customer signature on the sales order",
"version": "12.0.1.0.0",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"category": "Sales",
"license": "AGPL-3",
Expand All @@ -18,4 +19,6 @@
"views/sale_views.xml",
],
"installable": True,
"development_status": "Production/Stable",
"maintainers": ["mgosai"],
}
@@ -0,0 +1,14 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# Copyright 2019 OSI - Maxime Chambreuil
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openupgradelib import openupgrade
from openupgradelib import openupgrade_90


@openupgrade.migrate()
def migrate(env, version):
column = openupgrade.get_legacy_name('customer_signature')
if openupgrade.column_exists(env.cr, 'sale_order', column):
openupgrade_90.convert_binary_field_to_attachment(
env, {'sale.order': [('customer_signature', None)]})
@@ -0,0 +1,15 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# Copyright 2019 OSI - Maxime Chambreuil
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade

column_renames = {
'sale.order': [('customer_signature', None)]
}


@openupgrade.migrate()
def migrate(env, version):
if openupgrade.column_exists(env.cr, 'sale_order', 'customer_signature'):
openupgrade.rename_columns(env.cr, column_renames)
3 changes: 3 additions & 0 deletions sale_order_digitized_signature/models/__init__.py
@@ -1 +1,4 @@
# Copyright 2017 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import sale
2 changes: 1 addition & 1 deletion sale_order_digitized_signature/models/sale.py
Expand Up @@ -9,7 +9,7 @@ class SaleOrder(models.Model):

customer_signature = fields.Binary(
string='Customer acceptance',
)
attachment=True)

@api.model
def create(self, values):
Expand Down
7 changes: 6 additions & 1 deletion sale_order_digitized_signature/readme/CONTRIBUTORS.rst
@@ -1,4 +1,9 @@
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* `Tecnativa <https://www.tecnatica.com>`_:
* `Tecnativa <https://www.tecnativa.com>`_:

* Vicent Cubells

* `Open Source Integrators <https://www.opensourceintegrators.com>`_:

* Mayank Gosai <mgosai@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
9 changes: 6 additions & 3 deletions sale_order_digitized_signature/report/report_saleorder.xml
@@ -1,12 +1,15 @@
<?xml version="1.0" ?>
<?xml version="1.0"?>
<odoo>

<template id="report_saleorder_document" inherit_id="sale.report_saleorder_document" priority="9999">
<template id="report_saleorder_document"
inherit_id="sale.report_saleorder_document">
<xpath expr="//p[@id='fiscal_position_remark']" position="after">
<p>
<strong>Customer acceptance:</strong>
<span t-if="doc.customer_signature">
<img class="image" t-att-src="'data:image/png;base64,%s' % to_text(doc.customer_signature)" style="border:auto;"/>
<img class="image"
t-att-src="'data:image/png;base64,%s' % to_text(doc.customer_signature)"
style="border:auto;"/>
</span>
</p>
</xpath>
Expand Down
15 changes: 11 additions & 4 deletions sale_order_digitized_signature/static/description/index.html
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Sale Order Digitized Signature</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/11.0/sale_order_digitized_signature"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-11-0/sale-workflow-11-0-sale_order_digitized_signature"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/12.0/sale_order_digitized_signature"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_order_digitized_signature"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a signature field to sale report.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -406,7 +406,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_digitized_signature%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_digitized_signature%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -421,10 +421,15 @@ <h2><a class="toc-backref" href="#id5">Authors</a></h2>
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Lorenzo Battistini &lt;<a class="reference external" href="mailto:lorenzo.battistini&#64;agilebg.com">lorenzo.battistini&#64;agilebg.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnatica.com">Tecnativa</a>:<ul>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Vicent Cubells</li>
</ul>
</li>
<li><a class="reference external" href="https://www.opensourceintegrators.com">Open Source Integrators</a>:<ul>
<li>Mayank Gosai &lt;<a class="reference external" href="mailto:mgosai&#64;opensourceintegrators.com">mgosai&#64;opensourceintegrators.com</a>&gt;</li>
<li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:mchambreuil&#64;opensourceintegrators.com">mchambreuil&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -434,7 +439,9 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/11.0/sale_order_digitized_signature">OCA/sale-workflow</a> project on GitHub.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/mgosai"><img alt="mgosai" src="https://github.com/mgosai.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/12.0/sale_order_digitized_signature">OCA/sale-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion sale_order_digitized_signature/views/sale_views.xml
Expand Up @@ -8,7 +8,8 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='note']" position="after">
<div class="oe_clear"/>
<label for="customer_signature" class="oe_edit_only"/>
<label for="customer_signature" string='Customer Signature'
class="oe_edit_only"/>
<field name="customer_signature" widget="signature"/>
</xpath>
</field>
Expand Down

0 comments on commit 3b6aeb9

Please sign in to comment.