openerp-8

What is wrong with following code in Python?

别来无恙 提交于 2020-01-04 02:12:20
问题 I was trying to implement a constraint for a field but instead of causing a constraint validation, it allows the record to get saved without showing any constraint message def _check_contact_number(self, cr, uid, ids, context=None): for rec in self.browse(cr, uid, ids, context=context): if rec.contact_number: size=len(str(rec.contact_number)) if size<10: return False if not contact_number: return {} contact_number = rec.contact_number.replace('.','') #removes any '.' from the string contact

Add the new Dynamic Field in Odoo

限于喜欢 提交于 2020-01-03 03:50:42
问题 Is it possible to add new field based on View in Postgresql in Odoo without using Odoo model class file. ? 回答1: You can get have a model getting it's data from a view. In fact that's widely used by reports. But the field list available needs to defined in the model. 回答2: for creating dynamic views in odoo, you better refer this link Here is the solution Specify the parameter _auto=False to the OpenERP object, so no table corresponding to the _columns dictionary is created automatically. Add a

how to integrate Odoo with MySQL

混江龙づ霸主 提交于 2020-01-02 06:13:29
问题 I am trying to integrate Odoo(openerp-8) with MySQL on ubuntu server, to get the database access instead of postgresql. But I am unable to figure out the correct way to do that. I tried this link, but it didn't help me http://openerp-team.blogspot.de/2009/08/open-erp-server-with-mysql.html Any better ideas on configuring odoo with MySQL? 回答1: In Odoo apps Store One Free module Available name is "External Database Sources" This module allows you to define connections to foreign databases using

How to create the Window Setup for Odoo 8.0?

放肆的年华 提交于 2020-01-02 01:20:13
问题 I have created so many custom module in ODOO 8.0 adones and I want to create the ODOO Setup file for that for Window installation then Which kind of steps I want to follow or does it need to require for separate software that make my Window setup file. 回答1: This document may helpful for you for create window .exe file for OpenERP V6 please refere the below link : https://doc.odoo.com/6.0/developer/8_24_build/ 回答2: You may try this V8 to see if it can solve your problem. I've tried it on

How to prevent duplicated records and only update it?

妖精的绣舞 提交于 2019-12-25 03:11:48
问题 i want to add some records to another table model without duplicated it i create a function to check the table data and return specific values to add it in another table here is my code def lol_hah(self,cr,uid,ids,context=None): noobs_data=[] cr.execute("select DISTINCT ON (subject_id)subject_id from fci_attendance_line") noobs1 = cr.dictfetchall() ages = [li['subject_id'] for li in noobs1] print (ages) for k in ages: cr.execute( "select DISTINCT ON (student_id)student_id, count(present) AS

Where does Odoo save the contents of My Dashboard

坚强是说给别人听的谎言 提交于 2019-12-23 05:42:18
问题 I need to know where Odoo saves the views that will be shown in (My Dashboard) when we click (Add to My Dashboard). I looked in the table scheme and I could only find one related table: board_create which is used to save the custom dashboards the user creates. But I only want to find out where the contents (the views not the data) of the default Dashboard are saved in the database. 回答1: In OpenERP 7 and 8 you can find the view for dashboard in 'ir_ui_view_custom' table. The view will be saved

Odoo 8 (Openerp): Setting values using Wizard from list view

烈酒焚心 提交于 2019-12-23 03:45:07
问题 I'm having some issues with an Odoo Wizard in a list view that would take a value from the selected (checked) list items to update another record. For instance, I added a column to res_partner called related_partner_id. Basically, it's used to classify master accounts (partners). When adding a new customer, I have setup a dropdown that I could assign the master account. The database updates the related_partner_id to the child account's id from res_partner. Here is the view I'm using. <?xml

how to set a different message for an email template in odoo?

江枫思渺然 提交于 2019-12-22 17:54:31
问题 I created a custom module and had used the calendar object to create an event and the code is as follows def create_calender_event(self,cr,uid,ids,context=None): calendar_obj = self.pool.get('calendar.event') for rec in self.browse(cr,uid,ids,context=context): if rec.action: for rec_res in rec.action: calendar_obj.create(cr,uid,{'name' : rec_res.act_ion, 'user_id' : rec_res.asgnd_to.id, 'start_date' : rec_res.due_date, 'stop_date' : rec_res.due_date, 'allday' : True, 'partner_ids' : [(6,0,

how to set a different message for an email template in odoo?

人走茶凉 提交于 2019-12-22 17:54:13
问题 I created a custom module and had used the calendar object to create an event and the code is as follows def create_calender_event(self,cr,uid,ids,context=None): calendar_obj = self.pool.get('calendar.event') for rec in self.browse(cr,uid,ids,context=context): if rec.action: for rec_res in rec.action: calendar_obj.create(cr,uid,{'name' : rec_res.act_ion, 'user_id' : rec_res.asgnd_to.id, 'start_date' : rec_res.due_date, 'stop_date' : rec_res.due_date, 'allday' : True, 'partner_ids' : [(6,0,

odoo one2many default not set

风格不统一 提交于 2019-12-20 17:29:49
问题 I wrote a wizard which form view should show a one2many field with rows taken from context['active_ids']. I set the one2many default correctly, but when the form opens, no rows are showed. Did I miss anything? (I apologize for code bad indentation) class delivery_wizard(models.TransientModel): _name = 'as.delivery.wizard' address = fields.Many2one('res.partner') details = fields.One2many('as.delivery.detail.wizard', 'delivery') carrier = fields.Many2one('delivery.carrier') @api.model def