-
-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import dataframe | ||
from . import df_field | ||
from . import df_source | ||
from . import database_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from odoo import fields, models | ||
|
||
EXAMPLES = """ | ||
postgres://user:PASSWORD@server:port/database | ||
mssql://user:PASSWORD@server:port/database?encrypt=true&trusted_connection=false | ||
sqlite:///home/user/path/test.db | ||
mysql://user:PASSWORD@server:port/database | ||
oracle://user:PASSWORD@server:port/database | ||
""" | ||
|
||
|
||
class DatabaseConfig(models.Model): | ||
_name = "database.config" | ||
_description = "External database configuration" | ||
|
||
name = fields.Char(required=True) | ||
string_connexion = fields.Char(required=True) | ||
password = fields.Char(required=True) | ||
connexion_example = fields.Text(default=EXAMPLES, readonly=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from odoo import models | ||
from odoo import fields, models | ||
|
||
|
||
class DfSource(models.Model): | ||
_inherit = "df.source" | ||
|
||
query = fields.Char() | ||
db_id = fields.Many2one(comodel_name="database.config", help="Database") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<odoo> | ||
<record id="database_config_all" model="ir.model.access"> | ||
<field name="name">Database Config</field> | ||
<field name="model_id" ref="model_database_config" /> | ||
<field name="group_id" ref="base.group_user" /> | ||
<field name="perm_read" eval="1" /> | ||
<field name="perm_create" eval="1" /> | ||
<field name="perm_write" eval="1" /> | ||
<field name="perm_unlink" eval="1" /> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<odoo> | ||
<record id="database_config_form" model="ir.ui.view"> | ||
<field name="model">database.config</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<header /> | ||
<group> | ||
<group> | ||
<field name="name" /> | ||
</group> | ||
<group> | ||
<field name="password" password="1" /> | ||
</group> | ||
</group> | ||
<group> | ||
<field | ||
name="string_connexion" | ||
placeholder="postgres://username:PASSWORD@server:port/database" | ||
/> | ||
<div> | ||
<b | ||
>PASSWORD in string connexion'll be replaced by password field</b> | ||
</div> | ||
<separator /> | ||
<field name="connexion_example" readonly="1" /> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="dataframe_tree" model="ir.ui.view"> | ||
<field name="model">database.config</field> | ||
<field name="arch" type="xml"> | ||
<list> | ||
<field name="name" /> | ||
</list> | ||
</field> | ||
</record> | ||
|
||
<record id="database_config_action" model="ir.actions.act_window"> | ||
<field name="name">Database Config</field> | ||
<field name="res_model">database.config</field> | ||
<field name="view_mode">list,form</field> | ||
<field name="path">database-config</field> | ||
</record> | ||
|
||
<menuitem | ||
id="database_config_menu" | ||
action="database_config_action" | ||
parent="polars_process.polars_menu" | ||
sequence="7" | ||
/> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,48 @@ | ||
<odoo /> | ||
<odoo> | ||
<record id="df_source_form" model="ir.ui.view"> | ||
<field name="model">df.source</field> | ||
<field name="inherit_id" ref="polars_process.df_source_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[1]" position="after"> | ||
<separator /> | ||
<group> | ||
<field name="db_id" invisible="template" /> | ||
<field name="query" widget="code" invisible="template" /> | ||
</group> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="df_source_list" model="ir.ui.view"> | ||
<field name="model">df.source</field> | ||
<field name="inherit_id" ref="polars_process.df_source_list" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//list/field[last()]" position="after"> | ||
<field name="db_id" /> | ||
</xpath> | ||
<xpath expr="//list/field[@name='template']" position="attributes"> | ||
<attribute | ||
name="options" | ||
>{'accepted_file_extensions': '.xlsx,.sql'}</attribute> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="df_source_search" model="ir.ui.view"> | ||
<field name="model">df.source</field> | ||
<field name="inherit_id" ref="polars_process.df_source_search" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='name']" position="after"> | ||
<field name="db_id" /> | ||
</xpath> | ||
<xpath expr="//group" position="inside"> | ||
<filter | ||
string="Database" | ||
name="db_id" | ||
domain="[]" | ||
context="{'group_by': 'db_id'}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
odoo-addon-polars_process @ git+https://github.com/OCA/reporting-engine.git@refs/pull/943/head#subdirectory=polars_process | ||
odoo-addon-polars_process @ git+https://github.com/OCA/reporting-engine.git@refs/pull/943/head#subdirectory=polars_process |