Browse Source

Mig V10

pull/780/head
MonsieurB 8 years ago
parent
commit
00d89cc153
  1. 2
      keychain/README.rst
  2. 25
      keychain/__manifest__.py
  3. 12
      keychain/models/keychain.py
  4. 7
      keychain/tests/test_keychain.py
  5. 8
      keychain/views/keychain_view.xml

2
keychain/README.rst

@ -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 )`
.. code:: python

25
keychain/__manifest__.py

@ -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'
],
}

12
keychain/models/keychain.py

@ -6,10 +6,10 @@ from functools import wraps
import logging
import json
from openerp import models, fields, api
from openerp.exceptions import ValidationError
from openerp.tools.config import config
from openerp.tools.translate import _
from odoo import models, fields, api
from odoo.exceptions import ValidationError
from odoo.tools.config import config
from odoo.tools.translate import _
_logger = logging.getLogger(__name__)
@ -40,7 +40,9 @@ class KeychainAccount(models.Model):
technical_name = fields.Char(
required=True,
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(
required=False,
help="'prod', 'dev', etc. or empty (for all)"

7
keychain/tests/test_keychain.py

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

8
keychain/views/keychain_view.xml

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