Community mailing list archives

community@mail.odoo.com

Re: OCA's account_reset_chart

by
Marc Cassuto
- 08/19/2015 22:11:36
Hello Gunnar,

just install and run the following script :

====
# First need to install module account_reset_chart from repository 
OCA/account-financial-tools
import xmlrpclib

username = 'admin' #the user
pwd = 'PLEASE_CHANGE_ME'      #the password of the user
dbname = 'test2'    #the database

# Get the uid
sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
uid = sock_common.login(dbname, username, pwd)

#replace localhost with the address of the server
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
sock.execute(dbname, uid, pwd, 'res.company', 'reset_chart', 1)
====

This told, you must have serious reason to use it  ! You will lose all 
accounts, all journals, all default account properties (on products, on 
product categories, on partners...)

My 2 cents,
Marc


On 08/19/2015 09:53 PM, Gunnar Wagner wrote:
> the problem of replacing an existing chart of accounts has been
> discussed in various threads here. I was under the impression ... it's
> not possible really.
> Strangely an existing OCA module I bumped over just now which seems to
> solve this problem has never been mentioned in those discusstions.
>
> https://github.com/OCA/account-financial-tools/tree/8.0/account_reset_chart
>
> I want to try that but don't quit understand the usage instructions in
> the README file though. Maybe someone here can clarify
>
>   >> To prevent major disasters when this module is installed, no
> interface is provided. Please run through xmlrpc, for instance using
> erppeek:
>
> does this mean you can not access odoo through your browser
> [ip-addresse]:8069 as long as account_reset_chart is installed?
>
> then it proceeds ...
>
> >> import erppeek
> >>
> >> host = 'localhost'
> >> port = '8069'
> >> admin_pw = 'admin'
> >> dbname = 'openerp'
> >>
> >> client = erppeek.Client('http://%s:%s' % (host, port))
> >> client.login('admin', admin_pw, dbname)
> >> client.execute('res.company', 'reset_chart', 1)
>
> is this a script, a config file? how do you practically operate the
> reset process (if the above is a sctipt then I guess you run it (using
> the appropriate data for your case naturally)
>
> thanks
> Gunnar
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>