This commit is contained in:
MonsieurB 2017-03-15 16:14:37 +01:00 committed by Florian da Costa
parent 34e068d6e8
commit cf2886b915
5 changed files with 40 additions and 14 deletions

View File

@ -61,7 +61,7 @@ Usage (for module dev)
====================== ======================
* Add this keychain as a dependency in __openerp__.py * Add this keychain as a dependency in __manifest__.py
* Subclass `keychain.account` and add your module in namespaces: `(see after for the name of namespace )` * Subclass `keychain.account` and add your module in namespaces: `(see after for the name of namespace )`
.. code:: python .. code:: python

25
keychain/__manifest__.py Normal file
View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Copyright <2016> Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Keychain",
"summary": "Store accounts and credentials",
"version": "10.0.1.0.0",
"category": "Uncategorized",
"website": "https://akretion.com/",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {
"python": [
'cryptography'],
},
"depends": [
"base_setup",
],
"data": [
"security/ir.model.access.csv",
'views/keychain_view.xml'
],
}

View File

@ -6,10 +6,10 @@ from functools import wraps
import logging import logging
import json import json
from openerp import models, fields, api from odoo import models, fields, api
from openerp.exceptions import ValidationError from odoo.exceptions import ValidationError
from openerp.tools.config import config from odoo.tools.config import config
from openerp.tools.translate import _ from odoo.tools.translate import _
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -40,7 +40,9 @@ class KeychainAccount(models.Model):
technical_name = fields.Char( technical_name = fields.Char(
required=True, required=True,
help="Technical name. Must be unique") help="Technical name. Must be unique")
namespace = fields.Selection([], help="Type of account", required=True) namespace = fields.Selection(selection=[],
help="Type of account",
required=True)
environment = fields.Char( environment = fields.Char(
required=False, required=False,
help="'prod', 'dev', etc. or empty (for all)" help="'prod', 'dev', etc. or empty (for all)"

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp.tests.common import TransactionCase from odoo.tests.common import TransactionCase
from openerp.tools.config import config from odoo.tools.config import config
from openerp.exceptions import ValidationError from odoo.exceptions import ValidationError
import logging import logging
@ -21,6 +21,7 @@ class TestKeychain(TransactionCase):
self.keychain = self.env['keychain.account'] self.keychain = self.env['keychain.account']
config['keychain_key'] = Fernet.generate_key() config['keychain_key'] = Fernet.generate_key()
config['running_env'] = ""
self.old_running_env = config['running_env'] self.old_running_env = config['running_env']
config['running_env'] = None config['running_env'] = None

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<openerp> <odoo>
<data>
<record model="ir.ui.view" id="keychain_account_id"> <record model="ir.ui.view" id="keychain_account_id">
<field name="model">keychain.account</field> <field name="model">keychain.account</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
@ -44,7 +43,6 @@
</record> </record>
<menuitem id="keychain_menu" name="Keychain" <menuitem id="keychain_menu" name="Keychain"
parent="base.menu_config" parent="base.menu_custom"
action="keychain_list_action"/> action="keychain_list_action"/>
</data> </odoo>
</openerp>