Hi I am new to odoo and linux ubuntu 16.04 LTS, I had set up the ubuntu desktop on an oracle vm virtualbox, I have also installed the necessary repository and apt for odoo11, postgresql, python3 and pycharm.
My odoo11 is already working fine and I am able to install and run existing applications, however I have tried to generate a scaffold to develop a module of my own, and I have followed guides and documentations.
My odoo.conf has these options
[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo/odoo-server.log
addons_path = /opt/odoo/odoo/addons,/home/mtsoftware/Documents/projects/tutorial/addons
while my manifest.py has these option
# -*- coding: utf-8 -*-
{
'name': "myfirstModel",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website': "http://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/customer.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}
Upon trying to search for "myfirstModel" in my module list # odoo11 application page, it returns a "No module found!"
Any one can help me?
I am trying to generate a pdf using rst2pdf, but keep getting the error "format not resolved, probably missing URL or undefined destination for target".
I use sphinx to generate the .rst files and am able to generate the HTML output just fine.
To generate the pdf I followed the instructions at: https://gist.github.com/alfredodeza/7fb5c667addb1c6963b9
Directory Structure:
- sphinxtext
* docs
** source
** build
* test.py
Conf.py:
# -*- coding: utf-8 -*-
#
# Test documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 30 12:08:40 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..\..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage','rst2pdf.pdfbuilder']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Test'
copyright = u'2017, m.a.'
author = u'm.a.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0.0'
# The full version, including alpha/beta/rc tags.
release = u'1.0.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'Testdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Test.tex', u'Test Documentation',
u'm.a.', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'test', u'Test Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Test', u'Test Documentation',
author, 'Test', 'One line description of project.',
'Miscellaneous'),
]
# -- Options for pdf output -------------------------------------------
pdf_documents = [('index', u'rst2pdf', u'Sample rst2pdf doc', u'Your Name'),]
# index - master document
# rst2pdf - name of the generated pdf
# Sample rst2pdf doc - title of the pdf
# Your Name - author name in the pdf
test.py
class Test(object):
'''
Test class
'''
def __init__(self,**kwargs):
"""
Constructor
"""
def some_func(self,a,b,c,d,e,f,g):
"""
Function that does something TEST
:param a: Identifier
:param b: b
:param c: c
:param d: d
:param e: e
:param f: f
:param g: g
:type a: int
:type b: float
:type c: float
:type d: float
:type e: float
:type f: float
:type h: float
:returns: Test obj
:Example:
>>> test=Test()
>>> test.some_func(10, 42164., 0.0, 0., -132.0, 0.0, 0.0)
"""
self.a=a
self.b = b
self.c = c
self.d = d
self.e = e
self.f = f
self.g = g
return self
When building as html I see the following warning: checking consistency... C:\PATH\docs\source\modules.rst: WARNING: document isn't included in any toctree
My index.rst file:
.. Test documentation master file, created by
sphinx-quickstart on Fri Jun 30 12:08:40 2017.
You can adapt this file completely to your liking, but it should at least
contain the root toctree directive.
Welcome to Test's documentation!
================================
.. toctree::
:maxdepth: 2
:caption: Contents:
test
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
My test.rst:
Test Module!
================================
.. automodule:: test
:members:
This has now been resolved in rst2pdf via PR 619.
You can install the version of rst2pdf that has this fix by doing this:
$ cd {some directory where you keep 3rd-party projects, e.g. ~/projects}
$ git clone https://github.com/rst2pdf/rst2pdf.git
$ cd rst2pdf
$ python setup.py install
If you are still getting this message in 2021, it likely means rst2pdf can't figure out where one or more of your links is pointed. For example, I had in-page nav links in my .rst code like this that were ok when building HTML but causing the error referred to by the OP during PDF generation:
`Back to top ↑ <#top>`_
The most reliable solution seems to be to remove these in-page links.
Alternatively, you could just convert these implicit links to raw html blocks like below, which could be a solution if you can get rst2pdf to render raw html using xhtml2pdf (this isn't working for me, but perhaps someone else can get it).
.. |top| raw:: html
Back to top ↑
|top|
Note that in this alternative solution, the in-page links probably will not work in most PDF viewers, so this is really only a solution to get .rst files to compile to both PDF and HTML (as the OP asked), rather than one that will allow identical behavior.
I have a project that I want to be a part of cocoapods or just have an easy installation via cocoapods.
Ok, let's see in it.
It has directories in root:
Tools/ #directory where all items of project stored
ExternalLibraries/ # directory where all external libraries stored (.a libraries of third party guys with their .h header files)
Submodules/ # directory where all external projects stored that have open source code and can be placed as submodule
Example/ # directory with example
Ok, which options I should specify in Podspec file for correct behaviour?
I ended up with this spec.
Pod::Spec.new do |s|
s.name = "WowProjectTools"
s.source = {
:git => "https://github.com/wow/WowProjectTools.git",
:submodules => true
}
s.source_files = "Tools/**/*.{h,m}" # include all tools files
s.exclude_files = "Example" # exclude all examples
s.frameworks = "Foundation", "SystemConfiguration", "CoreData" # add all frameworks (system frameworks)
s.libraries = "icucore", "z" # ok, I need these libraries like libz.dylib and libicucore.dylib
s.vendored_libraries = 'ExternalLibraries/**' # hmm, these libraries are third party, no?
s.requires_arc = true #
s.xcconfig = { "HEADER_SEARCH_PATHS" => ["./Submodules/**/*.h","./ExternalLibraries/**/*.h"] } # add header search paths
end
I am having a struggle getting this to work so I've created a hell-world Rails app to try and get this to work.
Here's the repo with the code that is not working: https://github.com/pitosalas/shibtry
Here's what I've done starting from an empty Rails application:
I've added two gems to gem files:
gem 'omniauth-shibboleth'
gem 'rack-saml'
I got the shibboleth meta data from my university's web site and converted it using shib_conv.rb into the corresponding YAML: ./config.yml
I've updated routes adding get '/auth/:provider/callback', to: 'sessions#create'
I've put a breakpoint at SessionController#create
I've added initializers: omniauth.rb:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :shibboleth, {
:shib_session_id_field => "Shib-Session-ID",
:shib_application_id_field => "Shib-Application-ID",
:debug => true,
:extra_fields => [
:"unscoped-affiliation",
:entitlement
]
}
end
I've added rack_sam.rb initializer:
Rails.application.config.middleware.insert_after Rack::ETag, Rack::Saml,
{ :metadata => "#{Rails.root}/config/metadata.yml"}
Now, run the server and go to http://0.0.0.0:3000/auth/shibboleth and I get an error:
undefined method `[]' for nil:NilClass'
which is traced back to this line in rack-saml/misc/onelogin_setting.rb line 13 which is:
settings.idp_sso_target_url = #metadata['saml2_http_redirect']
in other words, looking for the metadata hash for that key. It happens that in my metadata.yml file that key is present, but by the time I get to this onelogin_setting.rb line 13, #metadata is nil (it should contain the contents of the file) and consequently that key doesn't exist.
And that's where, for now, the trail dries up.
I bypassed Shibboleth totally. My goal was to allow login to my universities authentication system specifically to allow students to log in with their student login, which is fronted by google apps. So this was much easier: https://developers.google.com/identity/sign-in/web/
Looks like you forgot to add your config file to the initializer:
Rails.application.config.middleware.insert_after Rack::ETag, Rack::Saml,
{
:metadata => "#{Rails.root}/config/metadata.yml",
:config => "#{Rails.root}/config/rack-saml.yml"
}
And the saml_idp setting in the rack-saml.yml must match the key for the idp_lists entry in your metadata.yml
I'm using the (Axlsx gem and it's working great, but I need to add an image to a cell.
I know it can be done with an image file (see Adding image to Excel file generated by Axlsx.?), but I'm having a lot of trouble using our images stored in S3 (through Carrierwave).
Things I've tried:
# image.url = 'http://.../test.jpg'
ws.add_image(:image_src => image.url,:noSelect => true, :noMove => true) do |image|
# ArgumentError: File does not exist
or
ws.add_image(:image_src => image,:noSelect => true, :noMove => true) do |image|
# Invalid Data #<Object ...>
Not sure how to proceed
Try using read to pull the contents into a tempfile and use that location:
t = Tempfile.new('my_image')
t.binmode
t.write image.read
t.close
ws.add_image(:image_src => t.path, ...
To add an alternative answer for Paperclip & S3 as I couldn't find a reference for that besides this answer.
I'm using Rails 5.0.2 and Paperclip 4.3.1.
With image URLs like: http://s3.amazonaws.com/prod/accounts/logos/000/000/001/original/logo.jpg?87879987987987
#logo = #account.company_logo
if #logo.present?
#logo_image = Tempfile.new(['', ".#{#logo.url.split('.').last.split('?').first}"])
#logo_image.binmode # note that our tempfile must be in binary mode
#logo_image.write open(#logo.url).read
#logo_image.rewind
end
In the .xlsx file
sheet.add_image(image_src: #logo_image.path, noSelect: true, noMove: true, hyperlink: "#") do |image|...
Reference link: http://mensfeld.pl/tag/tempfile/ for more reading.
The .split('.').last.split('?').first is to get .jpg from logo.jpg? 87879987987987.