@ -2,22 +2,20 @@
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api
from odoo import api , models
from lxml import etree
from openerp.addons.base.res.res_config import \
res_config_settings
class ResConfigSettings ( res_config_settings ) :
class ResConfigSettings ( models . TransientModel ) :
_inherit = ' res.config.settings '
@api.model
def fields_view_get ( self , view_id = None , view_type = ' form ' ,
context = None , toolbar = False , submenu = False ) :
def fields_view_get ( self , view_id = None , view_type = ' form ' , toolbar = False ,
submenu = False ) :
ret_val = super ( ResConfigSettings , self ) . fields_view_get (
view_id = view_id ,
view_type = view_type ,
context = context ,
toolbar = toolbar ,
submenu = submenu ,
)
@ -30,21 +28,65 @@ class ResConfigSettings(res_config_settings):
queries + = [
" //div[field[@name= ' module_account_reports ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_deferred_revenue ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_yodlee ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_plaid ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_bank_statement_import_qif ' "
" and @widget= ' upgrade_boolean ' ]] " ,
" //div[field[@name= ' module_account_bank_statement_import_ofx ' "
" and @widget= ' upgrade_boolean ' ]] " ,
" //div[field[@name= ' module_account_bank_statement_import_csv ' "
" and @widget= ' upgrade_boolean ' ]] " ,
" //div[field[@name= ' module_account_sepa ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_l10n_us_check_printing ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_reports_followup ' and \
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_batch_deposit ' and \
@widget = ' upgrade_boolean ' ] ] " ,
@widget = ' upgrade_boolean ' ] ] " ,
" //div[field[@name= ' module_account_batch_deposit ' and "
" @widget= ' upgrade_boolean ' ]] " ,
]
elif page_name == ' sale settings ' :
queries + = [
" //div[field[@name= ' module_crm_voip ' and "
" @widget= ' upgrade_boolean ' ]]/preceding-sibling::label[1] " ,
" //div[field[@name= ' module_crm_voip ' and "
" @widget= ' upgrade_boolean ' ]] " ,
" //group[@name= ' config_sign ' ] " ,
" //div[field[@name= ' module_sale_contract ' and "
" @widget= ' upgrade_boolean ' ]]/preceding-sibling::label[1] " ,
" //div[field[@name= ' module_sale_contract ' and "
" @widget= ' upgrade_boolean ' ]] " ,
]
queries + = [
" //div[div[field[@widget= ' upgrade_boolean ' ]]] \
/ preceding - sibling : : label [ 1 ] " ,
" //div[div[field[@widget= ' upgrade_boolean ' ]]] " ,
" //div[field[@widget= ' upgrade_boolean ' ]] \
/ preceding - sibling : : label [ 1 ] " ,
" //div[field[@widget= ' upgrade_boolean ' ]] " ,
" //field[@widget= ' upgrade_boolean ' ] " ,
]
elif page_name == ' stock settings ' :
queries + = [
" //group[@name= ' shipping ' ] " ,
" //group[5] " ,
" //div[field[@name= ' module_stock_barcode ' and "
" @widget= ' upgrade_boolean ' ]] " ,
]
elif page_name == ' project settings ' :
queries + = [
" //label[@for= ' id ' ] " ,
" //field[@name= ' module_project_forecast ' ]/ancestor::div[2] " ,
]
elif page_name == ' mrp settings ' :
queries + = [
" //group[3] " ,
]
elif page_name == ' General Settings ' :
queries + = [
" //label[@for= ' module_inter_company_rules ' ] " ,
" //div[@name= ' inter_company ' ] " ,
# "//field[@name='module_project_forecast']/ancestor::div[2]",
]
for query in queries :
for item in doc . xpath ( query ) :