Skip to content

Commit

Permalink
[MIG] report_aeroo: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasperalta1 committed Dec 26, 2023
1 parent 3d29d0e commit a4b310c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions report_aeroo/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
'name': 'Aeroo Reports',
'version': "16.0.1.0.0",
'version': "17.0.1.0.0",
'category': 'Generic Modules/Aeroo Reports',
'summary': 'Enterprise grade reporting solution',
'author': 'Alistek',
Expand All @@ -26,7 +26,7 @@
],
},
"license": "GPL-3 or any later version",
'installable': False,
'installable': True,
'active': False,
'application': True,
'auto_install': False,
Expand Down
3 changes: 2 additions & 1 deletion report_aeroo/demo/report_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<field name="name">Sample Report</field>
<field name="type">ir.actions.report</field>
<field name="model">res.partner</field>
<field name="report_name">sample_report</field>
<field name="report_name">res.partner.sample_report</field>
<field name="report_type">aeroo</field>
<field name="in_format">oo-odt</field>
<field name="out_format" ref="report_aeroo.report_mimetypes_pdf_odt"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="parser_model">report.sample_report</field>
<field name="tml_source">file</field>
Expand Down
6 changes: 3 additions & 3 deletions report_aeroo/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#
################################################################################

from odoo.exceptions import except_orm
from odoo.exceptions import UserError

class ConnectionError(except_orm):
class ConnectionError(UserError):
""" Basic connection error.
Example: When try to connect Aeroo DOCS and connection fails."""
def __init__(self, msg):
super(ConnectionError, self).__init__(msg)


class ProgrammingError(except_orm):
class ProgrammingError(UserError):
""" Basic programming error.
Example: When python code can not be compiled due to some error."""
def __init__(self, msg):
Expand Down
3 changes: 1 addition & 2 deletions report_aeroo/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"report_stylesheets","report.stylesheets","model_report_stylesheets","base.group_system",1,1,1,1
"report_stylesheets_user","report.stylesheets.user","model_report_stylesheets",,1,0,0,0
"report_stylesheets_user","report.stylesheets.user","model_report_stylesheets","base.group_user",1,0,0,0
"report_mimetypes_system","report.mimetypes.system","model_report_mimetypes","base.group_system",1,1,1,1
"report_mimetypes_user","report.mimetypes.user","model_report_mimetypes","base.group_user",1,0,0,0
"docs_config_installer_user","docs.config.installer.user","model_docs_config_installer","base.group_user",1,1,1,1

3 changes: 2 additions & 1 deletion report_aeroo/static/src/js/report/reportactionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {download} from "@web/core/network/download"
import {registry} from "@web/core/registry"

