Menu
  • HOME
  • TAGS

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

openerp,odoo,openerp-7,openerp-8,odoo-8

If you take a look at the user definition, you can find the password field: 'password': fields.char('Password', size=64, invisible=True, copy=False, help="Keep empty if you don't want the user to be able to connect on the system."), In order to implement your desired behavior, create an 'onchange' method for the password...

Print view form like from browser?

javascript,browser,openerp,openerp-7

<input type="button" value="click" onclick="window.print();"> ...

OpenERP 7 | Is there an on_submit like event and a way to figure out if there was a change on any of the form fields?

openerp,openerp-7

The OpenERP ORM has a create and write method. You will need to override both as they both act as on_submit type methods but are called for new or existing records. All you do is override one or both methods and call super to make sure the record is actually...

Openerp - need to remove 'Can be Sold' in Product Template form

product,openerp-7

Add this to ur view file.... <record id="view_product_form" model="ir.ui.view"> <field name="name">product.product.form</field> <field name="model">product.product</field> <field name="type">form</field> <field name="inherit_id" ref="product.product_normal_form_view"/> <field name="arch" type="xml"> <xpath expr="//div[@class='oe_title']" position="replace"> <div class="oe_title"> <div class="oe_edit_only"> <label for="name" string="Product Name"/>...

Get deleted records id's from ODOO Sever

openerp,odoo,openerp-7,openerp-8,odoo-8

There is no any API or any method to fetch out deleted records from Odoo. So, you have to manage other way. Like deleted_ids = set(mobile_ids)-set(Odoo_ids)...

What do I return for function field value?

openerp,openerp-7

Like all function fields, it must return a dictionary with an entry and value for every ID you get passed in ids, although your value can be False, None, [] In your case your functional field is declared as a one2many type which means your functional field must return a...

How to use a filter for many2one filed on form?

python,openerp,openerp-7

Use domain filter in py or xml as domain = "[('categ_id','=',categ1)]" Or Overwrite def search method of product.product and pass categ field as parameter def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context is None: context = {} if context and context.get('search_default_categ_id', False): args.append((('categ_id', '=', context['categ_id']))) return...

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

order,openerp,openerp-7

Finally, I found a way to manage this, downloading this module: https://www.odoo.com/apps/modules/7.0/one2many_sorted/ Then, I overrided the one2many whose order I want to alter, in my case the field was child_ids, and I wanted it to be ordered by email: 'child_ids' : one2many_sorted.one2many_sorted( 'res.partner', 'parent_id', 'Contacts', order='email', ) Note that the...

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

python,date,openerp-7

Your code will work fine in the latest code. But for your issue you need to return the date as string, not date object in the format expected by the ORM. Make a following change to your code. from datetime import date from datetime import timedelta from dateutil.relativedelta import relativedelta...

Related type field not showing value

python,field,openerp,openerp-7

In OpenERP, When you use related field, it's give value or output based on it's type. For example type='char', See other fields type. In your case you need to use type='many2one' for getting desire output. try this, class activity_summary(osv.osv): _name = "budget.activity_summary" _rec_name = "activity_summarycode" _columns = { 'activity_summarycode' :...

make a page tab dynamic invisible with domain in inherited view

openerp,openerp-7

You are totally going on wrong way to do that job. Just you can do with the the following way to do your job some thing like this. <xpath expr="//page[@string='Functions']" position="attributes"> <attribute name="attrs">{'invisible':[('org_type_id','!=',0)]}</attribute> I hope this should helpful for you :) ...

OpenERP Property Leasing Management

openerp-7

The module is developed by Pragmatic Techsoft Pvt Ltd and you can find the product page here: http://pragtech.co.in/labs/verticals/openerp-property-rental.html Most likely you'll have to pay for it. One way to find out is to contact Pragmatic and ask....

RML report openerp 7

openerp,openerp-7,odoo,openerp-8,rml

