Open ERP Forum
   IndexIndex   SearchSearch     RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   RSSRSS   Mailing ListMailing List   Log inLog in 

Quick way to deploy/undeploy a module
Goto page 1, 2  Next  
Post new topic   Reply to topic    Open Object Forum Index -> General discussion
View previous topic :: View next topic  
Author Message
MLConsulting



Joined: 14 Sep 2009
Posts: 35
Location: Montréal, Québec, Canada

PostPosted: Tue Mar 16, 2010 3:29 am    Post subject: Quick way to deploy/undeploy a module Reply with quote

When working on a new module in development mode, how do you deploy it? Is there any trick to deploy it quickly?

It takes me forever each time to go to the modules pages, uninstall the module, then reinstall it. I'm sure there is a most efficient way to work that I'm not aware of...
Back to top
View user's profile Send private message
rvalyi



Joined: 25 Jan 2008
Posts: 598

PostPosted: Tue Mar 16, 2010 5:08 am    Post subject: Reply with quote

@MLConsulting,

The trick is to restart the server with the following options:
--update=module_name --database=database_name

then development cycles are pretty quick. If you don't touch the databse schema or record you can also just restart the server. There have been efforts to implement auto-reload features a la Ruby on Rails in non official branches but I'm not sure how serious it went, in any case development cycles are fairly acceptable this way.

It's out of the box on Linux, if you sold your soul with Windows, it means you should make a source install with bzr and the hell dependencies and forget using symlinks to manage the various modules repositories, in short it's possible, I've done it a few times for guys that claim they know Windows, but you are pretty screwed.
_________________
Raphaël Valyi

CEO and OpenERP consultant at
http://www.akretion.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hda



Joined: 03 Dec 2007
Posts: 1376
Location: Belgium

PostPosted: Tue Mar 16, 2010 11:04 am    Post subject: Reply with quote

In windows you can deploy new module using import module wizard or
just copy the new module in addons and run update module list wizard.
it will update module list and will add new module in module list.
_________________
OpenERP=Easier, Adaptable, Affordable, Modular
Back to top
View user's profile Send private message
MLConsulting



Joined: 14 Sep 2009
Posts: 35
Location: Montréal, Québec, Canada

PostPosted: Tue Mar 16, 2010 5:30 pm    Post subject: Reply with quote

I am stuck on Windows.

Here is my actual (painful) process.

1) Edit the new module
2) Run a script that copies/replaces the new module files in the addons directory + restart the OpenERP server
3) In the web client, open the Modules page
4) Find my module
5) Select it for uninstall
6) Apply uninstall module
7) Select the same module for install
8) Apply installation (3-4 clicks)
9) Test it
10) Go back to step 1 and restart

How can I optimize this? (on Windows)
Back to top
View user's profile Send private message
GEM



Joined: 21 Nov 2008
Posts: 1679
Location: Lotharingie

PostPosted: Tue Mar 16, 2010 5:46 pm    Post subject: Reply with quote

1) stay on the page of the module
2) Edit the new module
3) Run a script that copies/replaces the new module files in the addons directory + restart the OpenERP server
4) on the page of module, click button plan the update (on the right of button uninstall), and at the top on the right, click apply update.
Back to top
View user's profile Send private message
MLConsulting



Joined: 14 Sep 2009
Posts: 35
Location: Montréal, Québec, Canada

PostPosted: Tue Mar 16, 2010 6:51 pm    Post subject: Reply with quote

Thanks GEM,

This is a little bit faster.

But still painful. Is there a way to create a script that would do all of this automatically (on Windows)?
Back to top
View user's profile Send private message
GEM



Joined: 21 Nov 2008
Posts: 1679
Location: Lotharingie

PostPosted: Tue Mar 16, 2010 6:56 pm    Post subject: Reply with quote

when you restart the server add this :
–update=NAME_OF_MODULE

see :
http://doc.openerp.com/book/8/8_21_Implem/8_21_Implem_support.html#index-431
Back to top
View user's profile Send private message
MLConsulting



