diff --git a/bin/addons/base/__openerp__.py b/bin/addons/base/__openerp__.py
index 72517183e77..531c66909ad 100644
--- a/bin/addons/base/__openerp__.py
+++ b/bin/addons/base/__openerp__.py
@@ -58,6 +58,7 @@
'res/country_view.xml',
'res/res_currency_view.xml',
'res/partner/crm_view.xml',
+ 'res/partner/wizard/partner_sms_send_view.xml',
'res/partner/partner_data.xml',
'res/ir_property_view.xml',
'security/base_security.xml',
diff --git a/bin/addons/base/res/bank_view.xml b/bin/addons/base/res/bank_view.xml
index 5b6847c5c01..a60be66a254 100644
--- a/bin/addons/base/res/bank_view.xml
+++ b/bin/addons/base/res/bank_view.xml
@@ -12,23 +12,25 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
res.bank.tree
res.bank
@@ -41,15 +43,15 @@
-
+
Bank List
res.bank
form
tree,form
-
+
-
+
diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py
index e5bb6a4f1cb..84994ffe9ab 100644
--- a/bin/addons/base/res/partner/partner.py
+++ b/bin/addons/base/res/partner/partner.py
@@ -124,7 +124,7 @@ class res_partner(osv.osv):
'user_id': fields.many2one('res.users', 'Salesman', help='The internal user that is in charge of communicating with this partner if any.'),
'vat': fields.char('VAT',size=32 ,help="Value Added Tax number. Check the box if the partner is subjected to the VAT. Used by the VAT legal statement."),
'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'),
- 'website': fields.char('Website',size=64),
+ 'website': fields.char('Website',size=64, help="Website of Partner"),
'comment': fields.text('Notes'),
'address': fields.one2many('res.partner.address', 'partner_id', 'Contacts'),
'category_id': fields.many2many('res.partner.category', 'res_partner_category_rel', 'partner_id', 'category_id', 'Categories'),
@@ -136,6 +136,7 @@ class res_partner(osv.osv):
'supplier': fields.boolean('Supplier', help="Check this box if the partner is a supplier. If it's not checked, purchase people will not see it when encoding a purchase order."),
'city': fields.related('address', 'city', type='char', string='City'),
'phone': fields.related('address', 'phone', type='char', string='Phone'),
+ 'mobile': fields.related('address', 'mobile', type='char', string='Mobile'),
'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
'employee': fields.boolean('Employee', help="Check this box if the partner is an Employee."),
'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
@@ -290,6 +291,8 @@ class res_partner_address(osv.osv):
'fax': fields.char('Fax', size=64),
'mobile': fields.char('Mobile', size=64),
'birthdate': fields.char('Birthdate', size=64),
+ 'is_customer_add': fields.related('partner_id', 'customer', type='boolean', string='Customer'),
+ 'is_supplier_add': fields.related('partner_id', 'supplier', type='boolean', string='Supplier'),
'active': fields.boolean('Active', help="Uncheck the active field to hide the contact."),
# 'company_id': fields.related('partner_id','company_id',type='many2one',relation='res.company',string='Company', store=True),
'company_id': fields.many2one('res.company', 'Company',select=1),
diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml
index 715fe8efe0d..415c15e0455 100644
--- a/bin/addons/base/res/partner/partner_view.xml
+++ b/bin/addons/base/res/partner/partner_view.xml
@@ -21,10 +21,21 @@
search
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -92,6 +103,7 @@
ir.actions.act_window
res.partner.address
form
+ {"search_default_customer":1}
@@ -281,8 +293,10 @@
-
-
+
+
+
+
@@ -294,12 +308,13 @@
-
-
-
+
+
+
+
@@ -324,7 +339,7 @@
-
+
@@ -487,40 +502,6 @@
-
-
- res.partner.tree
- res.partner
- tree
- child_ids
-
-
-
-
-
-
-
-
-
- Company Architecture
- ir.actions.act_window
- res.partner
- [('id','in',active_ids)]
- tree
-
-
-
-
-
- Company Architecture
-
-
-
-
+
diff --git a/bin/addons/base/res/partner/wizard/__init__.py b/bin/addons/base/res/partner/wizard/__init__.py
index b1f0addf5d4..f1a85740bf4 100644
--- a/bin/addons/base/res/partner/wizard/__init__.py
+++ b/bin/addons/base/res/partner/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -15,14 +15,14 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_sms
import wizard_spam
import wizard_clear_ids
import wizard_ean_check
+import partner_sms_send
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/bin/addons/base/res/partner/wizard/partner_sms_send.py b/bin/addons/base/res/partner/wizard/partner_sms_send.py
new file mode 100644
index 00000000000..e04a3a059cf
--- /dev/null
+++ b/bin/addons/base/res/partner/wizard/partner_sms_send.py
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import wizard
+import netsvc
+import tools
+from osv import fields, osv
+
+class partner_sms_send(osv.osv_memory):
+ """ Create Menu """
+
+ _name = "partner.sms.send"
+ _description = "Send SMS"
+
+ _columns = {
+ 'mobile_to': fields.char('To', size=256, required=True),
+ 'app_id': fields.char('API ID', size=256,required=True),
+ 'user': fields.char('Login', size=256,required=True),
+ 'password': fields.char('Password', size=256,required=True),
+ 'text': fields.text('SMS Message',required=True),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ This function gets default values
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param fields: List of fields for default value
+ @param context: A standard dictionary for contextual values
+
+ @return : default values of fields.
+ """
+ partner_pool = self.pool.get('res.partner')
+ active_ids = context and context.get('active_ids', [])
+ res = {}
+ for partner in partner_pool.browse(cr, uid, active_ids, context=context):
+ if 'mobile_to' in fields:
+ res.update({'mobile_to': partner.mobile})
+ return res
+
+ def sms_send(self, cr, uid, ids, context):
+ """
+ to send sms
+
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+ @return: number indicating the acknowledgement
+ """
+ nbr = 0
+
+ for data in self.browse(cr, uid, ids, context) :
+ tools.sms_send(
+ data.user,
+ data.password,
+ data.app_id,
+ tools.ustr(data.text),
+ data.mobile_to)
+ nbr += 1
+ return {}
+partner_sms_send()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml b/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml
new file mode 100644
index 00000000000..fafdc33d72c
--- /dev/null
+++ b/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ Send SMS
+ partner.sms.send
+ form
+
+
+
+
+
+
+
+
diff --git a/bin/addons/base/res/partner/wizard/wizard_sms.py b/bin/addons/base/res/partner/wizard/wizard_sms.py
deleted file mode 100644
index 08359386a53..00000000000
--- a/bin/addons/base/res/partner/wizard/wizard_sms.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import tools
-
-sms_send_form = '''
-''' % ('SMS - Gateway: clickatell','Bulk SMS send')
-
-sms_send_fields = {
- 'app_id': {'string':'API ID', 'type':'char', 'required':True},
- 'user': {'string':'Login', 'type':'char', 'required':True},
- 'password': {'string':'Password', 'type':'char', 'required':True},
- 'text': {'string':'SMS Message', 'type':'text', 'required':True}
-}
-
-def _sms_send(self, cr, uid, data, context):
- service = netsvc.LocalService("object_proxy")
-
- res_ids = service.execute(cr.dbname, uid, 'res.partner.address', 'search', [('partner_id','in',data['ids']),('type','=','default')])
- res = service.execute(cr.dbname, uid, 'res.partner.address', 'read', res_ids, ['mobile'])
-
- nbr = 0
- for r in res:
- to = r['mobile']
- if to:
- tools.sms_send(data['form']['user'], data['form']['password'], data['form']['app_id'], unicode(data['form']['text'], 'utf-8').encode('latin1'), to)
- nbr += 1
- return {'sms_sent': nbr}
-
-class part_sms(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':sms_send_form, 'fields': sms_send_fields, 'state':[('end','Cancel'), ('send','Send SMS')]}
- },
- 'send': {
- 'actions': [_sms_send],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-part_sms('res.partner.sms_send')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-