FAQ Database Discussion Community


OpenERP 7 : How can I open a decoded file as a CSV file?

python,csv,decode,openerp-7
I have a module which asks the user to give a csv file, with the binary field. So once the module has it, I decode it and write the result in a Temporary File, but then I can't open it as a CSV file : I will get the error...

filter tree view of header model on base of values of the detail model

openerp,odoo,openerp-7
I have a model 'purchase_approval_item' with an invoice_id multiple people approve the invoice and they are registered in the model 'purchase_approval_item_line' Now i need to show the 'purchase_approval_item' in a tree view, but filter is for the logged in user. I want to add one2many field in 'purchase_approval_item', approved_by_ids which...

Update a field from other field with button

python,openerp,odoo,openerp-7
I have a problem when I update field1 with the value of field2 from button in the same form. <field name="field1" /> <field name="field2" /> <button name="button1" type="object" /> Here is method code: def button1(self, cr, uid, ids, context=None): ... return self.write(cr, uid, ids, {'field1': field2}, context=context) _columns = {...

how i know who is the active user in odoo 8

openerp,openerp-7,odoo,openerp-8,odoo-8
i have a table orders this orders are made by juan, and juan asigment to pedro, i want to list only the orders for pedro when Pedro logg, how i can filter this???? i have a table orders this orders are made by juan, and juan asigment to pedro, i...

OpenERP : Multiple module overriding onchange function

python,openerp,onchange,openerp-7,overriding
I need to override onchange_partner_id function present in sale.order but I'm working on a system that already have a module overriding this function. I tried to write my own onchange_partner_id with similar code : def onchange_partner_id(self, cr, uid, ids, part): res = super(sale_order, self).onchange_partner_id(cr, uid, ids, part) // doing some...

How to set a specific lines order in a one2many field in OpenERP7?

order,openerp,openerp-7
Is it possible to order lines in a one2many field by a specific column without modifying the original class order? Let's put an example: The model res.partner is ordered by the field name. So, if you open a res.partner view, the rows are going to be ordered by their name....

Status of invoice in partner ledger report

python-2.7,openerp-7,odoo-8
I want to add status(open, paid,draft) of customer invoice in partner ledger report for each invoice. I am try to add the status of customer invoice in partner ledger report in odoo 8. This is the template where i am going to inherit: <template id="report_partnerledger"> <t t-call="report.html_container"> <t t-call="report.internal_layout"> <div...

How to create a summary table of an one2many table in OpenERP7?

python,xml,openerp,odoo,openerp-7
I have tree models: res.partner, my_category and partner_my_category_rel. The relationship between partner and category is a many2many, but I needed to store some attributes in the relationship table (not only the IDs, but also the registration date), so, as you may know, I had to create the intermediate table by...

What happens when there is more than one access right for the same object in ACL OpenErp?

openerp,openerp-7
How does ACL behave when there is more than one access rights for the same object for the same group. For example: There is two rights entries for the object 'partner' for the same group sale/manager, having different accesses. res.partner.sale.manager - Partner - Sales / Manager res.partner.crm.user - Partner -...

Python convert datetime string to date

python,django,python-2.7,openerp,openerp-7
I have this string (It's come from a variable. as a example, st_date) '2015-01-28 03:00:00' and I want to parse the date and convert to type:date datetime.date 2015-01-28 from it.. How could I do that?...

How to create Task ( project.task ) under specific customer (res.partner ) in ODOO?

ios,openerp,odoo,openerp-7,openerp-8
How to create Task ( project.task ) for specific customer (res.partner ) in ODOO / OpenERP ? I am sending below input parameter for creating Task under customer : ( Sample Database, 1, Pass4ODOO, project.task, create, { "categ_ids" = ( ( 6, 0, ( ) ) ); description = "";...

Access inherited field of a model from a view

openerp,openerp-7
I'm working on OpenERP7, trying to access a related field located in a parent model of said related model. If someone at this point understand something, you're way smarter than I am, so i will just put the example of what i'm trying to achieve : My model : class...

change existing filter string in OpenERP

openerp,openerp-7,odoo
I'm trying to add a custom filter for a state, basically I just needed to edit the string of an already existing filter. So I made this XML part but I can't quite figure out what I'm doing wrong here: <record id="sale_order_list_select" model="ir.ui.view"> <field name="name">sale.order.list.select</field> <field name="model">sale.order</field> <field name="inherit_id" ref="base.view_sales_order_filter"/>...

How to get the uploaded file name in Openerp

openerp,openerp-7
When I Upload a file using binary field in openerp and saved it, at the time of downloading I am not getting the same name as I uploaded from my lacal i.e, my file name is odoo.pdf during upload, while download it automatically changes into model name i.e (pay_slip_doc) pay_slip_doc...

Where can I configure groups like “stock.group_stock_user” with Open ERP?

security,openerp-7,groups
There are several groups for view interface of Open ERP. (groups="base.group_user", "stock.group_stock_user" etc). It seems I can create own custom one. But, where can I create and modify manage them? How can I configure which ERP users belong to this group?...

Change a many2one field content in onchange from another field?

openerp,odoo,openerp-7,odoo-8
Im trying to change the content of a many2one field when another field trigger onchange method. Heres my py code: class proevent(osv.osv): _name = 'proevent.events' _description = 'Events Module' def onchange_client(self,cr,uid,ids, client_id,sale_orders_ids,context=None): res={} order_obj = self.pool.get('sale.order') order_ids = order_obj.search(cr,uid, [('partner_id','=',client_id)]) logging.info('LIST OF SALE ORDERS OF SELECTED PARTNER') logging.info(order_ids) res['sale_orders_ids'] =...

u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!' in OpenERP V7

xml,openerp-7
In my module i try to regtoup the date field by day, but when trying to upgrade the module an Invalid XML for view error appear: This is the part of XML that generate the error (:year): <record model="ir.ui.view" id="id_view_contact"> <field name="name">test.base.graph.view1</field> <field name="model">test.base</field> <field name="type">graph</field> <field name="arch" type="xml"> <graph...

how to fetch a column in browse_record_list in orm browse method in openERP

python-2.7,orm,openerp-7
I'm beginner in openERP. I'm trying to get a column in a table. While using ORM browse method and iterating that object i got the result in browse_record_list as browse_record(table.name,21). I want to fetch that particular id 21 alone through that browse method but instead im getting same browse_record as...

Get the string field modification before it's update

python,openerp-7
I'have a String Field called 'sujet' in my class reclamation.I ve been trying to get the field value before it's update this way i will know what's the words that have been added or deleted from my field by comparing the filed value before and after the update Exemple_1: Field...

How add more security policies to a password in ODOO(OpenERP)

openerp,odoo,openerp-7,openerp-8,odoo-8
How to add the password policy on user or employee form with the required,A number(0...9), especial character(@, *, ...), Password size > 6, A capital letter(A...Z), etc Do you have any solution for to implement this policy.?...

how to create a function to raise error in openerp

openerp,odoo,openerp-7,raiseerror
I want to create a function that raise an error when the user enters a not valid date,so if we enter a date before the current date it will show an error, any ideas? My class looks like: class business_trip(orm.Model): _columns = {'start_trip': fields.datetime('Trip Starts on:',translate=True, required=False), 'start_business': fields.datetime('Business Starts...

RML report openerp 7

openerp,openerp-7,odoo,openerp-8,rml
How to get the field which is present in sale.order in invoice report. So invoice report use the model account.invoice, if i add a function in report.py it allow only self.cr,self.uid because we are not using osv.memory. So how to get the value of cust_ref_value from sale.order to invoice report.

OpenERP 7 : How can I set a default date in a create form?

python,date,openerp-7
I am new to OpenERP and Python and I am trying to set a default date in a create form which has to be 28 days after when the user is using the create form. The last thing I've tried is this : from datetime import datetime from datetime import...

Adding reference of current record in a one2many relationship

python,reference,openerp-7
import openerp from openerp import netsvc, tools, pooler from openerp.osv import fields, osv from openerp.tools.translate import _ import time import sys import os import string import logging _logger = logging.getLogger(__name__) #_logger.error("my variable : %r", my_var) class reclamation(osv.Model): _name = '_reclamation' _columns = { 'num': fields.char('Numéro'), 'etat': fields.selection([('o','Ouvert'),('f','Fermé')],'Etat'), 'catg': fields.selection([('p','Production'),('s','Sinistre')],'Catégorie'), 'souscatg':...

how to display openerp error message

python,openerp,openerp-7,odoo
In my student module I inherited res.partner. And I want to restrict to modify name in partner view if partner is a student. here is my cord. from openerp.osv import osv, fields class res_partner(osv.Model): _inherit = 'res.partner' _columns = { 'name': fields.char('Name', size=250, required=True, select=True), 'is_student': fields.boolean('Student', readonly=True), } def...

Get deleted records id's from ODOO Sever

openerp,odoo,openerp-7,openerp-8,odoo-8
I am doing offline implementation for ODOO/ OpenERP iOS application. In this can i get list of deleted records from odoo server ?? If some record is deleted from ODOO web and same record is still present in my mobile database, i want to delete that from mobile too. I...