| View previous topic :: View next topic |
| Author |
Message |
MLConsulting
Joined: 14 Sep 2009 Posts: 35 Location: Montréal, Québec, Canada
|
Posted: Tue Mar 16, 2010 3:29 am Post subject: Quick way to deploy/undeploy a module |
|
|
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 |
|
 |
rvalyi
Joined: 25 Jan 2008 Posts: 598
|
Posted: Tue Mar 16, 2010 5:08 am Post subject: |
|
|
@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 |
|
 |
hda
Joined: 03 Dec 2007 Posts: 1376 Location: Belgium
|
Posted: Tue Mar 16, 2010 11:04 am Post subject: |
|
|
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 |
|
 |
MLConsulting
Joined: 14 Sep 2009 Posts: 35 Location: Montréal, Québec, Canada
|
Posted: Tue Mar 16, 2010 5:30 pm Post subject: |
|
|
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 |
|
 |
GEM
Joined: 21 Nov 2008 Posts: 1679 Location: Lotharingie
|
Posted: Tue Mar 16, 2010 5:46 pm Post subject: |
|
|
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 |
|
 |
MLConsulting
Joined: 14 Sep 2009 Posts: 35 Location: Montréal, Québec, Canada
|
Posted: Tue Mar 16, 2010 6:51 pm Post subject: |
|
|
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 |
|
 |
GEM
Joined: 21 Nov 2008 Posts: 1679 Location: Lotharingie
|
Posted: Tue Mar 16, 2010 6:56 pm Post subject: |
|
|
|
|
| Back to top |
|
 |
MLConsulting
Joined: 14 Sep 2009 Posts: 35 Location: Montréal, Québec, Canada
|
Posted: Tue Mar 16, 2010 7:42 pm Post subject: |
|
|
It doesn't seem to work on Windows. Am I mistaken? |
|
| Back to top |
|
 |
Kontaxis Panagiotis
Joined: 17 Mar 2009 Posts: 45 Location: Greece
|
Posted: Tue Mar 16, 2010 8:39 pm Post subject: |
|
|
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 |
|
 |
GEM
Joined: 21 Nov 2008 Posts: 1679 Location: Lotharingie
|
Posted: Wed Mar 17, 2010 12:21 pm Post subject: |
|
|
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 |
|
 |
Yagroo
Joined: 12 Jul 2010 Posts: 32
|
Posted: Thu Jul 22, 2010 12:08 pm Post subject: |
|
|
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 |
|
 |
eLBati
Joined: 28 Dec 2008 Posts: 51
|
Posted: Thu Jul 22, 2010 12:43 pm Post subject: |
|
|
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 |
|
 |
Yagroo
Joined: 12 Jul 2010 Posts: 32
|
Posted: Thu Jul 22, 2010 1:37 pm Post subject: |
|
|
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
| 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 |
|
 |
Yagroo
Joined: 12 Jul 2010 Posts: 32
|
Posted: Thu Jul 22, 2010 3:47 pm Post subject: |
|
|
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 |
|
 |
eLBati
Joined: 28 Dec 2008 Posts: 51
|
Posted: Thu Jul 22, 2010 4:59 pm Post subject: |
|
|
Sorry, never used zipped modules _________________ Lorenzo Battistini
http://www.albatos.com |
|
| Back to top |
|
 |
|