Author: |
Erick Navarro |
License: |
no license |
Branch: |
7.0 |
Repository: |
cesaraugustochirinos/custom_download_file |
Dependencies: |
base,
and
web |
Languages: |
JavaScript (35, 39.8%),
Markdown (21, 23.9%),
and
Python (32, 36.4%) |
Other branches: |
11.0,
and
8.0 |
Other repositories: |
111sree/custom_download_file,
Capriatto/custom_download_file,
Guobower/custom_download_file,
IJOL/custom_download_file,
amarildogolloshi/custom_download_file,
consultingerp/custom_download_file,
cubicerpdev/custom_download_file,
dsasoftware/custom_download_file,
edanpiro/custom_download_file,
erickgnavar/custom_download_file,
georgeppts/custom_download_file,
gitlabuser/custom_download_file,
guidev224/custom_download_file,
haylahi/custom_download_file,
hxsam/custom_download_file,
mario21ic/custom_download_file,
odooerpperu/custom_download_file,
one2pret/custom_download_file,
pythoner-3k/custom_download_file,
qq470647251/custom_download_file,
sc4you/custom_download_file,
and
yasmanycastillo/custom_download_file |
<h2>Custom Download File Odoo module</h2>
<p>Widget for download a customized file</p>
<h3>Extend base model</h3>
<p>```python
from osv import orm</p>
<p>class MyFile(orm.TransientModel):</p>
<pre><code>_inherit = 'download.file.base.model'
_name = 'my.file'
def init(self, cr, uid, record_id, context=None):
super(MyFile, self).init(cr, uid, record_id, context=context)
# initialize values
def get_filename(self, cr, uid, context=None):
return 'filename'
def get_content(self, cr, uid, context=None):
# process a file and return content
return 'file_content'
</code></pre>
<p>```</p>
<h3>Add to form</h3>
<p><code>xml
<widget type="download_button" model="my.file" string="Download this file"/>
</code></p>