async function aerooReportHandler (action, options, env){
let cloned_action = _.clone(action);
// let cloned_action = _.clone(action);
let cloned_action = Object.assign(action);
if (action.report_type === "aeroo"){
const type = "aeroo";
let url_ = `/report/${type}/${action.report_name}`;
Expand Down
24 changes: 12 additions & 12 deletions report_aeroo/views/report_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<field name="inherit_id" ref="base.act_report_xml_view"/>
<field name="arch" type="xml">
<notebook>
<page string="Aeroo Configuration" attrs="{'invisible':[('report_type','!=','aeroo')]}">
<page string="Aeroo Configuration" invisible="report_type != 'aeroo'">
<group>
<group string="Template">
<field name="tml_source"/>
<field name="report_data" attrs="{'invisible': [('tml_source','&lt;&gt;','database')],'required': [('tml_source','=','database'), ('report_type','=','aeroo')]}"/>
<field name="report_file" string="Template Path" attrs="{'invisible': [('tml_source','&lt;&gt;','file')],'required': [('tml_source','=','file'), ('report_type','=','aeroo')]}"/>
<field name="copies" attrs="{'invisible': [('report_name','in',['printscreen.list'])]}"/>
<field name="copies_intercalate" attrs="{'invisible': [('report_name','in',['printscreen.list'])]}"/>
<field name="report_data" invisible="tml_source != 'database'" required="tml_source == 'database' and report_type == 'aeroo'"/>
<field name="report_file" string="Template Path" invisible="tml_source != 'file'" required="tml_source == 'file' and report_type == 'aeroo'"/>
<field name="copies" invisible="report_name == 'printscreen.list'"/>
<field name="copies_intercalate" invisible="report_name == 'printscreen.list'"/>
<!-- TODO <field name="report_wizard" attrs="{'invisible': [('report_name','in',['printscreen.list'])]}"/> -->
<field name="type" invisible="1"/>
<field name="in_format" attrs="{'required':[('report_type','=','aeroo'), ('report_type','=','aeroo')]}"/>
<field name="out_format" attrs="{'required':[('report_type','=','aeroo'), ('report_type','=','aeroo')]}" domain="[('compatible_types','=',in_format)]"/>
<field name="in_format" required="report_type == 'aeroo' and report_type == 'aeroo'"/>
<field name="out_format" required="report_type == 'aeroo' and report_type == 'aeroo'" domain="[('compatible_types','=',in_format)]"/>
</group>
<group string="Stylesheet">
<field name="styles_mode"/>
<field name="stylesheet_id" attrs="{'invisible': [('styles_mode','&lt;&gt;','specified')]}"/>
<field name="charset" attrs="{'invisible': [('in_format','&lt;&gt;','genshi-raw')]}"/>
<field name="stylesheet_id" invisible="styles_mode != 'specified'"/>
<field name="charset" invisible="in_format != 'genshi-raw'"/>
</group>
<group string="Advanced">
<field name="parser_model"/>
<field name="process_sep"/>
<field name="replace_report_id" domain="[('model','=',model),('id','&lt;&gt;',active_id)]"/>
<field name="preload_mode" attrs="{'invisible': ['|',('in_format','=','genshi-raw'),('tml_source','=','parser')]}"/>
<field name="disable_fallback" attrs="{'invisible': [('in_format','=','genshi-raw')]}"/>
<field name="preload_mode" invisible="in_format == 'genshi-raw' or tml_source == 'parser'"/>
<field name="disable_fallback" invisible="in_format == 'genshi-raw'"/>
<field name="deferred"/>
<field name="deferred_limit" attrs="{'invisible':['|',('deferred','=','off'),('deferred','=',False)]}"/>
<field name="deferred_limit" invisible="deferred == 'off' or not deferred"/>
<newline/>
</group>
</group>
Expand Down
24 changes: 12 additions & 12 deletions report_aeroo/wizard/installer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
</form>
<footer position="replace">
<footer>
<button name="check" type="object" string="Apply and Test" class="btn-primary" states="init"/>
<button name="action_next" type="object" string="Finish" class="btn-primary" states="done"/>
<button name="check" type="object" string="Apply and Test" class="btn-primary" invisible="state != 'init'"/>
<button name="action_next" type="object" string="Finish" class="btn-primary" invisible="state != 'done'"/>
<button special="cancel" string="Close" class="btn-default"/>
</footer>
</footer>
<separator position="replace">
<field name="state" invisible="1" attrs="{'readonly':True, 'invisible': True}"/>
<field name="state" invisible="1" readonly="True"/>
<group col="4" colspan="4" expand="1">
<group colspan="1" expand="0">
<field name="config_logo" widget="image" nolabel="1" colspan="2"/>
Expand All @@ -28,25 +28,25 @@
Configure Aeroo Reports connection to DOCS service and test document conversion.
</p>
<newline/>
<group states="init" colspan="2" col="4">
<group invisible="state != 'init'" colspan="2" col="4">
<group colspan="4" col="4">
<field name="enabled"/>
<group colspan="4">
<field name="host" attrs="{'readonly': [('enabled','=',False)]}"/>
<field name="port" attrs="{'readonly': [('enabled','=',False)]}"/>
<field name="host" readonly="not enabled"/>
<field name="port" readonly="not enabled"/>
</group>
<field name="auth_type" attrs="{'readonly': [('enabled','=',False)]}"/>
<group colspan="4" attrs="{'invisible': [('auth_type','=',False)]}">
<field name="username" attrs="{'required': [('auth_type','=','simple')], 'readonly': [('enabled','=',False)]}"/>
<field name="password" password="True" attrs="{'required': [('auth_type','=','simple')], 'readonly': [('enabled','=',False)]}"/>
<field name="auth_type" readonly="not enabled"/>
<group colspan="4" invisible="not auth_type">
<field name="username" readonly="not enabled" required="auth_type == 'simple'"/>
<field name="password" password="True" readonly="not enabled" required="auth_type == 'simple'"/>
</group>
</group>
<separator colspan="4"/>
</group>
<group colspan="4" states="error,done">
<group colspan="4" invisible="state not in ('error', 'done')">
<field name="msg" colspan="4" nolabel="1"/>
</group>
<group colspan="4" states="error">
<group colspan="4" invisible="state != 'error'">
<separator string="Details" colspan="4"/>
<field name="error_details" colspan="4" nolabel="1"/>
</group>
Expand Down

0 comments on commit a4b310c

Please sign in to comment.