- [[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]
+ Due[[ data['form']['direction_selection'] == 'future' and ' ' or removeParentNode('para') ]]
+ Not due[[ data['form']['direction_selection'] != 'future' and ' ' or removeParentNode('para') ]]
[[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]]
- [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]
+
+ Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]
+ Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]
+
Fiscal Year
@@ -233,7 +235,11 @@
[[ get_fiscalyear(data) or '' ]]
-
[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]
+
+ All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]
+ With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]
+ With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]
+
[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] [[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
[[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]]
- [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]
+
Company[[ data['model']=='account.journal.period' and ' ' or removeParentNode('para') ]]
+ Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]
Fiscal Year
Journals
Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]
- [[ data['model']=='account.account' and 'Company' or removeParentNode('para') ]]
- [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]
-
+ Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]
+ Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]
Fiscal Year
@@ -395,7 +394,9 @@
[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]
- [[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]
+ All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]
+ With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]
+ With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]
[[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]]
- [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]
+
Company[[ data['model']=='account.journal.period'and ' ' or removeParentNode('para') ]]
+ Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]
Fiscal Year
Journal
Period
@@ -199,8 +199,10 @@
[[ get_fiscalyear(data) or '' ]]
[[ o.journal_id.name ]]
[[ o.period_id.name ]]
-
[[ get_sortby(data) ]]
-
[[ get_target_move(data) ]]
+
+ Date[[ data['form'].get('sort_selection', 'date') == 'date' and ' ' or removeParentNode('para') ]]
+ Reference Number[[ data['form'].get('sort_selection', 'date') == 'ref' and ' ' or removeParentNode('para') ]]
+
+
diff --git a/addons/base_status/i18n/sv.po b/addons/base_status/i18n/sv.po
new file mode 100644
index 00000000000..eb1b42e6a53
--- /dev/null
+++ b/addons/base_status/i18n/sv.po
@@ -0,0 +1,79 @@
+# Swedish translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-07-08 15:10+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Swedish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-07-09 05:16+0000\n"
+"X-Generator: Launchpad (build 16696)\n"
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:107
+#, python-format
+msgid "Error !"
+msgstr "Fel !"
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:166
+#, python-format
+msgid "%s has been opened."
+msgstr "%s har öppnats."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:199
+#, python-format
+msgid "%s has been renewed."
+msgstr "%s har förnyats."
+
+#. module: base_status
+#: code:addons/base_status/base_stage.py:210
+#, python-format
+msgid "Error!"
+msgstr "Fel!"
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:107
+#, python-format
+msgid ""
+"You can not escalate, you are already at the top level regarding your sales-"
+"team category."
+msgstr ""
+"Du kan inte eskalera längre, du har nått toppen för denna säljlags-kategori."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:193
+#, python-format
+msgid "%s is now pending."
+msgstr "%s är nu pågående."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:187
+#, python-format
+msgid "%s has been canceled."
+msgstr "%s har avbrutits."
+
+#. module: base_status
+#: code:addons/base_status/base_stage.py:210
+#, python-format
+msgid ""
+"You are already at the top level of your sales-team category.\n"
+"Therefore you cannot escalate furthermore."
+msgstr ""
+"Du har nått översta nivån för din säljlagskategori.\n"
+"Det går därför inte att eskalera ytterligare."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:181
+#, python-format
+msgid "%s has been closed."
+msgstr "%s har stängts."
diff --git a/addons/claim_from_delivery/i18n/vi.po b/addons/claim_from_delivery/i18n/vi.po
new file mode 100644
index 00000000000..f308bafb1ea
--- /dev/null
+++ b/addons/claim_from_delivery/i18n/vi.po
@@ -0,0 +1,33 @@
+# Vietnamese translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-06-30 16:10+0000\n"
+"Last-Translator: Hung Tran \n"
+"Language-Team: Vietnamese \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-07-01 05:14+0000\n"
+"X-Generator: Launchpad (build 16692)\n"
+
+#. module: claim_from_delivery
+#: view:stock.picking.out:0
+msgid "Claims"
+msgstr "Các khiếu nại"
+
+#. module: claim_from_delivery
+#: model:res.request.link,name:claim_from_delivery.request_link_claim_from_delivery
+msgid "Delivery Order"
+msgstr ""
+
+#. module: claim_from_delivery
+#: model:ir.actions.act_window,name:claim_from_delivery.action_claim_from_delivery
+msgid "Claim From Delivery"
+msgstr ""
diff --git a/addons/contacts/i18n/ko.po b/addons/contacts/i18n/ko.po
new file mode 100644
index 00000000000..19e46f9e0b0
--- /dev/null
+++ b/addons/contacts/i18n/ko.po
@@ -0,0 +1,37 @@
+# Korean translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-06-28 09:32+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Korean \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-06-30 05:56+0000\n"
+"X-Generator: Launchpad (build 16692)\n"
+
+#. module: contacts
+#: model:ir.actions.act_window,help:contacts.action_contacts
+msgid ""
+"
\n"
+" Click to add a contact in your address book.\n"
+"
\n"
+" OpenERP helps you easily track all activities related to\n"
+" a customer; discussions, history of business opportunities,\n"
+" documents, etc.\n"
+"
\n"
+" "
+msgstr ""
+
+#. module: contacts
+#: model:ir.actions.act_window,name:contacts.action_contacts
+#: model:ir.ui.menu,name:contacts.menu_contacts
+msgid "Contacts"
+msgstr "연락처"
diff --git a/addons/contacts/i18n/vi.po b/addons/contacts/i18n/vi.po
new file mode 100644
index 00000000000..d404d947fe2
--- /dev/null
+++ b/addons/contacts/i18n/vi.po
@@ -0,0 +1,45 @@
+# Vietnamese translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-06-27 16:47+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Vietnamese \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-06-28 05:42+0000\n"
+"X-Generator: Launchpad (build 16681)\n"
+
+#. module: contacts
+#: model:ir.actions.act_window,help:contacts.action_contacts
+msgid ""
+"
\n"
+" Click to add a contact in your address book.\n"
+"
\n"
+" OpenERP helps you easily track all activities related to\n"
+" a customer; discussions, history of business opportunities,\n"
+" documents, etc.\n"
+"
\n"
+" "
+msgstr ""
+"
\n"
+" Nhấn để thêm liên lạc vào sổ địa chỉ.\n"
+"
\n"
+" OpenERP giúp bạn theo dõi các hoạt động liên quan tới\n"
+" một khách hàng; thảo luận, lịch sử cơ hội kinh doanh,\n"
+" tài liệu v.v....\n"
+"
\n"
+" "
+
+#. module: contacts
+#: model:ir.actions.act_window,name:contacts.action_contacts
+#: model:ir.ui.menu,name:contacts.menu_contacts
+msgid "Contacts"
+msgstr "Liên hệ"
diff --git a/addons/contacts/static/src/img/icon.png b/addons/contacts/static/description/icon.png
similarity index 100%
rename from addons/contacts/static/src/img/icon.png
rename to addons/contacts/static/description/icon.png
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 44ada2ffcc0..af02e3be1bf 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -19,7 +19,6 @@
#
##############################################################################
-from openerp.addons.base_status.base_stage import base_stage
import crm
from datetime import datetime
from operator import itemgetter
@@ -68,7 +67,7 @@ CRM_LEAD_PENDING_STATES = (
crm.AVAILABLE_STATES[4][0], # Pending
)
-class crm_lead(base_stage, format_address, osv.osv):
+class crm_lead(format_address, osv.osv):
""" CRM Lead Case """
_name = "crm.lead"
_description = "Lead/Opportunity"
@@ -77,12 +76,12 @@ class crm_lead(base_stage, format_address, osv.osv):
_track = {
'state': {
- 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['new', 'draft'],
- 'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
- 'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'cancel',
+ 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj.state in ['new', 'draft'],
+ 'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.state == 'done',
+ 'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.state == 'cancel',
},
'stage_id': {
- 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'draft', 'cancel', 'done'],
+ 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj.state not in ['new', 'draft', 'cancel', 'done'],
},
}
@@ -93,20 +92,6 @@ class crm_lead(base_stage, format_address, osv.osv):
context['empty_list_help_document_name'] = _("leads")
return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context)
- def create(self, cr, uid, vals, context=None):
- if context is None:
- context = {}
- if not vals.get('stage_id'):
- ctx = context.copy()
- if vals.get('section_id'):
- ctx['default_section_id'] = vals['section_id']
- if vals.get('type'):
- ctx['default_type'] = vals['type']
- vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
- # context: no_log, because subtype already handle this
- create_context = dict(context, mail_create_nolog=True)
- return super(crm_lead, self).create(cr, uid, vals, context=create_context)
-
def _get_default_section_id(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
return self._resolve_section_id_from_context(cr, uid, context=context) or False
@@ -126,8 +111,7 @@ class crm_lead(base_stage, format_address, osv.osv):
if type(context.get('default_section_id')) in (int, long):
return context.get('default_section_id')
if isinstance(context.get('default_section_id'), basestring):
- section_name = context['default_section_id']
- section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=section_name, context=context)
+ section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=context['default_section_id'], context=context)
if len(section_ids) == 1:
return int(section_ids[0][0])
return None
@@ -326,8 +310,7 @@ class crm_lead(base_stage, format_address, osv.osv):
_defaults = {
'active': 1,
'type': 'lead',
- 'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),
- 'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
+ 'user_id': lambda s, cr, uid, c: uid,
'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),
'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
@@ -341,30 +324,29 @@ class crm_lead(base_stage, format_address, osv.osv):
def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
if not stage_id:
- return {'value':{}}
+ return {'value': {}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context)
if not stage.on_change:
- return {'value':{}}
- return {'value':{'probability': stage.probability}}
+ return {'value': {}}
+ return {'value': {'probability': stage.probability}}
- def on_change_partner(self, cr, uid, ids, partner_id, context=None):
- result = {}
+ def on_change_partner_id(self, cr, uid, ids, partner_id, context=None):
values = {}
if partner_id:
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
values = {
- 'partner_name' : partner.name,
- 'street' : partner.street,
- 'street2' : partner.street2,
- 'city' : partner.city,
- 'state_id' : partner.state_id and partner.state_id.id or False,
- 'country_id' : partner.country_id and partner.country_id.id or False,
- 'email_from' : partner.email,
- 'phone' : partner.phone,
- 'mobile' : partner.mobile,
- 'fax' : partner.fax,
+ 'partner_name': partner.name,
+ 'street': partner.street,
+ 'street2': partner.street2,
+ 'city': partner.city,
+ 'state_id': partner.state_id and partner.state_id.id or False,
+ 'country_id': partner.country_id and partner.country_id.id or False,
+ 'email_from': partner.email,
+ 'phone': partner.phone,
+ 'mobile': partner.mobile,
+ 'fax': partner.fax,
}
- return {'value' : values}
+ return {'value': values}
def on_change_user(self, cr, uid, ids, user_id, context=None):
""" When changing the user, also set a section_id or restrict section id
@@ -405,7 +387,7 @@ class crm_lead(base_stage, format_address, osv.osv):
# collect all section_ids
section_ids = []
types = ['both']
- if not cases :
+ if not cases:
type = context.get('default_type')
types += [type]
if section_id:
@@ -433,24 +415,18 @@ class crm_lead(base_stage, format_address, osv.osv):
return stage_ids[0]
return False
- def case_cancel(self, cr, uid, ids, context=None):
- """ Overrides case_cancel from base_stage to set probability """
- res = super(crm_lead, self).case_cancel(cr, uid, ids, context=context)
- self.write(cr, uid, ids, {'probability' : 0.0}, context=context)
- return res
-
- def case_reset(self, cr, uid, ids, context=None):
- """ Overrides case_reset from base_stage to set probability """
- res = super(crm_lead, self).case_reset(cr, uid, ids, context=context)
- self.write(cr, uid, ids, {'probability': 0.0}, context=context)
- return res
+ def stage_set(self, cr, uid, ids, stage_id, context=None):
+ """ Set the new stage. Now just writes the stage.
+ TDE TODO: remove me when removing state
+ """
+ return self.write(cr, uid, ids, {'stage_id': stage_id}, context=context)
def case_mark_lost(self, cr, uid, ids, context=None):
""" Mark the case as lost: state=cancel and probability=0 """
for lead in self.browse(cr, uid, ids):
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 0.0),('on_change','=',True)], context=context)
if stage_id:
- self.case_set(cr, uid, [lead.id], values_to_update={'probability': 0.0}, new_stage_id=stage_id, context=context)
+ self.stage_set(cr, uid, [lead.id], stage_id, context=context)
return True
def case_mark_won(self, cr, uid, ids, context=None):
@@ -458,7 +434,21 @@ class crm_lead(base_stage, format_address, osv.osv):
for lead in self.browse(cr, uid, ids):
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0),('on_change','=',True)], context=context)
if stage_id:
- self.case_set(cr, uid, [lead.id], values_to_update={'probability': 100.0}, new_stage_id=stage_id, context=context)
+ self.stage_set(cr, uid, [lead.id], stage_id, context=context)
+ return True
+
+ def case_escalate(self, cr, uid, ids, context=None):
+ """ Escalates case to parent level """
+ for case in self.browse(cr, uid, ids, context=context):
+ data = {'active': True}
+ if case.section_id.parent_id:
+ data['section_id'] = case.section_id.parent_id.id
+ if case.section_id.parent_id.change_responsible:
+ if case.section_id.parent_id.user_id:
+ data['user_id'] = case.section_id.parent_id.user_id.id
+ else:
+ raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
+ self.write(cr, uid, [case.id], data, context=context)
return True
def set_priority(self, cr, uid, ids, priority):
@@ -932,12 +922,22 @@ class crm_lead(base_stage, format_address, osv.osv):
}
return res
+ def create(self, cr, uid, vals, context=None):
+ if context is None:
+ context = {}
+ if vals.get('type') and not context.get('default_type'):
+ context['default_type'] = vals.get('type')
+ if vals.get('section_id') and not context.get('default_section_id'):
+ context['default_section_id'] = vals.get('section_id')
+
+ # context: no_log, because subtype already handle this
+ create_context = dict(context, mail_create_nolog=True)
+ return super(crm_lead, self).create(cr, uid, vals, context=create_context)
+
def write(self, cr, uid, ids, vals, context=None):
if vals.get('stage_id') and not vals.get('probability'):
- # change probability of lead(s) if required by stage
- stage = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
- if stage.on_change:
- vals['probability'] = stage.probability
+ onchange_stage_values = self.onchange_stage_id(cr, uid, ids, vals.get('stage_id'), context=context)['value']
+ vals.update(onchange_stage_values)
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
def new_mail_send(self, cr, uid, ids, context=None):
@@ -1024,7 +1024,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'user_id': False,
}
if msg.get('author_id'):
- defaults.update(self.on_change_partner(cr, uid, None, msg.get('author_id'), context=context)['value'])
+ defaults.update(self.on_change_partner_id(cr, uid, None, msg.get('author_id'), context=context)['value'])
if msg.get('priority') in dict(crm.AVAILABLE_PRIORITIES):
defaults['priority'] = msg.get('priority')
defaults.update(custom_values)
diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml
index e7e6beae33e..3917fadbd32 100644
--- a/addons/crm/crm_lead_demo.xml
+++ b/addons/crm/crm_lead_demo.xml
@@ -263,13 +263,6 @@ Andrew
-
-
-
+
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index df6a4a07a8e..cb4302166a1 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -95,10 +95,6 @@
-
-
@@ -118,7 +114,7 @@
@@ -617,7 +613,7 @@
code
if context.get('active_model') == 'crm.lead' and context.get('active_ids'):
- self.case_cancel(cr, uid, context['active_ids'], context=context)
+ self.case_mark_lost(cr, uid, context['active_ids'], context=context)
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index 2344604a294..f6f94547173 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -58,7 +58,7 @@
tree,calendar[]
- {}
+ {'default_state': 'done'}
diff --git a/addons/crm/doc/changelog.rst b/addons/crm/doc/changelog.rst
new file mode 100644
index 00000000000..cb1602a8d39
--- /dev/null
+++ b/addons/crm/doc/changelog.rst
@@ -0,0 +1,11 @@
+.. _changelog:
+
+Changelog
+=========
+
+`trunk (saas-2)`
+----------------
+
+- ``crm``, ``crm_claim``: removed inheritance from ``base_stage`` class. Missing
+ methods have been added into ``crm`` and ``crm_claim``. Also removed inheritance
+ in ``crm_helpdesk`` because it uses states, not stages.
\ No newline at end of file
diff --git a/addons/crm/doc/index.rst b/addons/crm/doc/index.rst
new file mode 100644
index 00000000000..d70e045befe
--- /dev/null
+++ b/addons/crm/doc/index.rst
@@ -0,0 +1,13 @@
+CRM module documentation
+========================
+
+CRM documentation topics
+'''''''''''''''''''''''''
+
+Changelog
+'''''''''
+
+.. toctree::
+ :maxdepth: 1
+
+ changelog.rst
diff --git a/addons/crm/i18n/hu.po b/addons/crm/i18n/hu.po
index 6673d2da235..0289fac77cf 100644
--- a/addons/crm/i18n/hu.po
+++ b/addons/crm/i18n/hu.po
@@ -7,14 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
-"PO-Revision-Date: 2013-06-21 07:11+0000\n"
+"PO-Revision-Date: 2013-07-09 07:36+0000\n"
"Last-Translator: krnkris \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-06-22 05:36+0000\n"
-"X-Generator: Launchpad (build 16677)\n"
+"X-Launchpad-Export-Date: 2013-07-10 05:25+0000\n"
+"X-Generator: Launchpad (build 16696)\n"
+
+#. module: crm
+#: model:crm.case.stage,name:crm.stage_lead3
+msgid "Qualification"
+msgstr "Besorolás"
#. module: crm
#: view:crm.lead.report:0
@@ -2686,11 +2691,6 @@ msgstr "Valószínűség automatikus változtatása"
msgid "My Phone Calls"
msgstr "Telefonhívásaim"
-#. module: crm
-#: model:crm.case.stage,name:crm.stage_lead3
-msgid "Qualification"
-msgstr "Besorolás"
-
#. module: crm
#: field:crm.lead2opportunity.partner,name:0
#: field:crm.lead2opportunity.partner.mass,name:0
@@ -3961,9 +3961,19 @@ msgstr ""
#~ msgid "Can not add note!"
#~ msgstr "Nem lehet hozzáadni megjegyzést!"
+#, python-format
+#~ msgid ""
+#~ "Opportunity must have Partner assigned before merging with other Opportunity."
+#~ msgstr ""
+#~ "Csak a Partnerhez rendelt Lehetőséget lehet más Lehetőséggel összefűzni."
+
#~ msgid "_Merge"
#~ msgstr "Össze_fésülés"
+#, python-format
+#~ msgid "The opportunity '%s' has been marked as lost."
+#~ msgstr "A '%s' lehetőséget elvesztettnek jelöltem."
+
#, python-format
#~ msgid "Lead '%s' has been converted to an opportunity."
#~ msgstr "A '%s'"
@@ -3991,3 +4001,17 @@ msgstr ""
#~ msgid "Convert To Opportunity"
#~ msgstr "Átalakítás lehetőséggé"
+
+#~ msgid "Edit all Occurrences of recurrent Meeting."
+#~ msgstr "Az ismétlődő találkozók összes eseményének szerkesztése."
+
+#~ msgid ""
+#~ "Leads Analysis allows you to check different CRM related information. Check "
+#~ "for treatment delays, number of responses given and emails sent. You can "
+#~ "sort out your leads analysis by different groups to get accurate grained "
+#~ "analysis."
+#~ msgstr ""
+#~ "Az érdeklődések elemzése több CRM-hez kapcsolódó információt nyújt. "
+#~ "Ellenőrizhetjük az eljárás elnapolását, a kiküldött válaszok és e-mailek "
+#~ "számát. A részletes eredmény érdekében az érdeklődéseket különféle "
+#~ "csoportosítások szerint is elemezhetjük."
diff --git a/addons/crm/res_partner.py b/addons/crm/res_partner.py
index f25b1303c02..fca9222082d 100644
--- a/addons/crm/res_partner.py
+++ b/addons/crm/res_partner.py
@@ -56,7 +56,7 @@ class res_partner(osv.osv):
default.update({'opportunity_ids': [], 'meeting_ids' : [], 'phonecall_ids' : []})
- super(res_partner, self).copy(cr, uid, record_id, default, context)
+ return super(res_partner, self).copy(cr, uid, record_id, default, context)
def redirect_partner_form(self, cr, uid, partner_id, context=None):
search_view = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'view_res_partner_filter')
diff --git a/addons/crm/html/Stephan-Keller.jpg b/addons/crm/static/description/Stephan-Keller.jpg
similarity index 100%
rename from addons/crm/html/Stephan-Keller.jpg
rename to addons/crm/static/description/Stephan-Keller.jpg
diff --git a/addons/crm/html/claudia-sebastiani.jpg b/addons/crm/static/description/claudia-sebastiani.jpg
similarity index 100%
rename from addons/crm/html/claudia-sebastiani.jpg
rename to addons/crm/static/description/claudia-sebastiani.jpg
diff --git a/addons/crm/html/crm_game.png b/addons/crm/static/description/crm_game.png
similarity index 100%
rename from addons/crm/html/crm_game.png
rename to addons/crm/static/description/crm_game.png
diff --git a/addons/crm/html/crm_game_01.png b/addons/crm/static/description/crm_game_01.png
similarity index 100%
rename from addons/crm/html/crm_game_01.png
rename to addons/crm/static/description/crm_game_01.png
diff --git a/addons/crm/html/crm_game_02.png b/addons/crm/static/description/crm_game_02.png
similarity index 100%
rename from addons/crm/html/crm_game_02.png
rename to addons/crm/static/description/crm_game_02.png
diff --git a/addons/crm/html/crm_game_03.png b/addons/crm/static/description/crm_game_03.png
similarity index 100%
rename from addons/crm/html/crm_game_03.png
rename to addons/crm/static/description/crm_game_03.png
diff --git a/addons/crm/html/crm_linkedin.png b/addons/crm/static/description/crm_linkedin.png
similarity index 100%
rename from addons/crm/html/crm_linkedin.png
rename to addons/crm/static/description/crm_linkedin.png
diff --git a/addons/crm/html/crm_sc_01.jpg b/addons/crm/static/description/crm_sc_01.jpg
similarity index 100%
rename from addons/crm/html/crm_sc_01.jpg
rename to addons/crm/static/description/crm_sc_01.jpg
diff --git a/addons/crm/html/crm_sc_01.png b/addons/crm/static/description/crm_sc_01.png
similarity index 100%
rename from addons/crm/html/crm_sc_01.png
rename to addons/crm/static/description/crm_sc_01.png
diff --git a/addons/crm/html/crm_sc_02.png b/addons/crm/static/description/crm_sc_02.png
similarity index 100%
rename from addons/crm/html/crm_sc_02.png
rename to addons/crm/static/description/crm_sc_02.png
diff --git a/addons/crm/html/crm_sc_04a.png b/addons/crm/static/description/crm_sc_04a.png
similarity index 100%
rename from addons/crm/html/crm_sc_04a.png
rename to addons/crm/static/description/crm_sc_04a.png
diff --git a/addons/crm/html/crm_sc_04b.png b/addons/crm/static/description/crm_sc_04b.png
similarity index 100%
rename from addons/crm/html/crm_sc_04b.png
rename to addons/crm/static/description/crm_sc_04b.png
diff --git a/addons/crm/html/crm_sc_04c.png b/addons/crm/static/description/crm_sc_04c.png
similarity index 100%
rename from addons/crm/html/crm_sc_04c.png
rename to addons/crm/static/description/crm_sc_04c.png
diff --git a/addons/crm/html/crm_sc_04d.png b/addons/crm/static/description/crm_sc_04d.png
similarity index 100%
rename from addons/crm/html/crm_sc_04d.png
rename to addons/crm/static/description/crm_sc_04d.png
diff --git a/addons/crm/html/crm_sc_05.png b/addons/crm/static/description/crm_sc_05.png
similarity index 100%
rename from addons/crm/html/crm_sc_05.png
rename to addons/crm/static/description/crm_sc_05.png
diff --git a/addons/crm/html/crm_sc_06.png b/addons/crm/static/description/crm_sc_06.png
similarity index 100%
rename from addons/crm/html/crm_sc_06.png
rename to addons/crm/static/description/crm_sc_06.png
diff --git a/addons/crm/html/crm_sc_08.png b/addons/crm/static/description/crm_sc_08.png
similarity index 100%
rename from addons/crm/html/crm_sc_08.png
rename to addons/crm/static/description/crm_sc_08.png
diff --git a/addons/crm/html/crm_sc_agenda.png b/addons/crm/static/description/crm_sc_agenda.png
similarity index 100%
rename from addons/crm/html/crm_sc_agenda.png
rename to addons/crm/static/description/crm_sc_agenda.png
diff --git a/addons/crm/html/crm_sc_marketing.png b/addons/crm/static/description/crm_sc_marketing.png
similarity index 100%
rename from addons/crm/html/crm_sc_marketing.png
rename to addons/crm/static/description/crm_sc_marketing.png
diff --git a/addons/crm/static/src/img/icon.png b/addons/crm/static/description/icon.png
similarity index 100%
rename from addons/crm/static/src/img/icon.png
rename to addons/crm/static/description/icon.png
diff --git a/addons/crm/html/index.html b/addons/crm/static/description/index.html
similarity index 100%
rename from addons/crm/html/index.html
rename to addons/crm/static/description/index.html
diff --git a/addons/crm/test/crm_lead_cancel.yml b/addons/crm/test/crm_lead_cancel.yml
index 8749675bf23..0f8d9ba1df9 100644
--- a/addons/crm/test/crm_lead_cancel.yml
+++ b/addons/crm/test/crm_lead_cancel.yml
@@ -4,37 +4,6 @@
!python {model: crm.lead}: |
section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})
self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})
- self.case_cancel(cr, uid, [ref("crm_case_1")])
--
- I check cancelled lead.
--
- !python {model: crm.lead}: |
- lead = self.browse(cr, uid, ref('crm_case_1'))
- assert lead.stage_id.id == ref('crm.stage_lead7'), "Stage should be 'Dead' and is %s." % (lead.stage_id.name)
- assert lead.state == 'cancel', "Opportunity is not in 'cancel' state."
- assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.'
--
- I reset cancelled lead into unqualified lead.
--
- !python {model: crm.lead}: |
- self.case_reset(cr, uid, [ref("crm_case_1")])
--
- I check unqualified lead after reset.
--
- !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}:
- - state == "draft"
--
- I re-open the lead
--
- !python {model: crm.lead}: |
- self.case_open(cr, uid, [ref("crm_case_1")])
--
- I check stage and state of the re-opened lead
--
- !python {model: crm.lead}: |
- lead = self.browse(cr, uid, ref('crm.crm_case_1'))
- assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'."
- assert lead.state == 'open', "Opportunity should be in 'open' state."
-
I escalate the lead to parent team.
-
diff --git a/addons/crm/test/crm_lead_onchange.yml b/addons/crm/test/crm_lead_onchange.yml
index 9154ffdf513..45e140e890e 100644
--- a/addons/crm/test/crm_lead_onchange.yml
+++ b/addons/crm/test/crm_lead_onchange.yml
@@ -20,9 +20,4 @@
-
!record {model: crm.phonecall, id: crm_phonecall_5}:
name: 'Bad time'
- partner_id: base.res_partner_5
--
- I set the next stage to "New" for the lead.
--
- !python {model: crm.lead}: |
- self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'})
+ partner_id: base.res_partner_5
\ No newline at end of file
diff --git a/addons/crm/test/lead2opportunity2win.yml b/addons/crm/test/lead2opportunity2win.yml
index 94e7149ef77..23545c61bc1 100644
--- a/addons/crm/test/lead2opportunity2win.yml
+++ b/addons/crm/test/lead2opportunity2win.yml
@@ -1,25 +1,15 @@
-
In order to test the conversion of a lead into a opportunity,
--
- I open a lead.
--
- !python {model: crm.lead}: |
- self.case_open(cr, uid, [ref("crm_case_4")])
--
- I check if the lead state is "Open".
--
- !assert {model: crm.lead, id: crm.crm_case_4, string: Lead state is Open}:
- - state == "open"
-
I convert lead into opportunity for exiting customer.
-
!python {model: crm.lead}: |
- self.convert_opportunity(cr, uid ,[ref("crm_case_4")], ref("base.res_partner_2"))
+ self.convert_opportunity(cr, uid ,[ref("crm_case_1")], ref("base.res_partner_2"))
-
I check details of converted opportunity.
-
!python {model: crm.lead}: |
- lead = self.browse(cr, uid, ref('crm_case_4'))
+ lead = self.browse(cr, uid, ref('crm_case_1'))
assert lead.type == 'opportunity', 'Lead is not converted to opportunity!'
assert lead.partner_id.id == ref("base.res_partner_2"), 'Partner mismatch!'
assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!'
@@ -28,7 +18,7 @@
-
!python {model: crm.opportunity2phonecall}: |
import time
- context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')]})
+ context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_1')]})
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': "Bonjour M. Jean, Comment allez-vous? J'ai bien reçu votre demande, pourrions-nous en parler quelques minutes?"}, context=context)
self.action_schedule(cr, uid, [call_id], context=context)
@@ -36,28 +26,28 @@
I check that phonecall is scheduled for that opportunity.
-
!python {model: crm.phonecall}: |
- ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_4'))])
+ ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_1'))])
assert len(ids), 'Phonecall is not scheduled'
-
Now I schedule meeting with customer.
-
!python {model: crm.lead}: |
- self.action_makeMeeting(cr, uid, [ref('crm_case_4')])
+ self.action_makeMeeting(cr, uid, [ref('crm_case_1')])
-
After communicated with customer, I put some notes with contract details.
-
!python {model: crm.lead}: |
- self.message_post(cr, uid, [ref('crm_case_4')], subject='Test note', body='Détails envoyés par le client sur le FAX pour la qualité')
+ self.message_post(cr, uid, [ref('crm_case_1')], subject='Test note', body='Détails envoyés par le client sur le FAX pour la qualité')
-
I win this opportunity
-
!python {model: crm.lead}: |
- self.case_mark_won(cr, uid, [ref("crm_case_4")])
+ self.case_mark_won(cr, uid, [ref("crm_case_1")])
-
I check details of the opportunity after having won the opportunity.
-
!python {model: crm.lead}: |
- lead = self.browse(cr, uid, ref('crm_case_4'))
+ lead = self.browse(cr, uid, ref('crm_case_1'))
assert lead.stage_id.id == ref('crm.stage_lead6'), "Opportunity stage should be 'Won'."
assert lead.state == 'done', "Opportunity is not in 'done' state!"
assert lead.probability == 100.0, "Revenue probability should be 100.0!"
@@ -104,7 +94,6 @@
-
!python {model: crm.meeting}: |
context.update({'active_model': 'crm.meeting'})
- self.case_open(cr, uid, [ref('base_calendar.crm_meeting_4')])
-
I invite a user for meeting.
-
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py
index 774571b0314..1e3ed2faad1 100644
--- a/addons/crm_claim/crm_claim.py
+++ b/addons/crm_claim/crm_claim.py
@@ -19,20 +19,12 @@
#
##############################################################################
-from openerp.addons.base_status.base_stage import base_stage
-import binascii
from openerp.addons.crm import crm
from openerp.osv import fields, osv
-import time
from openerp import tools
from openerp.tools.translate import _
from openerp.tools import html2plaintext
-CRM_CLAIM_PENDING_STATES = (
- crm.AVAILABLE_STATES[2][0], # Cancelled
- crm.AVAILABLE_STATES[3][0], # Done
- crm.AVAILABLE_STATES[4][0], # Pending
-)
class crm_claim_stage(osv.osv):
""" Model for claim stages. This models the main stages of a claim
@@ -51,8 +43,6 @@ class crm_claim_stage(osv.osv):
'section_ids':fields.many2many('crm.case.section', 'section_claim_stage_rel', 'stage_id', 'section_id', string='Sections',
help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."),
'state': fields.selection(crm.AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change regarding the selected stage. For example, if a stage is related to the status 'Close', when your document reaches this stage, it will be automatically have the 'closed' status."),
- 'case_refused': fields.boolean('Refused stage',
- help='Refused stages are specific stages for done.'),
'case_default': fields.boolean('Common to All Teams',
help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."),
'fold': fields.boolean('Hide in Views when Empty',
@@ -63,10 +53,9 @@ class crm_claim_stage(osv.osv):
'sequence': lambda *args: 1,
'state': 'draft',
'fold': False,
- 'case_refused': False,
}
-class crm_claim(base_stage, osv.osv):
+class crm_claim(osv.osv):
""" Crm claim
"""
_name = "crm.claim"
@@ -74,6 +63,15 @@ class crm_claim(base_stage, osv.osv):
_order = "priority,date desc"
_inherit = ['mail.thread']
+ def _get_default_section_id(self, cr, uid, context=None):
+ """ Gives default section by checking if present in the context """
+ return self.pool.get('crm.lead')._resolve_section_id_from_context(cr, uid, context=context) or False
+
+ def _get_default_stage_id(self, cr, uid, context=None):
+ """ Gives default stage_id """
+ section_id = self._get_default_section_id(cr, uid, context=context)
+ return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context)
+
_columns = {
'id': fields.integer('ID', readonly=True),
'name': fields.char('Claim Subject', size=128, required=True),
@@ -117,15 +115,13 @@ class crm_claim(base_stage, osv.osv):
}
_defaults = {
- 'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),
- 'partner_id': lambda s, cr, uid, c: s._get_default_partner(cr, uid, c),
- 'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
+ 'user_id': lambda s, cr, uid, c: uid,
'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),
- 'date': fields.datetime.now,
+ 'date': fields.datetime.now(),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'active': lambda *a: 1,
- 'stage_id':lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
+ 'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
}
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
@@ -158,27 +154,24 @@ class crm_claim(base_stage, osv.osv):
return stage_ids[0]
return False
- def case_refuse(self, cr, uid, ids, context=None):
- """ Mark the case as refused: state=done and case_refused=True """
- for lead in self.browse(cr, uid, ids):
- stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, ['&', ('state', '=', 'done'), ('case_refused', '=', True)], context=context)
- if stage_id:
- self.case_set(cr, uid, [lead.id], values_to_update={}, new_stage_id=stage_id, context=context)
- return True
-
- def onchange_partner_id(self, cr, uid, ids, part, email=False):
+ def onchange_partner_id(self, cr, uid, ids, partner_id, email=False, context=None):
"""This function returns value of partner address based on partner
- :param part: Partner's id
:param email: ignored
"""
- if not part:
- return {'value': {'email_from': False,
- 'partner_phone': False
- }
- }
- address = self.pool.get('res.partner').browse(cr, uid, part)
+ if not partner_id:
+ return {'value': {'email_from': False, 'partner_phone': False}}
+ address = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
return {'value': {'email_from': address.email, 'partner_phone': address.phone}}
+ def create(self, cr, uid, vals, context=None):
+ if context is None:
+ context = {}
+ if vals.get('section_id') and not context.get('default_section_id'):
+ context['default_section_id'] = vals.get('section_id')
+
+ # context: no_log, because subtype already handle this
+ return super(crm_claim, self).create(cr, uid, vals, context=context)
+
# -------------------------------------------------------
# Mail gateway
# -------------------------------------------------------
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index 0d2d8b391e7..28d0f7c731c 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -52,7 +52,6 @@
-