[MERGE] addons1

bzr revid: tfr@openerp.com-20110131133223-t4wsqnkekif8edrs
This commit is contained in:
Thibault Francois 2011-01-31 14:32:23 +01:00
commit 80f2b11e4a
26 changed files with 67 additions and 66 deletions

View File

@ -116,10 +116,7 @@ class account_analytic_account(osv.osv):
context = {}
for account in self.browse(cr, uid, ids, context=context):
for child in account.child_ids:
if child.state == 'template':
account.child_ids.pop(account.child_ids.index(child))
result[account.id] = map(lambda x: x.id, account.child_ids)
result[account.id] = map(lambda x: x.id, [child for child in account.child_ids if child.state != 'template'])
return result

View File

@ -294,28 +294,32 @@ class crm_lead(crm_case, osv.osv):
if 'date_closed' in vals:
return super(crm_lead,self).write(cr, uid, ids, vals, context=context)
if 'stage_id' in vals and vals['stage_id']:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
message=''
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead' or context.get('stage_type',False)=='lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
self.log(cr, uid, case.id, message)
return super(crm_lead,self).write(cr, uid, ids, vals, context)
def stage_historize(self, cr, uid, ids, stage, context=None):
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
self.log(cr, uid, case.id, message)
return True
def stage_next(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_next(cr, uid, ids, context=context)
if stage:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
if stage_obj.on_change:
data = {'probability': stage_obj.probability}
self.write(cr, uid, ids, data)
self.stage_historize(cr, uid, ids, stage, context=context)
return stage
def stage_previous(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_previous(cr, uid, ids, context)
if stage:
self.stage_historize(cr, uid, ids, stage, context=context)
return stage
def message_new(self, cr, uid, msg, context=None):
"""
Automatically calls when new email message arrives

View File

@ -7,7 +7,7 @@
!record {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
categ_id: crm.categ_meet2
date: !eval time.strftime('%Y-%m-%d 16:04:00')
date_deadline: !eval "'%s-%s-%s 00:04:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')"
duration: 8.0
email_from: info@balmerinc.be
location: Ahmedabad

View File

@ -51,7 +51,7 @@
I click on "schedule call" button and select planned date for the call.
-
!record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}:
date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
name: 'ABC FUEL CO 829264 - 10002 units'
section_id: crm.section_sales_department
user_id: base.user_demo
@ -72,7 +72,7 @@
I can see phonecall record after click on "Schedule call" wizard.
-
!record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}:
date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
duration: 3.0
name: 'ABC FUEL CO 829264 - 10002 units'
partner_address_id: base.res_partner_address_1

View File

@ -64,8 +64,8 @@
-
!record {model: crm.meeting, id: crm_meeting_interviewcall0}:
alarm_id: base_calendar.alarm3
date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
duration: 8.0
email_from: info@balmerinc.be
name: Interview call
@ -81,7 +81,7 @@
phonecall.
-
!record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}:
date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
name: Interview call
section_id: crm.section_sales_department
user_id: base.user_root

View File

@ -37,7 +37,7 @@
<separator string="" colspan="6"/>
<group colspan="6" col="4" >
<field name="state" />
<button string="_Cancel" icon="gtk-cancel" special="cancel" />
<button string="_Cancel" icon="gtk-close" special="cancel" />
<button name="action_send" type="object" string="_Send" icon="gtk-go-forward" />
</group>
</form>
@ -82,7 +82,7 @@
<separator string=" " colspan="4"/>
<group colspan="4" col="3" >
<label string=" " />
<button string="_Cancel" icon="gtk-cancel" special="cancel" />
<button string="_Cancel" icon="gtk-close" special="cancel" />
<button name="action_send" type="object" string="_Send Reply" icon="gtk-go-forward" />
</group>
</form>

View File

@ -26,7 +26,7 @@
I create a payroll register record.
-
!record {model: hr.payroll.register, id: hr_payroll_register_payroll0}:
date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d')"
line_ids:
- employee_id: hr_payroll.hr_employee_keith0
name: payroll1

View File

@ -84,8 +84,8 @@
!record {model: crm.meeting, id: crm_meeting_fresher0}:
alarm_id: base_calendar.alarm1
count: 0.0
date: !eval "'%s-%s-%s 00:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date_deadline: !eval "'%s-%s-%s 08:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)"
date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:00:00')"
date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 08:00:00')"
day: 0.0
duration: 8.0
name: Fresher

View File

@ -66,7 +66,7 @@
I create a new lunch order "LU002" for the "Club1" product, at another date.
-
!record {model: lunch.order, id: lunch_order_1}:
date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+2)"
date: !eval "(datetime.now() + timedelta(2)).strftime('%Y-%m-%d')"
product: 'lunch_product_club1'
price: 2.75
user_id: base.user_root

View File

@ -128,7 +128,7 @@ class mailgate_thread(osv.osv):
for case in cases:
attachments = []
for att in attach:
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
attachments.append(att_obj.create(cr, uid, {'res_model':case._name,'res_id':case.id, 'name': att[0], 'datas': base64.encodestring(att[1])}))
partner_id = hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False
if not partner_id and case._name == 'res.partner':
@ -220,11 +220,12 @@ class mailgate_message(osv.osv):
action_data = False
action_pool = self.pool.get('ir.actions.act_window')
message_pool = self.browse(cr ,uid, ids, context=context)[0]
att_ids = [x.id for x in message_pool.attachment_ids]
action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')])
if action_ids:
action_data = action_pool.read(cr, uid, action_ids[0], context=context)
action_data.update({
'domain': [('res_id','=',message_pool.res_id),('res_model','=',message_pool.model)],
'domain': [('id','in',att_ids)],
'nodestroy': True
})
return action_data

View File

@ -7,7 +7,7 @@
categ_id: product.cat1
membership: 1
membership_date_from: !eval datetime.today().strftime("%Y-%m-%d")
membership_date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)"
membership_date_to: !eval "(datetime.now() + timedelta(6*31)).strftime('%Y-%m-%d')"
name: Golden Membership
type: service
list_price: 80.00
@ -103,7 +103,7 @@
categ_id: product.cat1
membership: 1
membership_date_from: !eval datetime.today().strftime("%Y-%m-%d")
membership_date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)"
membership_date_to: !eval "(datetime.now() + timedelta(6*31)).strftime('%Y-%m-%d')"
name: Silver Membership
type: service
list_price: 50.00

View File

@ -7,9 +7,11 @@ Pre requirements :
http://sourceforge.net/projects/pywin32/ or
http://starship.python.net/crew/mhammond/win32/
3.If you are using MS Outlook 2007 than you are required to install "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)". It can be downloaded from
http://www.microsoft.com/downloads/en/details.aspx?familyid=2714320d-c997-4de1-986f-24f081725d36&displaylang=en
and With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
and With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
To read more regarding Collaboration Data Objects(CDO) click following link:
+ http://support.microsoft.com/kb/171440
How to install openerp-outlook plug-in?
======================================================================================
1. Save the executable plug-in file.

View File

@ -56,7 +56,7 @@ Pre-requirements :
1. Python 2.6+ .
2. Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python.
3.1 If With MS Outlook 2007 it is required to install externally "Collaboration Data Objects, version 1.2.1".
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
- http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
3.2 With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
How to install openerp-outlook plug-in?

View File

@ -421,6 +421,7 @@ class DialogCommand(ButtonProcessor):
return "Displays the %s dialog" % dd.caption
def TestConnection(btnProcessor,*args):
dbname = None
server = NewConn.getitem('_server')
port = NewConn.getitem('_port')
NewConn.GetDBList()
@ -428,18 +429,19 @@ def TestConnection(btnProcessor,*args):
btnProcessor.window.LoadAllControls()
win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)
return
try:
dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, 7000)
if not dbname:
win32ui.MessageBox("Authentication Error !\nBad Database Name !", "OpenERP Connection", flag_excl)
return
except Exception,e:
print "Exception %s: %s"%(type(e),str(e))
dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
if not dbname:
try:
dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, 7000)
if not dbname:
win32ui.MessageBox("Authentication Error !\nBad Database Name !", "OpenERP Connection", flag_excl)
return
except Exception,e:
pass
if not dbname:
win32ui.MessageBox("No database found on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)
return
uname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
pwd = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
@ -470,7 +472,7 @@ def TestConnection(btnProcessor,*args):
flag = flag_stop
NewConn.setitem('_login', 'False')
except Exception,e:
msg = "Authentication Error !\n\n" + getMessage(e)
msg = "Authentication Error !\n Invalid Configuration Please check server parameters and database name."
flag = flag_error
win32ui.MessageBox(msg, "OpenERP Connection", flag)
return

View File

@ -94,7 +94,7 @@ class DBComboProcessor(ComboProcessor):
"EDIT",
db,
dwStyle,
67,80,180,20,
127,80,235,20,
parent,
7000,
0,

View File

@ -108,7 +108,10 @@ class XMLRpcConn(object):
self._uname = user
self._pwd = pwd
conn = xmlrpclib.ServerProxy(str(self._uri) + '/xmlrpc/common')
uid = execute(conn,'login',dbname, ustr(user), ustr(pwd))
try:
uid = execute(conn,'login',dbname, ustr(user), ustr(pwd))
except:
return False
return uid
def GetAllObjects(self):
@ -288,7 +291,6 @@ class XMLRpcConn(object):
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
referances = headers.get('References')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")

View File

@ -93,7 +93,7 @@
journal_id: account_journal_cash0
line_ids:
- name: statement
date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+5,datetime.now().day)"
date: !eval "(datetime.now() + timedelta(5*31)).strftime('%Y-%m-%d')"
type: customer
account_id: account_pos_account_sales
amount: 100

View File

@ -290,7 +290,7 @@
!record {model: pos.order, id: pos_order_pos0}:
company_id: base.main_company
date_order: !eval time.strftime('%Y-%m-%d %H:%M:%S')
date_validity: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+6,datetime.now().day)"
date_validity: !eval "(datetime.now() + timedelta(6*1)).strftime('%Y-%m-%d')"
lines:
- company_id: base.main_company
name: Order Line/01

View File

@ -21,7 +21,6 @@
##############################################################################
from osv import fields, osv
from osv.osv import except_osv
from tools.translate import _
class product_pricelist(osv.osv):
@ -77,7 +76,6 @@ class sale_order_line(osv.osv):
result=res['value']
pricelist_obj=self.pool.get('product.pricelist')
product_obj = self.pool.get('product.product')
product_uom_obj = self.pool.get('product.uom')
if product:
if result.get('price_unit',False):
price=result['price_unit']
@ -90,7 +88,6 @@ class sale_order_line(osv.osv):
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
old_uom = product.uos_id or product.uom_id
new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
discount = (new_list_price - price) / new_list_price * 100

View File

@ -4,7 +4,7 @@
!record {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0}:
business_days: 20
date_from: !eval time.strftime('%Y-%m-%d')
date_to: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month+1,datetime.now().day)"
date_to: !eval "(datetime.now() + timedelta(31)).strftime('%Y-%m-%d')"
name: Project Planning
state: draft
user_id: base.user_demo
@ -83,4 +83,4 @@
Check if planning in done state
-
!assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}:
- state == "done"
- state == "done"

View File

@ -11,7 +11,7 @@
<group colspan="4" col="4">
<separator colspan="4" string="Invoicing Data"/>
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection"/>
<field name="to_invoice" widget="selection" string="Invoice Task Work" attrs="{'required':[('partner_id','!=',False)]}"/>
<field name="to_invoice" widget="selection" string="Invoice Task Work"/>
<field name="amount_max" groups="base.group_extended"/>
<field name="amount_invoiced" groups="base.group_extended"/>
</group>

View File

@ -142,8 +142,6 @@ class stock_partial_picking(osv.osv_memory):
@return: A dictionary which of fields with values.
"""
pick_obj = self.pool.get('stock.picking')
move_obj = self.pool.get('stock.move')
location_obj = self.pool.get('stock.location')
picking_ids = context.get('active_ids', False)
partial = self.browse(cr, uid, ids[0], context=context)

View File

@ -196,12 +196,11 @@ 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

@ -1389,7 +1389,6 @@ function getPartnerList(){
xmlRpcClient.asyncCall(listPartnerHandler,cmdPartnerList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strvalue ],6);
}
//function to create the xmlrpc supported variables for xmlrpc request
function dictcontact(a,b){
var temp = xmlRpcClient.createType(xmlRpcClient.ARRAY,{});