Dharti Ratani(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-outlook.net-jam-explicit_message-dhr
into lp:~openerp-dev/openobject-addons/trunk-outlook.net-jam.
Requested reviews:
Jigar Amin (OpenERP) (jam-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-outlook.net-jam-explicit_message-dhr/+merge/81006
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-outlook.net-jam-explicit_message-dhr/+merge/81006
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-outlook.net-jam.
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/Model.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/Model.cs 2011-10-05 11:44:46 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/Model.cs 2011-11-02 11:30:32 +0000
@@ -53,7 +53,7 @@
if (this.openerp_connect == null)
{
- throw new Exception("Connection is not open");
+ throw new Exception("Connection is not open!\nPlease Reconnect.");
}
if (domain == null) { domain = new ArrayList().ToArray(); }
if (fields == null) { fields = new String[] { "name" }; }
@@ -97,7 +97,7 @@
long record_id;
if (this.openerp_connect == null)
{
- throw new Exception("Connection is not open");
+ throw new Exception("Connection is not open!\nPlease reconnect.");
}
ArrayList args = new ArrayList();
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/OpenERPConnect.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/OpenERPConnect.cs 2011-10-31 12:29:33 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPClient/OpenERPConnect.cs 2011-11-02 11:30:32 +0000
@@ -1,4 +1,5 @@
using System;
+using System.Windows.Forms;
using System.Collections;
using CookComputing.XmlRpc;
@@ -168,7 +169,7 @@
this.pwd = pwd;
if (this.uid <= 0)
{
- throw new Exception("Login Fail...");
+ MessageBox.Show("Authentication Error!\nBad username and password.", Form.ActiveForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
this.Close();
return this.uid;
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/ConfigManager.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/ConfigManager.cs 2011-10-31 12:29:33 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/ConfigManager.cs 2011-11-02 11:30:32 +0000
@@ -193,7 +193,7 @@
{
if (document_model.model == model.model)
{
- throw new Exception("Document Already exists in the list");
+ throw new Exception("Document already exists in the list");
}
}
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/Connect.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/Connect.cs 2011-11-01 09:23:48 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/Connect.cs 2011-11-02 11:30:32 +0000
@@ -249,7 +249,7 @@
{
if (Cache.OpenERPOutlookPlugin == null || Cache.OpenERPOutlookPlugin.isLoggedIn == false)
{
- throw new Exception("OpenERP Server is not Connected! \nPlease Connect OpenERP Server from Configuration Menu.");
+ throw new Exception("OpenERP Server is not connected!\nPlease connect OpenERP Server from Configuration Menu.");
}
return true;
@@ -257,13 +257,42 @@
public static void handleException(Exception e)
{
- MessageBox.Show(e.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string Title;
+ if (Form.ActiveForm != null)
+ {
+ Title = Form.ActiveForm.Text;
+ }
+ else
+ {
+ Title = "OpenERP Addin";
+ }
+ MessageBox.Show(e.Message, Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
public static void displayMessage(string message)
{
- MessageBox.Show(message, "Message!", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ string Title;
+ if (Form.ActiveForm != null)
+ {
+ Title = Form.ActiveForm.Text;
+ }
+ else
+ {
+ Title = "OpenERP Addin";
+ }
+ MessageBox.Show(message, Form.ActiveForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
+ public void CheckMailCount()
+ {
+ if (countMail() == 0)
+ {
+ throw new Exception("No email selected.\nPlease select one email.");
+ }
+ if (countMail() > 1)
+ {
+ throw new Exception("Multiple selction is not allowed.\nPlease select only one email.");
+ }
+ }
void btn_open_partner_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
{
try
@@ -271,14 +300,7 @@
Connect.isLoggedIn();
//Cache.OpenERPOutlookPlugin.SearchModelByName("mail.message",null);
this.validate();
- if (countMail() == 0)
- {
- throw new Exception("You have not selected any mail.\n Please Select One Mail.");
- }
- if (countMail() > 1)
- {
- throw new Exception("Multiple selction is Not Allowed.\n Please Select only One Mail.");
- }
+ this.CheckMailCount();
if (countMail() == 1)
{
@@ -304,15 +326,7 @@
Connect.isLoggedIn();
//Cache.OpenERPOutlookPlugin.SearchModelByName("mail.message",null);
this.validate();
-
- if (countMail() == 0)
- {
- throw new Exception("You have not selected any mail.\n Please Select One Mail.");
- }
- if (countMail() > 1)
- {
- throw new Exception("Multiple selction is Not Allowed.\n Please Select only One Mail.");
- }
+ this.CheckMailCount();
if (countMail() == 1)
{
foreach (outlook.MailItem mailitem in Tools.MailItems())
@@ -338,14 +352,7 @@
Connect.isLoggedIn();
//Cache.OpenERPOutlookPlugin.SearchModelByName("mail.message",null);
this.validate();
- if (countMail() == 0)
- {
- throw new Exception("You have not selected any mail.\n Please Select One Mail.");
- }
- if (countMail() > 1)
- {
- throw new Exception("Multiple selction is Not Allowed.\n Please Select only One Mail.");
- }
+ this.CheckMailCount();
if (countMail() == 1)
{
frm_push_mail frm_push_mail = new frm_push_mail();
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs 2011-10-24 12:40:15 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs 2011-11-02 11:30:32 +0000
@@ -86,7 +86,7 @@
if (this.WebURL == "")
{
- throw new Exception("WebURL is not Specified !");
+ throw new Exception("WebURL is not specified!\nFirst configure WebURL from Configuration.");
}
foreach (string key in args.Keys)
@@ -129,7 +129,7 @@
Record[] obj_list = this.SearchMessageRecordByMailItem(mail, "", 0);
if (obj_list.Count() <= 0)
{
- throw new Exception("Document Does not Exit..");
+ throw new Exception("Document does not exit!\nFirst push document from Push.");
}
Record obj = obj_list[0];
Hashtable args = new Hashtable();
@@ -149,7 +149,7 @@
Record[] obj_list = partner_model.SearchRecord(arg.ToArray());
if (obj_list == null || obj_list.Count() <= 0)
{
- throw new Exception("This particular Email-ID does not exist in Partner list.");
+ throw new Exception("This particular email-Id does not exist in Partner list!\nFirst create it through Create Contact.");
}
Record obj = obj_list[0];
Hashtable args = new Hashtable();
@@ -174,15 +174,14 @@
}
else
{
- throw new Exception("Please enter Document Name or Document Model");
+ throw new Exception("Please enter either Document Name or Document Model.");
}
Model model = new Model("ir.model");
model.Connection = this.Connection;
Object[] object_list = model.SearchRecord(condition_list.ToArray(), new string[] { "model", "name" });
if (object_list.Count() <= 0)
{
-
- throw new Exception("Model Does not Exist...");
+ throw new Exception("Model does not exist!\nNeed to install it first.");
}
Record obj = (Record)object_list[0];
Model new_model = new Model(obj.columns["model"].ToString(), obj.columns["name"].ToString());
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_contact.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_contact.cs 2011-10-24 12:40:15 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_contact.cs 2011-11-02 11:30:32 +0000
@@ -110,7 +110,7 @@
}
Cache.OpenERPOutlookPlugin.CreateContactRecord(txt_partner.Text, txt_contactname_create_contact.Text, txtemail.Text, txtstreet.Text, txtstreet2.Text, txtzip.Text, txtcity.Text, txtofice.Text, txtmbl.Text, txtfax.Text, country_id, state_id);
- Connect.displayMessage("Contact Created Sucessfully.");
+ Connect.displayMessage("Contact created sucessfully.");
this.Close();
}
catch (Exception ex)
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_openerp_configuration.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_openerp_configuration.cs 2011-11-02 07:13:35 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_openerp_configuration.cs 2011-11-02 11:30:32 +0000
@@ -190,7 +190,7 @@
Cache.OpenERPOutlookPlugin = openerp_outlook;
this.config_manager.SaveConfigurationSetting();
- Connect.displayMessage("Successfully Login to OpenERP.");
+ Connect.displayMessage("Successfully login to OpenERP.");
this.config_manager.LoadDocumentSettings();
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_partner.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_partner.cs 2011-10-24 12:40:15 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_partner.cs 2011-11-02 11:30:32 +0000
@@ -39,7 +39,7 @@
if (txt_create_partner.Text == "")
{
- throw new Exception ("You Must Enter a Partner Name.");
+ throw new Exception ("You must enter a Partner Name.");
}
else
@@ -49,7 +49,7 @@
Record[] partners = Cache.OpenERPOutlookPlugin.SearchPartnerByName(txt_create_partner.Text);
if (partners != null && partners.Length > 0)
{
- throw new Exception("Partner Already Exist. ");
+ throw new Exception("Partner already exist.");
}
else
{
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_push_mail.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_push_mail.cs 2011-10-24 12:40:15 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_push_mail.cs 2011-11-02 11:30:32 +0000
@@ -69,12 +69,12 @@
{
if (cmboboxcreate.SelectedItem == null)
{
- throw new Exception("Please select the type of the Document.");
+ throw new Exception("Please select a document from the document list.");
}
else
{
Model model = (Model)cmboboxcreate.SelectedItem;
- if (this.push_mail(model.model, 0)) Connect.displayMessage("Document Created Successfully.");
+ if (this.push_mail(model.model, 0)) Connect.displayMessage(model.name.ToUpper() + " Document Created Successfully.");
this.Close();
}
@@ -104,7 +104,7 @@
{
if (this.push_mail(lv.SubItems[1].Name, Convert.ToInt32(lv.Name)))
{
- msg_str += "Mail Successfully Pushed For " + lv.SubItems[1].Text + " - " + lv.SubItems[0].Text + "\n";
+ msg_str += "Mail successfully pushed For " + lv.SubItems[1].Text + " - " + lv.SubItems[0].Text + "\n";
}
@@ -227,7 +227,10 @@
{
this.add_item_recordlist(record);
}
-
+ if (lstview_object.Items.Count <= 0)
+ {
+ Connect.displayMessage("No matching Document(s) found.");
+ }
}
lstview_object.Sort();
=== modified file 'outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_select_partner.cs'
--- outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_select_partner.cs 2011-10-24 12:40:15 +0000
+++ outlook/plugin/openerp-outlook-plugin_v2.0/OpenERPOutlookPlugin/frm_select_partner.cs 2011-11-02 11:30:32 +0000
@@ -50,7 +50,7 @@
{
if (lstbox_select_partner.SelectedItem == null)
{
- throw new Exception("Please select the partner from the list.");
+ throw new Exception("Please select a partner from the list.");
}
else
{
@@ -88,6 +88,10 @@
{
lstbox_select_partner.Items.Add(oo.name);
}
+ if (lstbox_select_partner.Items.Count == 0)
+ {
+ Connect.displayMessage("No matching Partner(s) found.");
+ }
}
catch (Exception ex)
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp