Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo Development Essentials

You're reading from   Odoo Development Essentials Fast track your development skills to build powerful Odoo business applications

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784392796
Length 214 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started with Odoo Development FREE CHAPTER 2. Building Your First Odoo Application 3. Inheritance – Extending Existing Applications 4. Data Serialization and Module Data 5. Models – Structuring the Application Data 6. Views – Designing the User Interface 7. ORM Application Logic – Supporting Business Processes 8. QWeb – Creating Kanban Views and Reports 9. External API – Integration with Other Systems 10. Deployment Checklist – Going Live Index

Developing from your workstation

You may be running Odoo with a Debian/Ubuntu system, either in a local virtual machine or in a server over the network. But you may prefer to do the development work in your personal workstation, using your favorite text editor or IDE.

This may frequently be the case for developers working from Windows workstations. But it also may be the case for Linux users that need to work on an Odoo server over the local network.

A solution for this is to enable file sharing in the Odoo host, so that files are easy to edit from our workstation. For Odoo server operations, such as a server restart, we can use an SSH shell (such as PuTTY on Windows) alongside our favorite editor.

Using a Linux text editor

Sooner or later, we will need to edit files from the shell command line. In many Debian systems the default text editor is vi. If you're not comfortable with it, then you probably could use a friendlier alternative. In Ubuntu systems the default text editor is nano. You might prefer it since it's easier to use. In case it's not available in your server, it can be installed with:

$ sudo apt-get install nano

In the following sections we will assume nano as the preferred editor. If you prefer any other editor, feel free to adapt the commands accordingly.

Installing and configuring Samba

The Samba project provides Linux file sharing services compatible with Microsoft Windows systems. We can install it on our Debian/Ubuntu server with:

$ sudo apt-get install samba samba-common-bin

The samba package installs the file sharing services and the samba-common-bin package is needed for the smbpasswd tool. By default users allowed to access shared files need to be registered with it. We need to register our user odoo and set a password for its file share access:

$ sudo smbpasswd -a odoo

After this the odoo user will be able to access a fileshare for its home directory, but it will be read only. We want to have write access, so we need to edit Sambas, configuration file to change that:

$ sudo nano /etc/samba/smb.conf

In the configuration file, look for the [homes] section. Edit its configuration lines so that they match the settings below:

[homes]
   comment = Home Directories
   browseable = yes
   read only = no
   create mask = 0640
   directory mask = 0750

For the configuration changes to take effect, restart the service:

$ sudo /etc/init.d/smbd restart

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

To access the files from Windows, we can map a network drive for the path \\<my-server-name>\odoo using the specific user and password defined with smbpasswd. When trying to log in with the odoo user, you might find trouble with Windows adding the computer's domain to the user name (for example MYPC\odoo). To avoid this, use an empty domain by prepending a \ to the login (for example \odoo).

Installing and configuring Samba

If we now open the mapped drive with Windows Explorer, we will be able to access and edit the contents of the odoo user home directory.

Installing and configuring Samba
You have been reading a chapter from
Odoo Development Essentials
Published in: Apr 2015
Publisher: Packt
ISBN-13: 9781784392796
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image