[MERGE] merged bugfixes from 6.0 up to revision 4401

bzr revid: odo@openerp.com-20110214114507-8uwohpcblsfhgjae
This commit is contained in:
Olivier Dony 2011-02-14 12:45:07 +01:00
commit 07f520a856
33 changed files with 304 additions and 129 deletions

View File

@ -424,7 +424,7 @@ class account_account(osv.osv):
context = {}
accounts = self.browse(cr, uid, ids, context=context)
for account in accounts:
if account.child_id and account.type != 'view':
if account.child_id and account.type not in ('view', 'consolidation'):
return False
return True

View File

@ -1473,7 +1473,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
if not real_event_id in new_ids:
new_ids.append(real_event_id)
if vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
vals['vtimezone'] = vals['vtimezone'][40:]
updated_vals = self.onchange_dates(cr, uid, new_ids,

View File

@ -77,7 +77,7 @@ intro_save_form = '''<?xml version="1.0"?>
<newline/>
<field name="module_file" filename="module_filename"/>
<separator string="Information" colspan="4"/>
<label string="If you think your module could interest others people, we'd like you to publish it on OpenERP.com, in the 'Modules' section. You can do it through the website or using features of the 'base_module_publish' module." colspan="4" align="0.0"/>
<label string="If you think your module could interest other people, we'd like you to publish it on http://www.openerp.com, in the 'Modules' section. You can do it through the website or using features of the 'base_module_publish' module." colspan="4" align="0.0"/>
<label string="Thanks in advance for your contribution." colspan="4" align="0.0"/>
</form>'''
@ -161,7 +161,7 @@ def _create_module(self, cr, uid, data, context):
} """ % data['form']
filewrite = {
'__init__.py':'#\n# Generated by the OpenERP module recorder !\n#\n',
'__terp__.py':_terp,
'__openerp__.py':_terp,
dname+'_data.xml': res_xml
}
for name,datastr in filewrite.items():

View File

@ -270,6 +270,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
defaults.update({
'subject' : '%s: %s' % (_('Fwd'), lead.name),
'body' : body,
'email_cc' : ''
})
return defaults

View File

@ -47,7 +47,7 @@ class document_ftp_browse(osv.osv_memory):
url = url[:-1]
else:
url = '%s:%s' %(ftpserver.HOST, ftpserver.PORT)
res['url'] = 'ftp://%s@%s/%s'%(current_user.login, url, cr.dbname)
res['url'] = 'ftp://%s@%s'%(current_user.login, url)
return res
def browse_ftp(self, cr, uid, ids, context=None):

View File

@ -96,7 +96,7 @@
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="email_template_account_tree" />
<field name="context">{'group_by': [], 'search_default_draft': 1, 'search_default_my': 1}</field>
<field name="context">{'search_default_draft': 1, 'search_default_my': 1}</field>
<field name="search_view_id" ref="view_email_template_account_search"/>
</record>

View File

@ -105,7 +105,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_email_template_mailbox_tree" />
<field name="context">{'group_by': [], 'search_default_outbox': 1}</field>
<field name="context">{'search_default_outbox': 1}</field>
<field name="help">An email template is an email document that will be sent as part of a marketing campaign. You can personalize it according to specific customer profile fields, so that a partner name or other partner related information may be inserted automatically.</field>
<field name="search_view_id" ref="view_email_template_mailbox_search"/>
</record>

View File

@ -28,6 +28,7 @@ from poplib import POP3_SSL
import netsvc
from osv import osv, fields
import tools
logger = netsvc.Logger()
@ -201,7 +202,7 @@ class email_server(osv.osv):
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
except Exception, e:
logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (e))
logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (tools.ustr(e)))
return True

View File

@ -82,7 +82,6 @@
<field name="name">hr.employee.tree</field>
<field name="model">hr.employee</field>
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree string="Employees">
<field name="name"/>

View File

@ -61,23 +61,25 @@ class report_custom(report_rml):
date_xml.append('</days>')
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
# Computing the attendence by analytical account
cr.execute(
"select line.date, (unit_amount * unit.factor) as amount, account_id, account.name "\
"from account_analytic_line as line, hr_analytic_timesheet as hr, "\
"account_analytic_account as account, product_uom as unit "\
"where hr.line_id=line.id and line.account_id=account.id "\
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(user_id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
# Sum attendence by account, then by day
accounts = {}
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
account = accounts.setdefault((presence['account_id'], presence['name']), {})
account[day] = account.get(day, 0.0) + presence['amount']
header_xml = ''
if user_id:
# Computing the attendence by analytical account
cr.execute(
"select line.date, (unit_amount * unit.factor) as amount, account_id, account.name "\
"from account_analytic_line as line, hr_analytic_timesheet as hr, "\
"account_analytic_account as account, product_uom as unit "\
"where hr.line_id=line.id and line.account_id=account.id "\
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(user_id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
account = accounts.setdefault((presence['account_id'], presence['name']), {})
account[day] = account.get(day, 0.0) + presence['amount']
xml = '''
<time-element date="%s">
@ -85,13 +87,14 @@ class report_custom(report_rml):
</time-element>
'''
rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name)
rml_obj = report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
if user_id:
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name)
account_xml = []
for account, telems in accounts.iteritems():

View File

@ -167,10 +167,6 @@ global name
name=''
global email
email=''
global web_server
web_server = 'localhost'
global web_server_port
web_server_port = '8080'
global country_ref
country_ref = ""
global state_ref
@ -198,7 +194,7 @@ def resetConnAttribs(window):
config = window.manager.LoadConfig()
NewConn.setitem('_server', config['server'])
NewConn.setitem('_port', config['port'])
# NewConn.setitem('protocol', config['protocol'])
NewConn.setitem('protocol', config['protocol'])
NewConn.setitem('_uri', "http://" + config['server'] + ":" + str(config['port']))
NewConn.setitem('_obj_list', config['objects'])
NewConn.setitem('_dbname', config['database'])
@ -207,6 +203,7 @@ def resetConnAttribs(window):
NewConn.setitem('_login', str(config['login']))
NewConn.setitem('_webserver',manager.config['webserver'])
NewConn.setitem('_webport',manager.config['webport'])
NewConn.setitem('_webportocol',manager.config['webportocol'])
return
def setConnAttribs(server, port, manager):
@ -228,6 +225,7 @@ def setConnAttribs(server, port, manager):
NewConn.setitem('_obj_list', manager.config['objects'])
NewConn.setitem('_webserver',manager.config['webserver'])
NewConn.setitem('_webport',manager.config['webport'])
NewConn.setitem('_webprotocol',manager.config['webprotocol'])
return
def getConnAttributes(manager):
@ -241,7 +239,9 @@ def getConnAttributes(manager):
manager.config['login'] = NewConn.getitem('_login')
manager.config['webserver'] = NewConn.getitem('_webserver')
manager.config['webport'] = NewConn.getitem('_webport')
manager.config['webprotocol'] = NewConn.getitem('_webprotocol')
return
def setWebConnAttribs(server, port, manager):
manager.config = manager.LoadConfig()
NewConn.setitem('_webserver',server)
@ -272,6 +272,11 @@ class OKButtonProcessor(ButtonProcessor):
def OnClicked(self, id):
server = win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[0])
protocol = win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[3])
if not protocol:
win32ui.MessageBox("Invalid Protocol !\nPlease select Protocol from Connection Protocol List.", "OpenERP Connection", flag_excl)
return
NewConn.setitem('protocol', protocol)
try:
port = int(win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[1]))
except ValueError, e:
@ -306,9 +311,16 @@ class WEBOKButtonProcessor(ButtonProcessor):
ControlProcessor.__init__(self, window, control_ids)
def OnClicked(self, id):
global web_server
global web_server_port
# global web_server
# global web_server_port
server = win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[0])
web_protocol = 'http:\\\\'
hwnd = win32gui.GetDlgItem(self.window.hwnd, self.other_ids[2])
chk = win32gui.SendMessage(hwnd, win32con.BM_GETCHECK)
if chk:
web_protocol = 'https:\\\\'
NewConn.setitem('_webprotocol', web_protocol)
try:
port = int(win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[1]))
except ValueError:
@ -318,10 +330,21 @@ class WEBOKButtonProcessor(ButtonProcessor):
win32ui.MessageBox("Invalid web Server address.", "OpenERP Connection", flag_excl)
return
setWebConnAttribs(server, port, self.mngr)
web_server = server
web_server_port = port
win32gui.EndDialog(self.window.hwnd, id)
class WEBCHKProcessor(ButtonProcessor):
def __init__(self, window, control_ids):
self.mngr = window.manager
ControlProcessor.__init__(self, window, control_ids)
def OnClicked(self, id):
web_protocol = 'http:\\\\'
hwnd = self.GetControl()
chk = win32gui.SendMessage(hwnd, win32con.BM_GETCHECK)
if chk:
web_protocol = 'https:\\\\'
NewConn.setitem('_webprotocol', web_protocol)
class MessageProcessor(ControlProcessor):
def Init(self):
text = " This Outlook Plugin for OpenERP has been developed by OpenERP s.a.\n\n \
@ -851,9 +874,6 @@ def CreateContact(btnProcessor,*args):
win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.id)
def SetAllText(txtProcessor,*args):
# Set values for url, uname, pwd from config file
global web_server
global web_server_port
url = NewConn.getitem('_uri')
tbox = txtProcessor.GetControl()
win32gui.SendMessage(tbox, win32con.WM_SETTEXT, 0, str(url))
@ -866,9 +886,7 @@ def SetAllText(txtProcessor,*args):
pwd = NewConn.getitem('_pwd')
win32gui.SendMessage(passbox, win32con.WM_SETTEXT, 0, str(pwd))
serverBox = txtProcessor.GetControl(txtProcessor.other_ids[2])
web_server = NewConn.getitem('_webserver')
web_server_port = NewConn.getitem('_webport')
webstr = "http:\\\\"+str(web_server)+":"+str(web_server_port)
webstr = NewConn.getitem('_webprotocol')+NewConn.getitem('_webserver')+":"+str(NewConn.getitem('_webport'))
win32gui.SendMessage(serverBox, win32con.WM_SETTEXT, 0, str(webstr))
def SetDefaultList(listProcessor,*args):
@ -1378,29 +1396,24 @@ def OpenPartnerForm(txtProcessor,*args):
partner_text = ""
try:
partner_text = ustr(mail.SenderName).encode('iso-8859-1')
sender_mail = ustr(mail.SenderEmailAddress).encode('iso-8859-1')
sender_mail = ustr(mail.SenderEmailAddress).strip()
except Exception:
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, "< Error in reading email.>")
pass
vals = NewConn.SearchPartner(sender_mail)
if vals:
if not vals:
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, "< Their is contact related to "+str(partner_text)+" email address, but no partner is linked to contact>")
txtProcessor.init_done=True
return
if vals == None:
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, "< No Partner found linked to "+str(partner_text)+" email address.>")
txtProcessor.init_done=True
return
global web_server
global web_server_port
if web_server.strip() == "" or web_server.strip() == "http:\\\\":
if NewConn.getitem('_webserver') == "" or NewConn.getitem('_webserver') in ["http:\\\\","https:\\\\"]:
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, " <Invalid Server Address>")
txtProcessor.init_done=True
return
try:
import urllib
next = urllib.urlencode({'next' : '/openerp/form/view?model=res.partner&id=' +str(vals) })
weburl = 'http://'+web_server+':'+str(web_server_port)+'/'
weburl = NewConn.getitem('_webprotocol')+NewConn.getitem('_webserver')+":"+str(NewConn.getitem('_webport'))
linktopartner = weburl + '?' + next
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, str(linktopartner))
except Exception,e:
@ -1416,8 +1429,8 @@ def SerachOpenDocuemnt(txtProcessor,*args):
b = check()
if not b:
return
global web_server
global web_server_port
# global web_server
# global web_server_port
#Reading Current Selected Email.
ex = txtProcessor.window.manager.outlook.ActiveExplorer()
assert ex.Selection.Count == 1
@ -1425,8 +1438,8 @@ def SerachOpenDocuemnt(txtProcessor,*args):
#Acquiring control of the text box
link_box = txtProcessor.GetControl()
#Checking for the web server Parameters
if web_server.strip() == "" or web_server.strip() == "http:\\\\":
win32gui.SendMessage(link_box, win32con.WM_SETTEXT, 0, " <Invalid Server Address>")
if NewConn.getitem('_webserver') == "" or NewConn.getitem('_webserver') in ["http:\\\\","https:\\\\"]:
win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, " <Invalid Server Address>")
txtProcessor.init_done=True
return
linktodoc = ""
@ -1460,7 +1473,7 @@ def SerachOpenDocuemnt(txtProcessor,*args):
try:
import urllib
next = urllib.urlencode({'next' : '/openerp/form/view?model='+vals[0][1]+'&id='+str(vals[1][1])})
weburl = 'http://'+web_server+':'+str(web_server_port)+'/'
weburl = NewConn.getitem('_webprotocol')+NewConn.getitem('_webserver')+":"+str(NewConn.getitem('_webport'))
linktodoc = weburl + '?' + next
win32gui.SendMessage(link_box, win32con.WM_SETTEXT, 0, str(linktodoc))
except Exception,e:
@ -1611,7 +1624,6 @@ def SetStateList(listProcessor,*args):
listProcessor.init_done = True
def SelectStateFromList(btnProcessor,*args):
hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
sel_text = ''
@ -1645,7 +1657,41 @@ def SelectStateFromList(btnProcessor,*args):
win32ui.MessageBox("Multiple selection is not allowed.","Search Fed.State")
return
def SetWebDefaultVals(txtProcessor,*args):
import win32con
#Acquiring control of the text box
chk_hwnd = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])
try:
web_server = NewConn.getitem('_webserver')
web_port = NewConn.getitem('_webport')
web_protocol = NewConn.getitem('_webprotocol')
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id, web_server)
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0], web_port)
if web_protocol == "https:\\\\":
win32gui.SendMessage(chk_hwnd , win32con.BM_SETCHECK, 1, 0);
except Exception, e:
txtProcessor.init_done=True
#Reading Current Selected Email.
txtProcessor.init_done=True
def SetServerDefaultVals(txtProcessor,*args):
import win32con
select = 1
#Acquiring control of the text box
cbprotocol_hwnd = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])
try:
web_server = NewConn.getitem('_server')
web_port = NewConn.getitem('_port')
web_protocol = NewConn.getitem('protocol')
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id, web_server)
win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0], web_port)
if web_protocol == "XML-RPCS":
select = 2
win32gui.SendMessage(cbprotocol_hwnd, win32con.CB_SETCURSEL, select, 0)
except Exception, e:
txtProcessor.init_done=True
#Reading Current Selected Email.
txtProcessor.init_done=True
dialog_map = {
"IDD_MANAGER" : (
@ -1679,8 +1725,14 @@ dialog_map = {
),
"IDD_SERVER_PORT_DIALOG" : (
(TextProcessor, "ID_SERVER ID_PORT ID_DROPDOWNLIST_PROTOCOL", SetServerDefaultVals, ()),
(ProtocolComboProcessor, "ID_DROPDOWNLIST_PROTOCOL", GetConn, ()),
(CloseButtonProcessor, "IDCANCEL"),
(OKButtonProcessor, "IDOK ID_SERVER ID_PORT IDR_XML_PROTOCOL"),
(OKButtonProcessor, "IDOK ID_SERVER ID_PORT IDR_XML_PROTOCOL ID_DROPDOWNLIST_PROTOCOL"),
#
# (RadioButtonProcessor, "IDR_XML_PROTOCOL", GetConn, ()),
# (RadioButtonProcessor, "IDR_XMLS_PROTOCOL", GetConn, ()),
# (RadioButtonProcessor, "IDR_NETRPC_PROTOCOL", GetConn, ()),
),
"IDD_SYNC" : (
@ -1738,8 +1790,11 @@ dialog_map = {
(TextProcessor, "IDEB_OPENDOC_LINK_TEXT", SerachOpenDocuemnt,()),
),
"IDD_WEB_SERVER_PORT_DIALOG" :(
(TextProcessor, "IDET_WEB_SERVER IDET_WEB_PORT IDCB_WEB_SECURE", SetWebDefaultVals, ()),
(CloseButtonProcessor, "IDCANCEL"),
(WEBOKButtonProcessor, "ID_WEB_OK IDET_WEB_SERVER IDET_WEB_PORT")
(WEBOKButtonProcessor, "ID_WEB_OK IDET_WEB_SERVER IDET_WEB_PORT IDCB_WEB_SECURE"),
(WEBCHKProcessor, "IDCB_WEB_SECURE"),
),
"IDD_SELECT_COUNTRY" : (
(CommandButtonProcessor, "IDPB_SEARCH_COUNTRY IDET_COUNTRY_SEARCH_NAME IDC_LIST_COUNTRY" , SearchCountry, ()),

View File

@ -225,12 +225,6 @@ class CSComboProcessor(ComboProcessor):
try:
list=['CRM Lead']#, 'CRM Helpdesk', 'CRM Lead', 'CRM Meeting', 'CRM Opportunity', 'CRM Phonecall']
objlist = conn.GetAllObjects()
# if 'crm.claim' in objlist:
# list.append('CRM Claim')
# if 'crm.helpdesk' in objlist:
# list.append('CRM Helpdesk')
# if 'crm.fundraising' in objlist:
# list.append('CRM Fundraising')
if'hr.applicant' in objlist:
list.append('HR Applicant')
if'project.issue' in objlist:
@ -305,4 +299,20 @@ class GroupProcessor(OptionControlProcessor):
def UpdateControl_FromValue(self):
pass
def UpdateValue_FromControl(self):
pass
pass
class ProtocolComboProcessor(ComboProcessor):
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
combo = self.GetControl()
list = ['XML-RPC', 'XML-RPCS']
win32gui.ShowWindow(combo, True)
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT, 0, 0);
for item in list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, str(item))
if sel == -1:
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, 1, 0)
self.active_control_id = self.control_id

View File

@ -208,6 +208,8 @@
#define IDPB_NC_SEARCH_STATE1 2107
#define IDET_NC_PARTNER_COUNTRY 2108
#define IDPB_NC_SEARCH_COUNTRY1 2109
#define ID_DROPDOWNLIST_PROTOCOL 2110
#define IDCB_WEB_SECURE 2111
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED

File diff suppressed because one or more lines are too long

View File

@ -97,18 +97,23 @@ BEGIN
LTEXT "",IDC_ABOUT,80,90,300,100
END
IDD_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 55
IDD_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 90
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "OpenERP Connection"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Server : ",IDC_STATIC,5,3,150,17
EDITTEXT ID_SERVER,40,3,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Port : ",IDC_STATIC,5,18,100,17
EDITTEXT ID_PORT,40,18,100,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,110,35,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,60,35,45,14,WS_TABSTOP
EDITTEXT ID_SERVER, 45, 3, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT " Port : ",IDC_STATIC,5,18,100,17
EDITTEXT ID_PORT, 45, 18, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
GROUPBOX "", IDC_STATIC_GROUP, 5, 35, 150, 5
LTEXT "Protocol Connection :", IDC_STATIC, 5, 45, 80, 17
COMBOBOX ID_DROPDOWNLIST_PROTOCOL, 75, 43, 75, 50, CBS_DROPDOWNLIST |WS_VSCROLL | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,60,70,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,110,70,45,14,WS_TABSTOP
END
IDD_SYNC DIALOGEX 0, 0, 470, 320
@ -287,7 +292,7 @@ BEGIN
PUSHBUTTON "Ok",IDCANCEL,150,45,45,14,WS_TABSTOP
END
IDD_WEB_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 55
IDD_WEB_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 80
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "OpenERP Connection"
@ -297,8 +302,9 @@ BEGIN
EDITTEXT IDET_WEB_SERVER,40,3,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Port : ",IDC_STATIC,5,18,100,17
EDITTEXT IDET_WEB_PORT,40,18,100,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,110,35,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",ID_WEB_OK,60,35,45,14,WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,110,50,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",ID_WEB_OK,50,50,50,14,WS_TABSTOP
PUSHBUTTON "SSL (https)",IDCB_WEB_SECURE,20,35,100,14,BS_AUTOCHECKBOX | BST_CHECKED |WS_TABSTOP
END
IDD_SELECT_COUNTRY DIALOGEX 0, 0, 220, 250
@ -311,7 +317,6 @@ BEGIN
LTEXT "Enter Name : ",IDC_STATIC,8,12,80,17
EDITTEXT IDET_COUNTRY_SEARCH_NAME, 55, 10, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search", IDPB_SEARCH_COUNTRY, 160, 10, 50, 14, WS_TABSTOP
CONTROL "List1",IDC_LIST_COUNTRY,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Select", IDPB_SELECT_COUNTRY, 170, 230, 40, 14, WS_TABSTOP
@ -332,4 +337,3 @@ BEGIN
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Select", IDPB_SELECT_STATE, 170, 230, 40, 14, WS_TABSTOP
END

View File

@ -140,7 +140,7 @@ class OpenERPManager:
def LoadConfig(self):
import win32ui
path = os.path.join(self.data_directory, 'tiny.ini')
data = {'server' : 'localhost', 'port' : '8069', 'protocol' : 'http://', 'database' : '', 'objects' : self.default_objects, 'uname':'admin', 'pwd':'a', 'login':False,'webserver':'localhost','webport':'8080'}
data = {'server' : 'localhost', 'port' : '8069', 'protocol' : 'http://', 'database' : '', 'objects' : self.default_objects, 'uname':'admin', 'pwd':'a', 'login':False,'webserver':'localhost','webport':'8080', 'webprotocol' : 'http:\\'}
if os.path.exists(path):
fp = open(path, 'r')
data = fp.readlines()

View File

@ -80,7 +80,8 @@ class XMLRpcConn(object):
self._iscrm=True
self.partner_id_list=None
self.protocol=None
self._webprotocol=None
self._weburi=None
def getitem(self, attrib):
v=self.__getattribute__(attrib)
@ -442,16 +443,14 @@ class XMLRpcConn(object):
return country_list
def SearchPartner(self, mail_id = ""):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(mail_id))])
if not address:
return None
else:
add_rec = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'read', address[0])
partner = add_rec.get('partner_id',False)
if partner:
return partner[0]
return True
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(mail_id))])
if not address:
return False
add_rec = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'read', address[0])
partner = add_rec.get('partner_id',False)
if partner: return partner[0]
else: return partner
def SearchEmailResources(self, message_id):
import win32ui
@ -462,9 +461,7 @@ class XMLRpcConn(object):
if not mail_id:
ref_mail_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message', 'search', [('references','=',message_id)])
if ref_mail_id:
win32ui.MessageBox(str(ref_mail_id),"ref_mail_id")
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message','read',ref_mail_id[0],['model','res_id'])
win32ui.MessageBox(str(address),"address")
for key, vals in address.items():
res_vals.append([key,vals])
return res_vals

View File

@ -149,7 +149,7 @@
sequence="4"
/>
<menuitem name="Cash register management" parent="point_of_sale.menu_point_root"
<menuitem name="Cash Register Management" parent="point_of_sale.menu_point_root"
id="menu_point_open_config" sequence="1"/>
<menuitem
name="Open Cash Registers" parent="menu_point_open_config"

View File

@ -58,7 +58,7 @@
<field name="user_id"/>
<field name="assigned_to" />
<group colspan="2" col="4">
<field name="type_id" widget="selection" readonly="1"/>
<field name="type_id" readonly="1"/>
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
</group>

View File

@ -257,9 +257,12 @@ class purchase_order(osv.osv):
def onchange_dest_address_id(self, cr, uid, ids, adr_id):
if not adr_id:
return {}
part_id = self.pool.get('res.partner.address').read(cr, uid, [adr_id], ['partner_id'])[0]['partner_id'][0]
loc_id = self.pool.get('res.partner').browse(cr, uid, part_id).property_stock_customer.id
return {'value':{'location_id': loc_id, 'warehouse_id': False}}
values = {'warehouse_id': False}
part_id = self.pool.get('res.partner.address').browse(cr, uid, adr_id).partner_id
if part_id:
loc_id = part_id.property_stock_customer.id
values.update({'location_id': loc_id})
return {'value':values}
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id):
if not warehouse_id:

View File

@ -65,7 +65,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.board_crm_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1/action[@name='%(crm.act_my_oppor)d']" position="after">
<xpath expr="/form/hpaned/child1/action[@string='My Open Opportunities']" position="after">
<action
string="My Quotations"
name="%(action_quotation_for_sale_crm)d"
@ -83,7 +83,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.board_crm_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2/action[@name='%(crm.act_sales_pipeline)d']" position="replace">
<xpath expr="/form/hpaned/child2/action[@string='My Win/Lost Ratio for the Last Year']" position="replace">
<action
string="Monthly Turnover"
name="%(action_turnover_by_month)d"
@ -99,7 +99,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.board_crm_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2/action[@name='%(crm.act_my_oppor_stage)d']" position="attributes">
<xpath expr="/form/hpaned/child2/action[@string='My Planned Revenues by Stage']" position="attributes">
<attribute name="string">Opportunities by Stage</attribute>
</xpath>
</field>

View File

@ -12,18 +12,23 @@ class ShareWizardController(openerp.controllers.SecuredController):
_cp_path = "/share"
@expose()
def index(self, domain, search_domain, context, view_id):
def index(self, domain, search_domain, context, view_id, action_id=None):
context = ast.literal_eval(context)
action_id = rpc.RPCProxy('ir.actions.act_window').search(
[('view_id','=',int(view_id))], context=context)
if not action_id: return ""
if not action_id:
# This should not be needed anymore, but just in case users are
# running the module with an order version of the web client...
# to remove soon-ish
action_id = rpc.RPCProxy('ir.actions.act_window').search(
[('view_id','=',int(view_id))], context=context)
if not action_id: return ""
action_id = action_id[0]
domain = ast.literal_eval(domain)
domain.extend(ast.literal_eval(search_domain))
action_id = action_id[0]
scheme, netloc, _, _, _ = urlparse.urlsplit(cherrypy.request.base)
share_root_url = urlparse.urlunsplit((
scheme, netloc, '/openerp/login',

View File

@ -27,6 +27,7 @@ class ShareActionEditor(openobject.templating.TemplateEditor):
context: jQuery("#_terp_context").val(),
domain: jQuery("#_terp_domain").val(),
view_id: jQuery("#_terp_view_id").val(),
action_id: jQuery("#_terp_action_id").val(),
search_domain: jQuery("#_terp_search_domain").val(),
}));
});

View File

@ -5,11 +5,22 @@ function config_close()
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}
function createMenuItem(aLabel, aValue) {
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
item.setAttribute("label", aLabel);
item.setAttribute("value", aValue);
return item;
}
//set the value of the configuration fields
function config_change_load()
{
var s = getServer();
var a =s.split(':');
var popup = document.getElementById("dbprotocol_list");
popup.menupopup.appendChild(createMenuItem('XML-RPC','http://'));
popup.menupopup.appendChild(createMenuItem('XML-RPCS','https://'));
if (String(a)=="" || String(a)=="undefined"){
document.getElementById('txtcurl').value = "localhost"
document.getElementById('txtcport').value = "8069"
@ -91,6 +102,7 @@ function config_change_load_web()
function config_ok()
{
var protocol = document.getElementById("dbprotocol_list").value
if (document.getElementById('txtcurl').value == '')
{
alert("You Must Enter Server Name!")
@ -102,7 +114,12 @@ function config_ok()
alert("You Must Enter Port!")
return false;
}
setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
if (protocol == '')
{
alert("Invalid Porotocol!\nPlease Select protocol from Connection protocol list.")
return false;
}
setServer(document.getElementById("dbprotocol_list").value+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}

View File

@ -3,23 +3,33 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/config_change.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" onload="config_change_load();"
title="Openerp Connection" height="140" width="240">
title="Openerp Connection" height="180" width="320">
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
<hbox>
<label align="center" id="heading" value="&lblheading.label;" style="padding-left:38px" />
<label align="left" id="heading" value="&lblheading.label;" style="padding-left:38px" />
</hbox>
<groupbox id="gpData" width="200">
<vbox style="border:0.5px solid gray" width="190"/>
<groupbox id="gpData" width="200">
<hbox >
<label id="lblurl" control="txtcurl" value="&lblurl.label;" width="50"/>
<textbox id="txtcurl" width="140" />
<textbox id="txtcurl" width="170" />
</hbox>
<hbox>
<label id="lblport" control="txtcport" value="&lblport.label;" width="50"/>
<textbox id="txtcport" width="140" />
<textbox id="txtcport" width="170" />
</hbox>
<hbox>
<label id="dbprotocol" value="&lblprotocol.label;" width="97" />
<menulist id="dbprotocol_list" width="140">
<menupopup>
<menuitem label="" value=""/>
</menupopup>
</menulist>
</hbox>
</groupbox>

View File

@ -196,11 +196,12 @@ function getPredefinedFolder(type) {
var fname = msgDate8601string+"-"+subj+"-"+hdr.messageKey;
}
var rand1=Math.floor(Math.random()*100000)
var rand2=Math.floor(Math.random()*100000)
fname = rand1+'openerp-eml'+rand2
setFileName(fname)
fname = fname.replace(/[\x00-\x19]/g,"_");
if (mustcorrectname)
fname = nametoascii(fname);
else
fname = fname.replace(/[\/\\:,<>*\?\"\|]/g,"_");
return fname;
}

View File

@ -1,6 +1,6 @@
<!ENTITY lblurl.label "Server: ">
<!ENTITY lblport.label "Port: ">
<!ENTITY lblurl.label " Server: ">
<!ENTITY lblport.label " Port: ">
<!ENTITY lblheading.label "Openerp Connection">
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
<!ENTITY lblprotocol.label "Protocol Connection: ">

View File

@ -0,0 +1,22 @@
# Bulgarian translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-02-11 01:13+0000\n"
"Last-Translator: Dimitar Markov <Unknown>\n"
"Language-Team: Bulgarian <bg@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-11 06:26+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "Съдържание"

View File

@ -0,0 +1,22 @@
# Catalan translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-02-06 12:04+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Catalan <ca@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-07 06:24+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr ""

View File

@ -0,0 +1,22 @@
# Turkish translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-02-08 21:20+0000\n"
"Last-Translator: Ahmet Altınışık <Unknown>\n"
"Language-Team: Turkish <tr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-09 06:02+0000\n"
"X-Generator: Launchpad (build 12177)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "İçindekiler"