mirror of
https://github.com/bringout/oca-storage.git
synced 2026-04-19 19:32:08 +02:00
Initial commit: OCA Storage packages (17 packages)
This commit is contained in:
commit
7a380f05d3
659 changed files with 41828 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import fs_test_connection
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class FSTestConnection(models.TransientModel):
|
||||
_name = "fs.test.connection"
|
||||
_description = "FS Test Connection Wizard"
|
||||
|
||||
def _get_check_connection_method_selection(self):
|
||||
return self.env["fs.storage"]._get_check_connection_method_selection()
|
||||
|
||||
storage_id = fields.Many2one("fs.storage")
|
||||
check_connection_method = fields.Selection(
|
||||
selection="_get_check_connection_method_selection",
|
||||
required=True,
|
||||
)
|
||||
|
||||
@api.model
|
||||
def default_get(self, field_list):
|
||||
res = super().default_get(field_list)
|
||||
res["storage_id"] = self.env.context.get("active_id", False)
|
||||
return res
|
||||
|
||||
def action_test_config(self):
|
||||
return self.storage_id._test_config(self.check_connection_method)
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="fs_test_connection_form_view" model="ir.ui.view">
|
||||
<field name="name">fs.test.connection.form</field>
|
||||
<field name="model">fs.test.connection</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Test Connection">
|
||||
<group>
|
||||
<field name="storage_id" readonly="1" />
|
||||
<field name="check_connection_method" />
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
type="object"
|
||||
name="action_test_config"
|
||||
string="Test connection"
|
||||
/>
|
||||
<button string="Close" class="btn-secondary" special="cancel" />
|
||||
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="act_open_fs_test_connection_view">
|
||||
<field name="name">FS Test Connection</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">fs.test.connection</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue