Posts

How to Return a View Using Python

  How to Return a View Using Python    @api.multi     def invoice_view_form(self):         ir_model = self.env['ir.model.data']         tree_view_id = ir_model.get_object_reference('account','invoice_tree')[1]         form_view_id = ir_model.get_object_reference('account','invoice_form')[1]         inv_ids = self.env['account.invoice'].search([('sale_id','=',self.id)])                 return {             'name': "Invoices",             'view_type': 'form',             'domain' : [('sale_id','=',self.id)],             'view_mode': 'tree,form',             'view_id': wiz_view_id,             'views' : [(wiz_view_id,'tree'),(form_view_id,'form')], ...

How to Delete Menuitem-Odoo

How to Delete Menu item Delete base menuitem is simple. We just need to use delete tag and we need to add the menu item id. Syntax     <delete model="ir.ui.menu" id="Menuitem_id" /> Example <delete model="ir.ui.menu" id="base.module_mi" />

Invalid XML for View Architecture - Openerp7

Few bugs From openerp7: Invalid XML for View Architecture For this Add version = “7.0” attribute in particular Tree or form view then it wont cause any error. e.g) <tree string =”LEAD” version=”7.0”> And Tree or form or search that tag must have string and version attribute ValueError: unsupported format character '!' (0x21) at index 1391 If it is in width attribute means u can use like this. style="width:55%%" two Percentage Symbol

Contact Us

Contact Details : E-mail : codeconcate@gmail.com

Postgres DB Backup & Restore

How to restore postgres db in terminal DB BACKUP: pg_dump -U user_role db_name > archive_name.sql DB RESTORE: psql -U user_role db_name < /directory/archive.sql or .dump or .tar

Display weekday of given date in Python

Display Week Day of Given Date : Getting Started:     * First We have to import  module such as datetime and calendar.           * Create new variable to store the string date.      * Convert the string date into datetime.datetime type using following code               datetime.strptime(<Date>,"%d/%m/%Y")      *  Call this function                 calendar.day_name[my_date.weekday()] > day_name :            1.An array that represents the days of the week in the current locale. >weekday :              1. The weekday() method is used to returns the day of the week (0 is Monday) for year (1970–...), month (1–12), day (1–31). Code :     >>> from datetime import datetime >>> imp...

Find System IP Using Python

⤷Find IP Address Using Python Open Terminal Goto pyton console Enter Following Codes. Source Code: Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.gethostbyname(socket.gethostname()) '127.0.1.1' * For find you ip u need socket package import that *  socket. gethostbyname ( hostname ) Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as  '127.0.1.1' . If the host name is an IPv4 address itself it is returned unchanged.  gethostbyname()  does not support IPv6 name resolution.