openerp

How to filter datas in OpenERP using domain list

北城余情 提交于 2019-11-28 17:19:51
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, in _search self._apply_ir_rules(cr, user, query, 'read', context=context) File "/usr/lib/pymodules

How to display an image in a QWeb report?

£可爱£侵袭症+ 提交于 2019-11-28 11:48:40
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 class="topage"/> </li> </ul> </div> </xpath> </template> And here is my openerp .py content : ... "depends

Tasks should show up only if the user has been assigned it

 ̄綄美尐妖づ 提交于 2019-11-28 09:28:05
I only want the person who I have assigned the task to see the task in the project module. I don't want other users of the project to see this persons tasks. However currently any user who has user access rights can see all the tasks even if they were not assigned it. Is there a work around this ? odony OpenERP has two kinds of security restrictions that can be assigned to a user group: Access Rights are CRUD yes/no flags (similar to Unix FS permissions), and allow per-model access control. They state whether members of this group may perform a Create, Read, Update, and Delete operation on any

How to create a dynamic view on OpenERP

廉价感情. 提交于 2019-11-28 08:48:14
I need a help to create a dynamic view. Let me explain: I have Form1 and Form2 views. Form1 contains expression field and extract button. Form2 contains extracted elements of the expression from Form1. For example when you enter (a+b)*c-d*0,5 to Form1's expression field, Form2 should extract and display this: ( - open brace a - variable + - addition b - variable ) - close brace * - multiplication c - variable - - subtraction d - variable * - multiplication 0,5 - constant number Now, here is my class: class wz_formula(osv.osv_memory): """ Formula Wizard """ _name = "wz.formula" _inherit = "ir

openerp web client 6.1: how to override base javascript functions

不想你离开。 提交于 2019-11-28 08:17:19
问题 I'm looking for a way to override some openerp web js core functions such as "on_logout". The docs lack of instructions (as you can see in my post) and the helloworld module tells you that you can do it like openerp.web_hello = function(openerp) { openerp.web.SearchView = openerp.web.SearchView.extend({ init:function() { this._super.apply(this,arguments); this.on_search.add(function(){console.log('hello');}); } }); // here you may tweak globals object, if any, and play with on_* or do_*

Odoo 9. How to override form widgets?

拈花ヽ惹草 提交于 2019-11-28 06:04:24
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 (require) { "use strict"; // what I should do here??? }); Can you provide small example? Thank in advance

ValueError Expected singleton , Odoo8

十年热恋 提交于 2019-11-28 02:01:16
问题 I have been working on a module in Odoo8 on Ubuntu 14.04. I have come up to a strange issue when saving a form record based on some One2many fields. The error says ValueError Expected singleton: hr.employee.pay.change(84, 85) My Python code is as below class hr_employee_pay_change(models.Model): _name='hr.employee.pay.change' hr_payroll_change_ids = fields.Many2one("employee.salary.change", "Employee", ondelete="cascade") @api.onchange('emp_basic', 'emp_allowance') @api.depends('emp_basic',

related field on odoo?

自作多情 提交于 2019-11-28 00:14:26
问题 how to add a field related on odoo I would like to add a text field on stock.move related to stock.picking origin field I tried this : _columns={ 'sourcebl': fields.related('picking_id', 'origin', type='char', relation='stock.picking', string='Class Description', store=True, readonly=True), } do you have any Idea 回答1: You can find more information here : Link In the new API, there is not anymore fields.related. You should define your related field like this : sourcebl = fields.Char(string=

OpenERP/Odoo model relationship XML syntax

北城余情 提交于 2019-11-27 21:25:59
问题 I'm working with OpenERP 7.0. The code below is from the file addons/project/security/project_security.xml Please explain me where the number 4, 6 and 0 are from? Which place in the document I can consult about this? <record id="group_project_user" model="res.groups"> <field name="name">User</field> <field name="category_id" ref="base.module_category_project_management"/> </record> <record id="group_project_manager" model="res.groups"> <field name="name">Manager</field> <field name="category

How to make field readonly based on group and status?

纵饮孤独 提交于 2019-11-27 20:58:20
问题 I want to make field readony based on group, and status. Like i have two grops 1. Manager Group 2. User Group If I give User Group to any user then and Status Done then field will be readonly for this user. Hope I able to make it clear to understand Thank 回答1: Create a functional field of type boolean. If the logged in user is under user group and state is done, then return true. Then in the view, specify attrs="{'readonly':[('boolean_field_name','=',True)]}" OR First create your form view.