Joined: 14 Sep 2009
Posts: 35
Location: Montréal, Québec, Canada

PostPosted: Tue Mar 16, 2010 7:42 pm    Post subject: Reply with quote

It doesn't seem to work on Windows. Am I mistaken?
Back to top
View user's profile Send private message
Kontaxis Panagiotis



Joined: 17 Mar 2009
Posts: 45
Location: Greece

PostPosted: Tue Mar 16, 2010 8:39 pm    Post subject: Reply with quote

I used either in windows and linux:
Code:
windows: openerp-server.exe -u module_name -d db_name
 linux: openerp-server -u module_name -d db_name


but I highly recommend to run openerp-server in linux for many reasons (mainly for debugging)

So, for ms-windows fans I recommend:

    vmWare player for windows
    an ubuntu 9.04 appliance


Just install openerp-server in ubuntu (out of the box), smb (samba) to edit your files from windows environment, and openSSH to restart the server via a putty client. Then install openerp-client in windows, use a notepad (or everything else) to edit your module in linux via samba and update your module using putty.

So you have a fully functional linux server without leaving your windows environment.
Back to top
View user's profile Send private message Visit poster's website
GEM



Joined: 21 Nov 2008
Posts: 1679
Location: Lotharingie

PostPosted: Wed Mar 17, 2010 12:21 pm    Post subject: Reply with quote

in config file openerp-server..conf this is options for server, try to add line :
update = name_of_module or all.
or if it doesn't work
upgrade = True

update will be do automatically when you restart server.
Back to top
View user's profile Send private message
Yagroo



Joined: 12 Jul 2010
Posts: 32

PostPosted: Thu Jul 22, 2010 12:08 pm    Post subject: Reply with quote

Hi all,

I'm facing same issues on linux/ubuntu.

I'm developing a module which works fine but I'm importing it every time I want to test it. (using the gtk interface)

I've got full access on the server but I can't find where my module is, I mean I can find the zip file but not the folder (I've done a research on the system).

How can I easily try my module ?

I've found nothing with google...

Thanks a lot
Back to top
View user's profile Send private message
eLBati



Joined: 28 Dec 2008
Posts: 51

PostPosted: Thu Jul 22, 2010 12:43 pm    Post subject: Reply with quote

Your module is in the addons openerp-server directory. You can directly modify files within such directory.
If you edit the XML view or the database structure (e.g. _columns), you have to upgrade the module.
If you edit a method you can just restart the server so that changes will take effect
_________________
Lorenzo Battistini
http://www.albatos.com
Back to top
View user's profile Send private message Visit poster's website
Yagroo



Joined: 12 Jul 2010
Posts: 32

PostPosted: Thu Jul 22, 2010 1:37 pm    Post subject: Reply with quote

Hi thanks for the reply, I understand now how to have my changes taken into account by OpernERP.


However I still can't find my module any where on the system... only the zip file Sad

Code:
find / -type f -name "my_module*" -print


there are files and folders with my_module in the name (I've tested successfully extracting the zip file by myself and find the files).

Is that possible that a module successfully installed has no dedicated folder in the system ?

Thanks


EDIT: I precise that I have the addons folder and I find the zip file in it.
Back to top
View user's profile Send private message
Yagroo



Joined: 12 Jul 2010
Posts: 32

PostPosted: Thu Jul 22, 2010 3:47 pm    Post subject: Reply with quote

Ok thanks to an aother error I've understood what was happening :


Code:
File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/my_module.zip/my_module/my_module.py", line 91


so python considers my_module.zip as a folder when unix considers it as a file !

Isn't that a bug ?

Thanks
Back to top
View user's profile Send private message
eLBati



Joined: 28 Dec 2008
Posts: 51

PostPosted: Thu Jul 22, 2010 4:59 pm    Post subject: Reply with quote

Sorry, never used zipped modules
_________________
Lorenzo Battistini
http://www.albatos.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Open Object Forum Index -> General discussion All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum