openerp

centos6.4 pip 安装openERP7.0

有些话、适合烂在心里 提交于 2019-12-02 07:26:50
在鼓捣openERP玩碰到了几个安装问题,记录下 进入虚拟环境mkvirtuenv openerp 官网下来tar包,pip install -e XXX安装就好。但是会有几个问题 1.源经常会断,换了个国内源,豆瓣跟v2ex都可以 在 ~/.pip/ 下创建文件 pip.conf(如果还没有的话),并填入以下内容: [global] index-url = http://pypi.v2ex.com/simple 2.lxml老是编译失败 libxslt-devel跟libxml2-devel,不过只要装了libxslt-devel会自动把依赖包libxml2-devel安装的 yum install libxslt-devel pip install lxml 3.python-ldap编译失败 查了下,原来他基于的是openldap,不是ldap sudo yum install python - devel sudo yum install openldap - devel pip install python-ldap 4.创建postgreSQL数据库 (OPENERP)[quanpower@Y400 .pip]$ su postgres Password: (OPENERP)[postgres@Y400 .pip]$ psql could not change

OpenERP Email validation

浪尽此生 提交于 2019-12-02 06:25:16
Please let me know , how to prevent record getting saved when user enters invalid email address. Right now system displays warning message for invalid email address which is as per design but it also saves the record with invalid email address. How can we prevent system saving record with invalid email address from osv import osv import smtplib import re from osv import fields class latest_base(osv.osv): _inherit = ['mail.thread'] _name='latest.base' _columns={ 'name':fields.char('Name'), 'image': fields.binary("Image", help="Select image here"), 'state': fields.selection([ ('new','New'), (

Are Odoo rules working OK actually?

偶尔善良 提交于 2019-12-02 01:33:09
MY PURPOSE I'm trying to use security rules to achieve the following purpose: I need to add in users model a field which will set which warehouses each user can modify. This is because I want to hide the stock moves you aren't allowed to see (stock moves of other warehouses). WHAT I DID I've created a Many2many field named allowed_warehouses in res.users model. From here, the administrator can select which warehouses can be used by each user. Then, I took advantage of the existing fields of Odoo, stock.move model has a Many2one field named picking_type_id , pointing to stock.picking.type model

ValueError: dictionary update sequence element #0 has length 1; 2 is required

青春壹個敷衍的年華 提交于 2019-12-01 20:32:16
问题 I am returning 5 for my computational field old_default_code , and I am getting the following error: ValueError: dictionary update sequence element #0 has length 1; 2 is required What am I doing wrong? Python code of the function: def _old_default_code(self, cr, uid, ids, name, arg, context=None): return '5' _columns = { 'old_default_code' : fields.function(_old_default_code, type='char', size=32, method=True, store=False, multi=False) } XML code: <?xml version="1.0" encoding="utf-8"?>

Can not import customize module in openERP

故事扮演 提交于 2019-12-01 20:26:37
i have done simple customize module in openerp with using python and xml. but I cannot import in openerp. My module is not shown in openerp. this is __init__py import os os.environ['TZ'] = 'UTC' # Set the timezone... import time # ... *then* import time. del os del time # The hard-coded super-user id (a.k.a. administrator, or root user). SUPERUSER_ID = 1 import addons import cli import conf import loglevels import modules import netsvc import osv import pooler import release import report import service import sql_db import tools import workflow import sim # backward compatilbility # TODO:

ValueError: dictionary update sequence element #0 has length 1; 2 is required

*爱你&永不变心* 提交于 2019-12-01 18:47:24
I am returning 5 for my computational field old_default_code , and I am getting the following error: ValueError: dictionary update sequence element #0 has length 1; 2 is required What am I doing wrong? Python code of the function: def _old_default_code(self, cr, uid, ids, name, arg, context=None): return '5' _columns = { 'old_default_code' : fields.function(_old_default_code, type='char', size=32, method=True, store=False, multi=False) } XML code: <?xml version="1.0" encoding="utf-8"?> <openerp> <data> <!-- mrp_bom --> <record id="adamson_mrp_bom_form_view" model="ir.ui.view"> <field name=

How to run Odoo ORM methods in the python console?

北慕城南 提交于 2019-12-01 18:08:34
I would like to use ORM methods such as browse or search in the python console. $pwd /opt/odoo/ $python >>> import openerp >>> product_obj = pool.get('product.product) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'pool' is not defined How could I achieve that? In version 9 you can start an odoo shell with odoo.py shell -d <database> , thanks to this commit In version 8 the functionality is not builtin but you can use this script , this module , or OERPLib Pool needs to be connected with a database, so you need to instantiate a pool first, for exemple:

Allowing each manager to see only the project he creates [duplicate]

人盡茶涼 提交于 2019-12-01 14:21:28
Possible Duplicate: Tasks should show up only if the user has been assigned it I know I have to use access rules I am getting confused on how to use the globals here. I want each manager in projects to access only their project, phase and tasks. Cheers, Vishal OpenERP has two kinds of security restrictions that can be assigned to a user group: Record Rules are filters applied on Create, Read, Write, Unlink operations, and allow per-document access-control, once access right are already granted. Users will only be able to perform an operation on a given document if the document matches at least

How to get two _rec_names in odoo for two many2one fields in single class?

China☆狼群 提交于 2019-12-01 14:04:45
I have following code I want this two fields asset_catg_id and folio_num . These should be available for many2one two fields. How to write 2 _rec_name for a single class? class asset_asset(osv.osv): _inherit = "asset.asset" #_name = "asset_asset" _rec_name= "folio_num" #_rec_name = "assetmodelid_add" _columns = { 'name': fields.char('Asset Name', size=64), 'company_id1': fields.many2one('res.company', 'Substation', required=True), #'place1': fields.many2one('asset.parentlocation', 'Location'), 'asset_catg_id' : fields.many2one('asset.catg', 'Asset Catg Selection',select=True, required=True),

Odoo Point of Sale + Posbox : How to modify receipt

北慕城南 提交于 2019-12-01 13:37:57
I need to modify the receipt of Point of sale In Odoo point of sale, the are two templates to print receipt : XmlReceipt and PosTicket As I use a Posbox I guess I have to modify XmlReceipt. I wonder if there is a way to inherit the original template ? I found examples on how to do it with PosTicket template but Xmlreceipt doesnt seem to work the same way. Any ideas ? Thank you. I extends template "PosTicket", find element by t-jquery, replace with my data (Add "Free" to product's name) <templates id="template" > <t t-extend="PosTicket"> <t t-jquery=".receipt-orderlines .product_line" t