Author: |
Terrabit, Odoo Community Association (OCA) |
License: |
AGPL-3 |
Branch: |
13.0 |
Repository: |
dhongu/deltatech |
Dependencies: |
base,
and
web |
Languages: |
HTML (374, 71.9%),
JavaScript (57, 11.0%),
Python (13, 2.5%),
XML (23, 4.4%),
and
reStructuredText (53, 10.2%) |
Other branches: |
13.0-update_readme,
and
13.0_mrpsimple |
<h1 class="title">List View General Buttons</h1>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/dhongu/deltatech/tree/13.0/web_list_view_general_buttons"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<dl class="docutils">
<dt>Features:</dt>
<dd><ul class="first last simple">
<li>This module allows you to add general buttons in list views</li>
</ul>
</dd>
</dl>
<div class="figure align-center">
<img alt="Usage" src="https://raw.githubusercontent.com/dhongu/deltatech/13.0/web_list_view_general_buttons/static/description/usage.jpg" />
</div>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<a name="usage"></a>
<h2><a class="toc-backref" href="#id1">Usage</a></h2>
<p>For use, the general_buttons key must be defined in the context of the action.
This key contains a list of dictionaries in which each button is defined.
Each button must have an action, a name and a model.</p>
<p>The <strong>name</strong> is displayed on the button and when the button is pressed,
the method defined in <strong>action</strong> from the specified <strong>model</strong> will be executed.</p>
<p>Example:</p>
<pre>
<code lang="python">{
'general_buttons': [{
'action': "print_pdf",
'name': "Print Preview",
'model':'stock.inventory.line'
}]
}</code>
</pre>
<pre>
<code lang="python">class StockInventoryLine(models.Model):
_inherit = "stock.inventory.line"
def print_pdf()
...</code>
</pre>
<p>Another option is to complete the get_general_buttons method in the general_buttons key.
In this situation we will call the get_general_buttons method which will return the dictionary list.</p>
<pre>
<code lang="python">def get_general_buttons(self):
return [{
'action': "print_pdf",
'name': "Print Preview",
'model':'stock.inventory.line'
}]</code>
</pre>
<a name="bug-tracker"></a>
<h2><a class="toc-backref" href="#id2">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/dhongu/deltatech/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/dhongu/deltatech/issues/new?body=module:%20web_list_view_general_buttons%0Aversion:%2013.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>
<a name="credits"></a>
<h2><a class="toc-backref" href="#id3">Credits</a></h2>
<a name="authors"></a>
<h3><a class="toc-backref" href="#id4">Authors</a></h3>
<ul class="simple">
<li>Terrabit</li>
</ul>
<a name="contributors"></a>
<h3><a class="toc-backref" href="#id5">Contributors</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://www.terrabit.ro">Terrabit</a>:<ul>
<li>Dorin Hongu <<a class="reference external" href="mailto:dhongu@gmail.com">dhongu@gmail.com</a>></li>
</ul>
</li>
</ul>
<p>Do not contact contributors directly about support or help with technical issues.</p>
<a name="maintainers"></a>
<h3><a class="toc-backref" href="#id6">Maintainers</a></h3>
<p>Current maintainer:</p>
<p><a class="reference external" href="https://github.com/dhongu"><img alt="dhongu" src="https://github.com/dhongu.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/dhongu/deltatech/tree/13.0/web_list_view_general_buttons">dhongu/deltatech</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>