openerp

Odoo throws a MissingError On treeview Second line record

醉酒当歌 提交于 2019-12-20 05:15:52
问题 How can i solve this error Odoo throws a MissingError on TreeView Second line button when clicked . The first Record line works but i need such that for each record on the tree the code below will be able to pass the contexts and open the appropriate view . Kindly assist Here is the code called on the button @api.multi def action_four_weeks_schedule_form(self): self.ensure_one() res = {} ids = self._ids cr = self._cr uid = self._uid context = self._context.copy() for id in self.browse(self

OpenERP Email validation

↘锁芯ラ 提交于 2019-12-20 04:36:14
问题 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'),

Field level access rights and Security in openerp 7

浪子不回头ぞ 提交于 2019-12-20 04:22:39
问题 Suppose I have 3 users which are as follows: user_employee having access rights Human Resource /Employee group user_officer having access rights Human Resource /officer group user_manager having access rights Human Resource /manager group For object hr_employee(hr.employee) If I am logged in as user_manager or user_officer I can create/edit my own employee record. If I am logged in as user_employee I cannot edit my own employee record. Then I gave write permission to Human Resource/Employee

How to run Odoo ORM methods in the python console?

て烟熏妆下的殇ゞ 提交于 2019-12-19 19:57:48
问题 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? 回答1: 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

How to run Odoo ORM methods in the python console?

允我心安 提交于 2019-12-19 19:57:05
问题 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? 回答1: 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

Debugging in OpenERP 7.0

别等时光非礼了梦想. 提交于 2019-12-19 17:15:52
问题 How to do debug in OpenERP v7? In previous versions of OpenERP, it was easy to debug. But in the latest version it's tough to debug. 回答1: To debug your OpenERP+python code in eclipse, start eclipse (helios/indigo only) in debug perspective and follow the given steps: 1: Stop your openERP running server by pressing "ctr+c". 2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run'). 3: After

OSV method's return statement

☆樱花仙子☆ 提交于 2019-12-19 08:28:45
问题 In OpenERP, an OSV object can return something which can open a new view or activate an action. For instance, sale.order has manual_invoice method which returns the following: return { 'name': _('Customer Invoices'), 'view_type': 'form', 'view_mode': 'form', 'view_id': [res_id], 'res_model': 'account.invoice', 'context': "{'type':'out_invoice'}", 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': 'current', 'res_id': inv_ids and inv_ids[0] or False, } and it opens an invoice form

different permissions based on workflow state

被刻印的时光 ゝ 提交于 2019-12-19 03:33:27
问题 I need to set up different permission on an object based on its workflow state. For instance, 'manager group' can edit the object only if state=draft but 'super manager group' can edit it also if state=validated. It seems that's not possible using ir.model.access and I'm evaluating if it could be done using ir.rule . It seems not... Is there a official way to get this or do I need to implement this feature (maybe by adding a condition into ir.model.access machinery). 回答1: This is not possible

OpenERP fields.function() explanation [duplicate]

£可爱£侵袭症+ 提交于 2019-12-18 16:48:05
问题 This question already has an answer here : How does one use the store parameter of function fields? (1 answer) Closed 4 years ago . I got this code from stock.py file and line number 163 'complete_name': fields.function(_complete_name, type='char', size=256, string="Location Name", store={'stock.location': (_get_sublocations, ['name', 'location_id'], 10)}), please give me a explanation about below store attribute in above field. can we use fields.function( with type='many2one' ? if can please

ReadOnly field saved with NULL value

人走茶凉 提交于 2019-12-18 09:26:20
问题 On CRM opportunity form view, i added readonly="1" for probability field. When i saved, whatever the value of my probability, it's stored with NULL value. Is it a bug on OpenERP ? 回答1: We have two values like client side and server side. In Server side coding done like float value have 0.0 etc. Read only field doesn't take value from the Client side because it's read only. In View, we see that 0.0 for float value because of server side coding. If you remove read only attribute, you can get