[MERGE] merged latest bugfixes from 6.0 into trunk (up to rev 4375)

bzr revid: odo@openerp.com-20110201142528-5w9ns20flxmetf3i
This commit is contained in:
Olivier Dony 2011-02-01 15:25:28 +01:00
commit 1da43ed8ba
15 changed files with 213 additions and 192 deletions

View File

@ -94,7 +94,7 @@ class account_invoice(osv.osv):
if invoice.move_id:
for m in invoice.move_id.line_id:
if m.account_id.type in ('receivable','payable'):
result[invoice.id] = m.amount_residual_currency
result[invoice.id] += m.amount_residual_currency
return result
# Give Journal Items related to the payment reconciled to this invoice
@ -353,6 +353,8 @@ class account_invoice(osv.osv):
raise orm.except_orm(_('Unknown Error'), str(e))
def confirm_paid(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'paid'}, context=context)
for inv_id, name in self.name_get(cr, uid, ids, context=context):
message = _("Invoice '%s' is paid.") % name
@ -360,6 +362,8 @@ class account_invoice(osv.osv):
return True
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
invoices = self.read(cr, uid, ids, ['state'], context=context)
unlink_ids = []
for t in invoices:
@ -598,6 +602,8 @@ class account_invoice(osv.osv):
return res
def copy(self, cr, uid, id, default={}, context=None):
if context is None:
context = {}
default.update({
'state':'draft',
'number':False,

View File

@ -306,7 +306,7 @@ class payment_line(osv.osv):
if id.move_line_id:
res[id.id] = id.move_line_id.date_maturity
else:
res[id.id] = ""
res[id.id] = False
return res
def _get_ml_created_date(self, cr, uid, ids, *a):
@ -315,7 +315,7 @@ class payment_line(osv.osv):
if id.move_line_id:
res[id.id] = id.move_line_id.date_created
else:
res[id.id] = ""
res[id.id] = False
return res
_columns = {

View File

@ -108,7 +108,7 @@
<field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
<button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
</group>
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" default_get="{'order_id': active_id}" >
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" default_get="{'order_id': active_id or False}" >
<form string="Payment Line">
<notebook>
<page string="Payment">

View File

@ -179,6 +179,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
if context is None:
context = {}
def make_call_old(cr, uid, ids, vals, context=context):
if context is None:
context = {}
if isinstance(ids, (str, int, long)):
ids = [ids]
if not context.get('action'):

View File

@ -124,11 +124,13 @@
<form string="Stage">
<separator string="Stage Definition" colspan="4"/>
<field name="name" select="1"/>
<field name="type" invisible="1" />
<field name="type" groups="base.group_extended" />
<field name="sequence"/>
<field name="probability"/>
<group colspan="4" col="2" >
<field name="on_change"/>
</group>
<separator string="Requirements" colspan="4"/>
<field name="requirements" nolabel="1" colspan="4"/>
<field name="section_ids" invisible="1" />

View File

@ -70,8 +70,10 @@ class crm_lead2opportunity(osv.osv_memory):
cr, uid, opportunity_view_tree, context=context).res_id
lead = leads.browse(cr, uid, record_id, context=context)
if(lead.section_id):
stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=','opportunity'),('sequence','>=',1), ('section_ids','=', lead.section_id.id)])
else:
stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=','opportunity'),('sequence','>=',1)])
for this in self.browse(cr, uid, ids, context=context):
vals ={
'planned_revenue': this.planned_revenue,

View File

@ -75,7 +75,7 @@ class hr_attendance(osv.osv):
LIMIT 2 '''
cr.execute(sql,(id,id))
atts = cr.fetchall()
if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])):
if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (len(atts)==2 and atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])):
return False
return True

View File

@ -567,7 +567,7 @@ class product_product(osv.osv):
ptrn=re.compile('(\[(.*?)\])')
res = ptrn.search(name)
if res:
ids = self.search(cr, user, [('default_code','ilike',res.group(2))]+ args, limit=limit, context=context)
ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)
else:
ids = self.search(cr, user, args, limit=limit, context=context)
result = self.name_get(cr, user, ids, context=context)

View File

@ -8,7 +8,7 @@
<field name="name">Project_Planning</field>
<field name="business_days">20</field>
<field name="date_from" eval="time.strftime('%Y-%m-01 10:00:00')"/>
<field name="date_to" eval="time.strftime('%Y-%m-30 15:23:00')"/>
<field name="date_to" eval="time.strftime('%Y-%m-28 15:00:00')"/>
<field name="state">open</field>
<field name="user_id" ref="project.res_users_project_manager"/>
</record>

View File

@ -115,12 +115,20 @@ function config_ok_web()
return false;
}
if (document.getElementById('txtcwebport').value == '')
if (document.getElementById('txtcwebport').value == '' && !document.getElementById('lblssl').checked)
{
alert("You Must Enter Port!")
return false;
}
setWebServerURL("http://"+document.getElementById('txtcweburl').value +":" + document.getElementById('txtcwebport').value);
var protocol = "http://";
var port = document.getElementById('txtcwebport').value
if(document.getElementById('lblssl').checked) {
protocol = "https://";
if(port == '') {
port = 443
}
}
setWebServerURL(protocol + document.getElementById('txtcweburl').value +":" + port);
window.close("chrome://openerp_plugin/content/config_change_web.xul", "", "chrome");
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}

View File

@ -21,6 +21,10 @@
<label id="lblport" control="txtcport" value="&lblport.label;" width="50"/>
<textbox id="txtcwebport" width="140" />
</hbox>
<hbox>
<checkbox id="lblssl" label="SSL (https)" checked="false"/>
</hbox>
</groupbox>
<hbox align="right">

View File

@ -612,7 +612,6 @@ function createMenuItem_db(aLabel) {
//xmlrpc request handler for getting the list of database
var listDbHandler = {
onResult: function(client, context, result) {
setconnect_server("true")
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
// Set the number of results
@ -625,7 +624,7 @@ var listDbHandler = {
var database = ""
if (count > 0)
{
setDBList("true")
setDBList("true");
var label = document.getElementById("database_option");
var vbox = document.createElement("vbox");
var hbox = document.createElement("hbox");
@ -658,7 +657,7 @@ var listDbHandler = {
}
else
{
setDBList("false")
setDBList("false");
}
// Loop through the results, adding items to the list
if (count)
@ -682,22 +681,18 @@ var listDbHandler = {
onFault: function (client, ctxt, fault) {
setDBList("false");
},
onError: function (client, ctxt, status, errorMsg) {
if(status == 0) {
setconnect_server("true");
setDBList("false");
}
}
};
//function to get the database list
function getDbList(argControl)
{
setDBList("false")
setconnect_server("false")
setDBList("false");
setconnect_server("true");
// Enable correct security
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
// Get the instance of the XML-RPC client
@ -1844,7 +1839,6 @@ function testConnection(){
function testConnection_web(){
var branchobj = getPref();
weburl = getWebServerURL();
// window.open(weburl, "", "chrome","resizable=yes,scrollbars=yes,status=yes");
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(weburl);
@ -1876,6 +1870,7 @@ var listcreateLoginHandler = {
//function to check the login information
function createConnection(){
setconnect_server("true");
var branchobj = getPref();
setServerService('xmlrpc/common');
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');

View File

@ -1,5 +1,7 @@
<!ENTITY lblurl.label "Server: ">
<!ENTITY lblport.label "Port: ">
<!ENTITY lblssl.label "Use SLL ? ">
<!ENTITY lblheading.label "Openerp Connection">
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">