L.Ming
L.Ming

Reputation: 81

How to use scaffold to create module in windows?

I read the official tutorials,Odoo's scaffolding can setup a basic module. To quickly get started simply invoke:

$ ./odoo-bin scaffold Academy my-modules

I tried it but it didn't work,Because it remind Odoo-bin is not a command

I have entered the odoo installation directory

Upvotes: 5

Views: 15860

Answers (6)

Thanh Kieu Cong
Thanh Kieu Cong

Reputation: 1

For Windows OS, use cmd below: F:\Source\Odoo\python\python.exe .\odoo-bin scaffold om_odoo_inheritence F:\Source\Odoo\server\custom_addons
Which is:

  1. F:\Source\Odoo\python\python.exe => to run Python.exe in directory of python.
  2. .\odoo-bin scaffold => to call scaffold function.
  3. om_odoo_inheritence => name of new model which you want to create.
  4. F:\Source\Odoo\server\custom_addons\ => directory of new model. Please be awared \ at the end.

Upvotes: 0

Solution

  1. Actívate your venv "ven/Script activate"
  2. Execute in your addons directory "python odoo-bin scaffold <name_custom_module> "

PD: if You prefer define other place to put your <custon_module> You can do it ofbthis way: python odoo-bin scaffold "<name_custom_module> dir/route-that-you-prefer"

Upvotes: 0

mackelele
mackelele

Reputation: 129

Maybe this will help someone.
After googling around I found this post.

I too had issue with using scaffold command in windows and couldn't understand what is wrong with it, until I figure it out.
My issue was that I was getting error

PermissionError: [WinError 5] Access is denied: 'C:\Program Files\

This is basically telling you that permission is denied as you cannot create inside of the above mentioned path. This got me to thinking that I have not pointed to the right path and my solution below worked.
Good Luck

I presume that your project is up and running / installed correctly, so if so this will work.

  1. Navigate to the project folder
  2. Run command like this
    python odoo-bin scaffold yourmodulename ./addons
    (make sure that your python is installed and win environment is setup to recognize the python command)



I tried this in Git Bash and Command Prompt and it works.

Upvotes: 1

Sambat
Sambat

Reputation: 64

I have created the summarize of all the process of command to create the module and change the addon repository.

Run your CMD as administration and copy and paste the command below and hit enter.

"C:\Program Files (x86)\Odoo 12.0\python\python.exe" "C:\Program Files (x86)\Odoo 12.0\server\odoo-bin" scaffold manageasset "C:\Users\User\Desktop\custom_addons"

<==============================================>

Command explanation:

"C:\Program Files (x86)\Odoo 12.0\python\python.exe" "C:\Program Files (x86)\Odoo 12.0\server\odoo-bin": this command is the respository of your odoo12 instalation -It used to be odoo-bin.

"scaffold": will create the module.

"manageasset": name of your module.

"C:\Users\User\Desktop\custom_addons": your custom module directory. By default It is "C:\Program Files (x86)\Odoo 12.0\server\odoo\addons".

<==============================================>

Incase you don't know how to change the addon directory follow this:

  1. Go to this repository: "C:\Program Files (x86)\Odoo 12.0\server"
  2. Find this file: "odoo.conf"
  3. Find the word addons_path and add the new repository you want. Example: addons_path = C:\Program Files (x86)\Odoo 12.0\server\odoo\addons,C:\Users\User\Desktop\custom_addons

<====================The end========================> Link to github gist

Upvotes: 0

Lance
Lance

Reputation: 21

I used the following method for Odoo 12.0 installed on Windows. First run command prompt as administrator. Then use cd to change directory. Then execute python, navigate to odoo-bin, call scaffold with parameters 1)module name and 2)qualified install location. (openacademy is the name of the module from the tutorial)

C:\WINDOWS\system32>cd C:\Program Files (x86)\Odoo 12.0\python

C:\Program Files (x86)\Odoo 12.0\python>python ..\server\odoo-bin scaffold openacademy ..\server\odoo\addons

Upvotes: 2

Beginner
Beginner

Reputation: 166

Use this command on the command-line:

"<Path_to_python.exe in the Odoo folder>" "<Path_to_odoo-bin>" scaffold "<Path_to_addons_folder>"

E.g.:

"c:\Program Files (x86)\Odoo 11.0\python\python.exe" "C:\Program Files (x86)\Odoo 11.0\server\odoo-bin" scaffold <module name here> "C:\Program Files (x86)\Odoo 11.0\server\odoo\addons"

Upvotes: 15

Related Questions