We can track from the Source Document In report.py we need to make a function and pass origin in it. def __init__(self, cr, uid, name, context): super(your_report_calss_name, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_cust_ref_val': self._get_cust_ref_val, }) This method will check like origin is SO or PO or OUT/###:SO### or...

openerp email Reminder on Lead: 1

email,openerp-7

You need to deactivated the cron job. Follow these steps: Go to Setting => Technical => Scheduler => Scheduled Actions Search out something like Lead or Reminder on Lead If you found, than edit that record with Active = False After that you will no longer get any emails from...

How do I make a new tree view for res.partner without inheriting the default tree?

openerp,openerp-7,openerp-8

Turns out the cause was because of this <field name="name">CUSTOM</field>. Coincidentally I changed content here to CUSTOM while in my original code it was still Customer. It somehow indicates that I inherited the original view. I don't know what's the purpose of the inherit_id then. But after I changed the...

How to get the uploaded file name in Openerp

openerp,openerp-7

You should add a field for filename and use it in the filename attribute of the binary field. You can keep this field visible or invisible as per your requirement. The following is the code example for the same: class your_class(osv.osv_model): _name = "yourclassname" _description = "yourclassdescription" _columns = {...

Why Insert command when button clicked OpenERP

python,openerp-7

I'm pretty sure that this _inherit='product.product' in your class is breaking the things. Your original form (not the one you try to open with the button) is trying to save the object before executing the button's action. As the model this form is dealing with inherits 'product.product', your form is...

Make a field readonly in edit mode and editable in create mode in openerp

xml,openerp-7

Try This: attrs="{'readonly':[('apply_to_future','!=',False)]}" ...

attribute error: when trying to write in form xml

python,xml,openerp,attributeerror,openerp-7

One of self._columns is a unicode object. The reason is that you update self._columns with a wrong type of data. It keeps {'field_name':openerp.osv.fields.date object} but here: temp=self.pool.get('deg.form').browse(cr,uid,id) fields={'myname':temp.name,'mytype':temp.data_type} self._columns.update(fields) you update _columns with weird values....

Uncaught TypeError: Cannot read property 'prototype' of null using Openerp 7.0

javascript,jquery,exception,openerp-7

I have solved this problem myself. Though want to share details with you. So that anyone come across same, then this reference might be helpful. After debugging the code have found that module information are stored in one particular table called ir_module_module, in this table it store the state of...

Openerp 7: AttributeError: “Field 'name' does not exist in object 'browse_record(wizard_set_ages, 1)'”

python,openerp,wizard,openerp-7,odoo

Try this code it will work. def set_all_age(self, cr, uid, ids, context=None): mystudents = self.pool.get('student.student') searching_val= mystudents.search(cr, uid, [('id', '!=', ids)]) for student in mystudents.browse(cr, uid, searching_val, context=context): my_description = str(student.name).upper() mystudents.write(cr, uid, student.id, {'notes': my_description}) def set_selected_age(self, cr, uid, ids, context=None): mystudents = self.pool.get('student.student') data = self.read(cr, uid, ids,)[-1]...

sale order/create all leads :Can't create Sales Orders

openerp,openerp-7,trunk,openerp-8

I upgraded the database using the option openerp-server.py -d db --init=sale ...

How to apply filter in search view, based on user - OpenERP 7.0?

filter,treeview,openerp,searchview,openerp-7

I guess I'm loosing my mind with OpenERP. I was formatting badly the filter domain, I should use uid instead of user.id. This way, filters should be <filter icon="terp-mail-message-new" string="My Requests" name="my_requests_filter" domain="[('requestor','='uid)]" /> And, BTW, if one wants to set a filter as a default on tree view, it...

Retrieving all records from a table of openerp with mako templates

openerp,mako,openerp-7

Create a method in parser that returns all the records where finalizado & en_recorrida are False import time from report import report_sxw from osv import osv class flete_webkit(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(flete_webkit, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'cr':cr, 'uid': uid, 'get_records': self._get_records, }) def _get_records(self):...

how to display openerp error message

python,openerp,openerp-7,odoo

raise osv.except_osv(('Error'), ('Error Cannot Edit')) ...

Openerp payslip with leave in salary rule with python code

python,openerp-7

try this, I coded in air. Hope this help. Create a code for Medical as WORK100 has and than you can access in salary rules. like worked_days.Medical.no_of_medical_leave_days otherwise it's give error like Wrong python code. <record id="hr_rule_medical_days" model="hr.salary.rule"> <field name="name">Medical Leave Days</field> <field name="sequence" eval="1"/> <field name="code">MEDICAL</field> <field name="category_id" ref="hr_payroll.DED"/>...

openerp rml report on temporary table

openerp,openerp-7,rml

I solved my problem. Basically, in the report Class, ex. class account_invoice_custom(report_sxw.rml_parse), I have to update the localcontext dictionary, so every key=>value pair in the object will be callable from the .rml file. Supposing I want to retrieve an object, myTestObj: self.localcontext.update({ 'testObj' : myTestObj }) In the RML report...

Get the string field modification before it's update

python,openerp-7

Problem Solved i was doing it wrong. Well to better understand the solution we need to understand the write() method values paramater.Values contains the new String in my case "stackoverflows community is the best community". In order to get the field ancient value we need obviously to query the database...

Generate a code with a wizard on openERP 7

module,openerp,wizard,openerp-7,odoo

You can check OpenERP Technical Memento

How to call a function of a OpenERP class through openerplib or xmlrpclib?

python,controller,openerp,openerp-7,xmlrpclib

Yes you can call function using xmlrpclib. try this, import xmlrpclib #dbname = "my_db" #username = "admin" #pwd = "my_pwd" sock_common = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/common') #uid = sock_common.login(dbname, username, pwd) uid = sock_common.login("my_db", "admin", "my_pwd") sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object') #this will search all ids of res_partner class partner_ids = sock.execute(dbname, uid, pwd, 'res.partner',...

OpenERP wizard syntax

python,openerp,wizard,openerp-7,odoo

Documentation on wizard is a little unclear, I had (still have) some dificulty to understand how it works, but I'll leave you here an example of a working wizard with a text field, that saves into a calling object (you have to change the names of the tables to adapt...

Cant find new reports created with OpenOffice for openerp 7

report,designer,openoffice.org,openerp-7

You have to check a record like this and click 'Print' to fin your report

OpenERP Set default filter from back end

python,python-2.7,openerp,openerp-7

First need to add filter in search view filter of object op.timetable like <filter string="Postponed" name="state_postponed" domain="[('state','=','postponed')]" icon="terp-document-new"/> Action id is act_open_op_timetable_view and edit and add default filter like <field name="context">{'search_default_state_postponed': 1}</field> Hope this will solve your problem. EDIT: If you want to restrict other state record than we need...

Why can't i use domain in selection filed?

field,selection,openerp-7

Your syntax is wrong. Structure of Domain is => domain=[('field_value','operator','value')] correct is:- <field name="amount_mode" style="width:11em" domain="[('amount_mode', '=', 'a')]" You can also add domain in .py file field also. And if you want to see that value is selection box default than you can add in .py file for example. _defaults...

How to display name_get() in openerp?

openerp-7

Try following, def name_get(self, cr, uid, ids, context=None): res = [] if not ids: return res for r in self.browse(cr, uid, ids, context=context): name = str(r.name) + ',' + str(r.description or '') res.append((r.id, name)) return res ...

How to inherit views porperly in openerp 7.0

openerp-7

<record model="ir.ui.view" id="inherit_form_view1"> <field name="name">Inherit Form</field> <field name="model">student.info.student</field> <field name="type">form</field> <field name="inherit_id" ref="student_info_student.form_view1" /> <field name="arch" type="xml"> <field name="mname" positon="after"> <field name="m_tongue" /> </field> </field> </record> Your ref is wrong! structure must be "module_name"."view_name". Further using xpath is...

How to write a python function called automatically?

python-2.7,openerp-7

function field will get automatically call without any event or button. If store=True will store the value of the field in database. Once stored then the functional fields function will not be executed again. If 'store'=False, then every time(any change in the record) the functional field will be executed from...

Change a many2one field content in onchange from another field?

openerp,odoo,openerp-7,odoo-8

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) return {'domain':{'sale_orders_ids':[('id','in',order_ids)]}} you can do it with set domain on many2one field....

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

xml,openerp-7

in your syntax : <field name="create_date:year" type="row" group="False" /> ":year" doesn't exist in OpenERP v7, it is a new feature that was added in Odoo 8, the new version of OpenERP....

Trouble with updating account.invoice workflow

button,workflow,state,invoice,openerp-7

you probably need to change the worflow definition in the xml file in order to add the new transitions. Ex: <record model="workflow.transition" id="your_new_transition"> <field name="act_from" ref="saved" /> <field name="act_to" ref="canceled" /> <field name="signal">invoice_cancel</field> </record> ...

Status of invoice in partner ledger report

python-2.7,openerp-7,odoo-8

I did this using the below: self.cr.execute( "SELECT l.id, l.date, j.code, acc.code as a_code, acc.name as a_name, l.period_id, inv.state, inv.date_due, l.ref, m.name as move_name, l.name, l.debit, l.credit, l.amount_currency,l.currency_id, c.symbol AS currency_code " \ "FROM account_move_line l " \ "LEFT JOIN account_journal j " \ "ON (l.journal_id = j.id) " \...

Update a field from other field with button

python,openerp,odoo,openerp-7

First you need to browse that record and than assign it's value to a field1. Try with this def button1(self, cr, uid, ids, context=None): field2 = self.browse(cr, uid, ids[0], context=context).field2 return self.write(cr, uid, ids, {'field1': field2}, context=context) ...

Python convert datetime string to date

python,django,python-2.7,openerp,openerp-7

Use dateutil: import dateutil.parser dateutil.parser.parse('2015-01-28 03:00:00').date() >>datetime.date(2015, 1, 28) ...

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

openerp,odoo,openerp-7

You want to filter the purchase_approval_item tree to have only the records where the approved_by_ids one2many field contains a certain a user - probably the current one. You should have a search view for your purchase_approval_item model, with: <filter domain="[('approved_by_ids', 'in', [uid])]" name="filter_my_approvals" string="My Approvals" /> ...

Attribute error in onchange method

python,openerp,onchange,openerp-7

Your activity_id is relationship with budget.activity_summary and you get value from budget.activity_year. I think that might be relationship with budget.activity_year. Change this relationship and try below on_change method. try this on_change def onchange_activity_code(self, cr, uid, ids, activity_id, context = None): res = {} names = self.pool.get('budget.activity_summary').browse(cr, uid, activity_id, context=context) if...

how i know who is the active user in odoo 8

openerp,openerp-7,odoo,openerp-8,odoo-8

You should use record rules and add following rule for sale.order model [('create_uid', '=', user.id)] user object keeps info about current logged user....

How to call a wizard from a function in OpenERP7?

python,xml,openerp,wizard,openerp-7

It's not possible to return a dictionary from an ORM method. That's the reason for which I'm not able to return my wizard from the unlink function.

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

python-2.7,orm,openerp-7

You can access all the fields of that table from the browsable object. id = browse_record.id name = browse_record.name Similarly you can access all the relational tables data as well, like customer in sale order. partner_id = sale_order_object.partner_id.id partner_name = sale_order_object.partner_id.name You can also update tables data through that browsable...

Adding reference of current record in a one2many relationship

python,reference,openerp-7

class parent(osv.Model): _name = 'parent' _columns = { 'field1' : fields.one2many('child','field2','Childs Field'), } class child(osv.Model): _name = 'child' _columns = { 'field2': fields.many2one('parent', 'Parents Field'), } You need a field in child class to hold the reference of parent class. Technically parent id will be stored in child, not child...

how to create a function to raise error in openerp

openerp,odoo,openerp-7,raiseerror

You can add Add Python constraints like, @api.one @api.constrains('start_trip', 'start_business', 'end_business', 'end_trip') def _check_date(self): now = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT) if self.start_trip and now < self.start_trip: raise exceptions.ValidationError("Entered Date Should be greter then Today") elif self.start_business and now < self.start_business: raise exceptions.ValidationError("Entered Date Should be greter then Today") elif self.end_business and now <...

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

ios,openerp,odoo,openerp-7,openerp-8

You do not describe how you are interfacing with Odoo, but I looks like you are using some library performing XML-RPC calls. The create() API function accepts a dictionary with the data for the new record to be created. It looks like that the dictionary after the create, argument should...

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

python,xml,openerp,odoo,openerp-7

I've just found a solution!! The problem arose when I clicked on the button Close, Discard or Save, the popup was closed and the function field of type="one2many" had no time to be reloaded. So I added an option to the function field: <field name="summary" options="{'reload_on_button': True}"> <tree> ... </tree>...

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

openerp,openerp-7

Group specific rules are combined together with logical OR, (GROUP_1_RULE_1 OR GROUP_1_RULE_2) OR (GROUP_2_RULE_1 OR GROUP_2_RULE_2) while global rules are combined together with a logical AND operator. GLOBAL_RULE_1 AND GLOBAL_RULE_2 and global rules as well as group specific rules are combined together like GLOBAL_RULE_1 AND GLOBAL_RULE_2 AND ( (GROUP_1_RULE_1 OR...

How to create calendar view in OpenERP?

openerp,openerp-7,openerp-8

Provide color attribute to the calendar and date_start and date_stop field to specify the datetime data-type. So change the data-type from date to datetime after than it will work fine. Try with this code, class lich(osv.osv): _name = "tt_lich" _columns = { 'name': fields.char('Mã lịch trình',size=20,required=True), 'date_start':fields.datetime('Ngày bắt đầu'), 'date_stop':fields.datetime('Ngày...

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

openerp,openerp-7,openerp-8

It look like you need to set default value for your company. for that you need to use _defaults model attribute which sets default value for your field. like _defaults = { 'company_id': get_company } before this method you need to define get_company method which should return company id like...

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

python,csv,decode,openerp-7

The error is on the line fic = csv.reader(open(fileobj, "rb")) open() is complaining that its argument is a file object, instead of a string or buffer. That's because the variable fileobj is a file object, which was open with: fileobj = TemporaryFile('w+') You just have to replace: fic = csv.reader(open(fileobj,...

Field not hiding from tree view using Fields_view_get

python,field,openerp-7,invisible

Try this <field name="field_name" invisible="context.get('flag',False)" /> you can pass context to list view using action which is bind to the list view. <record id="action_account_tree1" model="ir.actions.act_window"> <field name="name">Analytic Items</field> <field name="res_model">account.analytic.line</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> <field name="context">{'flag':True}</field> </record> No need to...

Access inherited field of a model from a view

openerp,openerp-7

You need to define your last class as below. class trench_depth(trench_dig_common): _name = 'trench.depth' _inherit = 'trench.dig.common' trench_depth() Then after you can access all fields which are available inside "trehch.dig.common" model....

OpenERP Server Error When Click New Module Install

python,postgresql,openerp,openerp-7,openerp-8

Like as per @Danish said, he has problem of wkhtmltopdf problem and solved by blow step. So here is solution. Thanks...

How to make functional field has editable in openerp?

openerp,odoo,openerp-7

Yes, you can do it. Try adding readonly=False 'capname': fields.function(_convert_capital, string='Display Name', type='char', store=True, readonly=False),...

unable to login to OpenERP7

python,openerp,openerp-7

You have a problem on an Action Rule. Try deactivating them to see if you can login. Open psql or a pgAdmin Query window, and run: update base_action_rule set active = 'f' Then later on go to Configuration -> Technical -> Automated Actions, and make an Advanced Filter: Active is...

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

security,openerp-7,groups

Groups is the key role in Odoo (formally OpenERP) Security based on the user security group is the major role for implement any module for specifically user access. How to create the Group and update with the existing group in OpenERP : I am just updating the existing security Group...

Don't allow to quote below the sales price of a product in openerp

python,xml,openerp-7

Call the function for the field price_unit in the view xml <xpath expr="//field[@name='price_unit']" position="attributes"> <attribute name="on_change">check_margin(product_id,price_unit)</attribute> </xpath> and in the class, define the function to process it. def check_margin(self, cr, uid, ids, product_id, unit_price, context=None): res = {} warning = {} sale_price = None if product_id: sale_price = self.pool.get('product.product').browse(cr, uid,product_id).list_price...

change existing filter string in OpenERP

openerp,openerp-7,odoo

If you only want to change the string of existing filter than use attributes for example: <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="sale.view_sales_order_filter"/> <field name="arch" type="xml"> <filter string="To Invoice" position="attributes"> <attribute name = "string">WON</attribute> </filter> <!-- After "Sales" filter it will add new...

Menuitem action openERP 7 [closed]

python,module,openerp,openerp-7,odoo

First of all that's not a new window that's Bootstrap Modal you can find it here. On your button click event in js but you have to define your html view for your dialog box as an template in xml. Now on Button click event you have to call that...

What is the abbreviation of Odoo?

openerp,odoo,openerp-7,odoo-8

It doesn't really mean anything, but it could be said to be an acronym for: On Demand Open Object. It's just the new name for OpenERP, which they didn't like. For reference: odoo.com...

OpenERP : Multiple module overriding onchange function

python,openerp,onchange,openerp-7,overriding

Yes you can override this method, for that you need to define new class in which inherit sale.order and define your method. Your method will be called definitely. class sale_order(osv.osv): _inherit = 'sale.order' def onchange_partner_id(self, cr, uid, ids, part, context=None): res = super(sale_order, self).onchange_partner_id(cr, uid, ids, part,context=context) // doing some...

Connect OpenERP with mysql using cr?

openerp,openerp-7,openerp-8

Your way is ok, but: You don't need db.commit() after SELECT. It's necessary only if you change something in database. Instead of getting the number of rows and for x in range(0, numrows) you can use for x in cursor.fetchall():. To get only n elements you can use cursor.fetchmany(n). ...