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...
javascript,browser,openerp,openerp-7
<input type="button" value="click" onclick="window.print();"> ...
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...
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"/>...
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...
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...
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...
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...
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' :...
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 :) ...
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....
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...
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...
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...
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 = {...
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...
Try This: attrs="{'readonly':[('apply_to_future','!=',False)]}" ...
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....
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...
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]...
openerp,openerp-7,trunk,openerp-8
I upgraded the database using the option openerp-server.py -d db --init=sale ...
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...
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):...
raise osv.except_osv(('Error'), ('Error Cannot Edit')) ...
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"/>...
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...
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...
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',...
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...
report,designer,openoffice.org,openerp-7
You have to check a record like this and click 'Print' to fin your report
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...
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...
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 ...
<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...
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...
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....
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....
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> ...
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) " \...
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,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) ...
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" /> ...
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...
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...
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...
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 <...
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...
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>...
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...
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...
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...
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,...
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...
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....
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...
Yes, you can do it. Try adding readonly=False 'capname': fields.function(_convert_capital, string='Display Name', type='char', store=True, readonly=False),...
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...
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...
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...
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...
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...
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...
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...
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). ...