openerp

Openrerp chatter message_post error

我怕爱的太早我们不能终老 提交于 2019-12-24 17:17:51
问题 I have created a custom module with chatter in the form. I want to post a custom message. but I am getting following error. File "/opt/openerp/addons/mail/mail_thread.py", line 1023, in message_post "Invalid thread_id; should be 0, False, an ID or a list with one ID" AssertionError: Invalid thread_id; should be 0, False, an ID or a list with one ID For my .py program is at the following link http://pastebin.com/9Bq4MZQ9 回答1: try this function, Hope this will solve your error. def function

How create a new project in Odoo via my angular2 app?

空扰寡人 提交于 2019-12-24 17:09:18
问题 I am building an app with angular2 that has to be able to fetch and insert data into Odoo database , in that purpose , I am using angular2-odoo-jsonrpc : https://www.npmjs.com/package/angular2-odoo-jsonrpc and I was able to get all the data I needed from Odoo , but , I also want to be able to insert data in the Odoo database , so I used to following code : import { Component, OnInit } from '@angular/core'; import { OdooRPCService } from 'angular2-odoo-jsonrpc'; import { Http} from '@angular

How to refresh the original page after opening a URL in a new tab in OpenERP?

我是研究僧i 提交于 2019-12-24 16:37:02
问题 I have a button that opens a url in a new tab. I want the original page, where the button is, to be reloaded, refreshed, after the opening the url in the new tab. Is it possible to do it? Here is my XML code: <button name="test" type="object" string="Go!" attrs="{'invisible':[('flag_bom_present','=',False)]}" /> Here is my python code: def test(self, cr, uid, ids, context=None): res = { 'type': 'ir.actions.act_url', 'url': 'http://www.google.com' } return res 来源: https://stackoverflow.com

AttributeError: 'NoneType' object has no attribute '_columns'

不问归期 提交于 2019-12-24 15:53:44
问题 I am writing a module in OpenERP that would inherit from the Accounts module. Below is my simplified code from osv import fields, osv import decimal_precision as dp class account_molly(osv.osv): def __computeOB(self, cr, uid, ids, context=None): res = [] return 0 def __computeCB(self, cr, uid, ids, context=None): res = [] return 0 _name = "account.molly" _description = "This is Molly Special Account View" _inherit = "account.account" _columns = { 'opening_balance': fields.function(__computeOB

After inheriting CRM-Lead unable to hide or add fields to my Custom module in Openerp

时间秒杀一切 提交于 2019-12-24 13:23:02
问题 I have created a new custom module and inherited CRM-LEAD. I'm trying add new fields and hide existing fields.I couldn't do it.Can anyone please tell me how can I do it. My code is __init__.py : import lead __openerp__.py : { 'name': 'Lead Information', 'version': '0.1', 'category': 'Tools', 'description': """This module is Lead information.""", 'author': 'Nitesh', 'website': '', 'depends': ['crm'], 'init_xml': ['lead_view.xml'], 'update_xml': [], 'demo_xml': [], 'installable': True, 'active'

list of dictionary consolidation

倾然丶 夕夏残阳落幕 提交于 2019-12-24 12:27:40
问题 what i'm trying to do here is "consolidate" similar lines with the same product_id ,and append it to get one2many field in another view wizard I got to fill a sale_order_line in my wizard field uing this method; def default_get(self, cr, uid, fields, context=None): if context is None: context = {} res = super(sale_order_consolidation, self).default_get(cr, uid, fields, context=context) picking_ids = context.get('active_ids', []) active_model = context.get('active_model') if not picking_ids or

Disable create and discard button for specific function in OpenERP

跟風遠走 提交于 2019-12-24 11:27:51
问题 I have been developing a module for OpenERP 7. I wanted to know that how can I disable create/delete button for a specific function. Like I am clicking on a button to open a tree view. All I want is to disable the create button form top of that tree view. How can I achieve this in OpenERP? I don't have any other ml view for this tree view. I am calling the only tree view. But this time I don't need the create/discard button. Can anyone guide me how to do this? I have a button named "my_views"

How to preview images after uploading in Odoo V10?

陌路散爱 提交于 2019-12-24 09:57:02
问题 There is ir.attachment model available for uploading URL and files but I want to upload images and that can be viewed on the uploading form UI-view. Is there any way I can do it as I haven't found anything on this related to Odoo V10. How can we solve this issue? 回答1: odoo app available on odoo apps page please go throw this url may be it will help you [https://apps.odoo.com/apps/modules/category/Extra%20Tools/browse?search=image+preview] if this helped you please up-vote my answer 回答2: You

How to pass value with onchange one2many variable in odoo?

爱⌒轻易说出口 提交于 2019-12-24 08:47:08
问题 <field name="salary_month"/> <field name="earning_type_id"> <tree editable="bottom"> <field name="earnings_type" /> <field name="based_on" on_change="calc_amount(based_on,salary_month)" /> <field name="amount" /> <field name="total" /> </tree> </field> In the above condition I have two variables one is salary_month another one is one2many variable earning_type_id . While on change inside earning_type_id I need to pass the value of salary_month . Its shows undefined variable salary_month .

Odoo IndexError: list assignment index out of range

你离开我真会死。 提交于 2019-12-24 07:26:58
问题 I just create a module. After adding values and got the problem IndexError: list assignment index out of range. How to fix it. Re Edit code please. Here is my code: class calculator(osv.osv): _name = 'calculator.calculator' def get_total(self, cr, uid, ids, field_name, arg, context): res = [] perfos = self.browse(cr, uid, ids, context) for perfo in perfos: res[perfo.id] = perfo.p + perfo.b return res _columns = { 'p':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As