mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 13:52:09 +02:00
19.0 vanilla
This commit is contained in:
parent
0a7ae8db93
commit
991d2234ca
416 changed files with 646602 additions and 300844 deletions
|
|
@ -1,5 +1,3 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import odoo
|
||||
import sys
|
||||
import optparse
|
||||
import logging
|
||||
|
|
@ -8,7 +6,7 @@ from collections import defaultdict
|
|||
|
||||
from . import Command
|
||||
from odoo.modules.registry import Registry
|
||||
from odoo.tools import SQL
|
||||
from odoo.tools import SQL, config
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -133,7 +131,8 @@ class Obfuscate(Command):
|
|||
return True
|
||||
|
||||
def run(self, cmdargs):
|
||||
parser = odoo.tools.config.parser
|
||||
parser = config.parser
|
||||
parser.prog = self.prog
|
||||
group = optparse.OptionGroup(parser, "Obfuscate Configuration")
|
||||
group.add_option('--pwd', dest="pwd", default=False, help="Cypher password")
|
||||
group.add_option('--fields', dest="fields", default=False, help="List of table.columns to obfuscate/unobfuscate: table1.column1,table2.column1,table2.column2")
|
||||
|
|
@ -152,14 +151,14 @@ class Obfuscate(Command):
|
|||
sys.exit(parser.print_help())
|
||||
|
||||
try:
|
||||
opt = odoo.tools.config.parse_config(cmdargs, setup_logging=True)
|
||||
opt = config.parse_config(cmdargs, setup_logging=True)
|
||||
if not opt.pwd:
|
||||
_logger.error("--pwd is required")
|
||||
sys.exit("ERROR: --pwd is required")
|
||||
if opt.allfields and not opt.unobfuscate:
|
||||
_logger.error("--allfields can only be used in unobfuscate mode")
|
||||
sys.exit("ERROR: --allfields can only be used in unobfuscate mode")
|
||||
self.dbname = odoo.tools.config['db_name']
|
||||
self.dbname = config['db_name']
|
||||
self.registry = Registry(self.dbname)
|
||||
with self.registry.cursor() as cr:
|
||||
self.cr = cr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue