openerp

How to import .py file from another directory? [duplicate]

眉间皱痕 提交于 2019-11-27 18:31:57
This question already has an answer here: How to do relative imports in Python? 14 answers I have this structure of files (directory and after arrow files): model -> py_file.py report -> other_py_file.py main __init__.py : import model import report model directory: import py_file report directory: import other_py_file now in other_py_file I want to import py_file , but what ever I try I give error that there is no such module. I tried this: from model import py_file Then: import py_file Looks like these two folders don't see each other. What is the way to import file from other directory? Do

How to get products available quantity (Odoo v8 and v9)

邮差的信 提交于 2019-11-27 16:55:33
问题 I need to get products available quantity from odoo stock. There are several models I stock_quant, stock_move, stock_location. What I am trying to achieve are two things: Products total available quantity Products available quantity based on location Can anyone please guide me? 回答1: Stock related fields are defines in products (functional field) and directly from the product you can get the stock for all warehouses / locations or for individual location / warehouse. Example: For all

error: command 'gcc' failed with exit status when installing psycopg2

血红的双手。 提交于 2019-11-27 14:41:17
问题 i need to install psycopg2 for openerp installation process, but i always found that error. i've already used pip and easy_install , my gcc is the latest version. Really need your help to solve my problem... this is my complete error with easy_install.. [root@server01 ~]# easy_install psycopg2 Searching for psycopg2 Reading http://pypi.python.org/simple/psycopg2/ Reading http://initd.org/psycopg/ Reading http://initd.org/projects/psycopg2 Best match: psycopg2 2.4.5 Downloading http://initd

Filling Many2many field (odoo 8)

依然范特西╮ 提交于 2019-11-27 11:50:29
What I've done: I have a module with myfield = fields.Many2one('res.partner', string="Graduate", domain=[('is_graduated', '=', True)]) Then I have another class with _inherit = 'res.partner' is_graduated = fields.Boolean("Graduated before?", default=False) graduations = fields.Many2many('my_module.courses', string="Graduation courses") What I get: The myfield works good, but the graduations field is empty. If you edit user 1 profile you can add entries to graduation field using Add item , but I need it to be filled automaticaly. What I expect: I expect that every record where myfield is set to

Exclude an alias from virtualhost proxypass

对着背影说爱祢 提交于 2019-11-27 11:47:41
问题 I've following virtual host configuration. The desired result is: If someone requests http://test.myserver.com/myapp, apache serves him from /var/www/myapp And if http://test.myserver.com/ is requested, apache redirects it to port 8069. 2nd is working but 1st is not. Can someone help please! <VirtualHost *:80> ServerName test.myserver.com Alias /myapp /var/www/myapp <Directory /var/www/myapp> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all <

Which are the available domain operators in Openerp / Odoo?

牧云@^-^@ 提交于 2019-11-27 10:30:21
I know few operator in openerp domain. I dont get the details of available domains and their explanation. Particularly for these negation domains. Can anyone tell me the detail list? This gives a overview: List of Domain operators: ! (Not), | (Or), & (And) List of Term operators: '=', '!=', '<=', '<', '>', '>=', '=?', '=like', '=ilike', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of' Usage : Input records: Record 1: Openerp Record 2: openerp Record 3: Opensource Record 4: opensource Record 5: Open Record 6: open Record 7: Odoo Record 8: odoo Record 9: Odooopenerp Record 10

How to filter datas in OpenERP using domain list

蓝咒 提交于 2019-11-27 10:23:36
问题 I want to filter recods in OPenERP using domain filter expression In the recored I have a field of list of users, so i want get the record where the user logged in the list [(user.id , 'in' , 'user_ids')] This doesn't work it return this error : File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2356, in search return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4846,

How I open remote server folder using python?

前提是你 提交于 2019-11-27 07:18:39
问题 How to Open the remote server folder > inside the folder only images store we read all the images. Server is Linux server import paramiko import sys import os ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('<server-Ip-address>', username='******', password='******') ftp = ssh.open_sftp() #filea = ftp.get('/var/www/folder_image/', '#') #Here coded how we open the dir and read one by one all images property(name,size,path,etc.) ftp.close() I

How to display an image in a QWeb report?

陌路散爱 提交于 2019-11-27 03:49:55
问题 I extended the 'report.external_layout_footer' qweb view to display image. Below is my code in the file reports/external_layout.xml: <template id="report_footer_custom" inherit_id="report.external_layout_footer"> <xpath expr="//div[@class='footer']" position="replace"> <div class="footer"> <img t-att-src="'data:image/jpeg;base64,/var/www/cbl_openerp/openerp/cap_addons/cap_sale/img/footer.jpeg'"/> <ul class="list-inline"> <li>Page:</li> <li> <span class="page"/> </li> <li>/</li> <li> <span

Odoo 9. How to override form widgets?

不羁岁月 提交于 2019-11-27 00:58:09
问题 I work with odoo 9 . In the system exists render_value method for each type of field: /odoo/addons/web/static/src/js/views/form_widgets.js /odoo/addons/web/static/src/js/views/form_relational_widgets.js How I can use my custom method render_value (for example in FieldChar ) for all forms? And how I can use specific render_value for one form or one module? I created form_widgets.js in my module, but I not understand how properly override Field. odoo.define('my_module.form_widgets', function