This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redstone.xmlrpc.XmlRpcClient; | |
import redstone.xmlrpc.XmlRpcException; | |
import redstone.xmlrpc.XmlRpcFault; | |
import java.net.MalformedURLException; | |
import java.util.HashMap; | |
import redstone.xmlrpc.XmlRpcArray; | |
import redstone.xmlrpc.XmlRpcStruct; | |
public class MagentoClient { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd = new Date(); | |
dd.setDate(dd.getDate()+14); // this works as expected. | |
or below code : | |
var today = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At dhtmlxscheduler_debug.js , near line number : 2436 | |
Default you can see one month : | |
scheduler._reset_month_scale=function(b,dd,sd){ | |
var ed=scheduler.date.add(dd,1,"month"); | |
With month view to see next 3 month : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
to = '[email protected]' | |
gmail_user = '[email protected]' | |
gmail_pwd = '22222' | |
smtpserver = smtplib.SMTP("smtp.gmail.com",587) | |
smtpserver.ehlo() | |
smtpserver.starttls() | |
smtpserver.ehlo | |
smtpserver.login(gmail_user, gmail_pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Within OpenERP sometime its critical to manage simple email sending feature. | |
So to make easy it, use below code inside your model. | |
Just add this method inside your model. also set smtp user and password details with method. | |
This works fine with a lots of system. | |
== To use == |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# First import python library or package or files | |
import smtplib | |
# Then import openerp related packages or libs | |
from osv import fields, osv | |
import addons | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AGPL | |
# [email protected], | |
# Developing network ssh scanner tool by IP addresses. | |
import socket, sys | |
import libssh2 | |
DEBUG=False | |
usage = """Do a SSH remote command with username@hostname Usage: %s <hostname> <username> <password> <command>""" % __file__[__file__.rfind('/')+1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' Utility to scan my mailbox for new mesages from Logwatch on systems and then | |
grab useful info from the message and output a summary page. | |
''' | |
import os, sys, imaplib, rfc822, re, StringIO | |
server ='mail.brianlane.com' | |
username='yourusername' | |
password='yourpassword' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getrecords:function(model,domain){ | |
domain = [[1,'=',1]]; // conditional parameter to filter data from server. | |
var ids = this.rpc.db(["database_name","userid","password",model,"search", [ | |
domain,"",((this.currentpage) * this.listlimit),this.listlimit | |
]]) | |
// var field_names = _.pluck(this.ir.data.viewarch.field.tree.field ,'name'); // with form view this does not require. | |
var recs = this.rpc.db(["database_name","userid","password",model,"read", [ | |
ids | |
]]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need to import , import smtplib | |
def notify_leave_approval(self, cr, uid, ids=False, context=None): | |
print "leave notification...." | |
leave_ids = self.search(cr, uid, [('state','=','confirm')], context=context) | |
leaves = self.browse(cr, uid, leave_ids, context=context) | |
for leave in leaves: | |
email_from = leave.employee_id.work_email or "[email protected]" | |
email_to = leave.employee_id.parent_id.work_email or "[email protected]" | |
subject = "Auto Email Sender" |
OlderNewer