diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 700936695b8..d06ba70bf02 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -178,6 +178,7 @@ class account_invoice(osv.osv):
return invoice_ids
_name = "account.invoice"
+ _inherit = ['mail.thread']
_description = 'Invoice'
_order = "id desc"
@@ -355,12 +356,8 @@ class account_invoice(osv.osv):
context = {}
try:
res = super(account_invoice, self).create(cr, uid, vals, context)
- for inv_id, name in self.name_get(cr, uid, [res], context=context):
- ctx = context.copy()
- if vals.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
- ctx = self.get_log_context(cr, uid, context=ctx)
- message = _("Invoice '%s' is waiting for validation.") % name
- self.log(cr, uid, inv_id, message, context=ctx)
+ if res:
+ self.create_send_note(cr, uid, [res], context=context)
return res
except Exception, e:
if '"journal_id" viol' in e.args[0]:
@@ -373,9 +370,7 @@ class account_invoice(osv.osv):
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
- self.log(cr, uid, inv_id, message)
+ self.confirm_paid_send_note(cr, uid, ids, context=context)
return True
def unlink(self, cr, uid, ids, context=None):
@@ -943,6 +938,11 @@ class account_invoice(osv.osv):
move_obj.post(cr, uid, [move_id], context=ctx)
self._log_event(cr, uid, ids)
return True
+
+ def invoice_validate(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state':'open'}, context=context)
+ self.invoice_validate_send_note(cr, uid, ids, context=context)
+ return True
def line_get_convert(self, cr, uid, x, part, date, context=None):
return {
@@ -1033,6 +1033,7 @@ class account_invoice(osv.osv):
# will be automatically deleted too
account_move_obj.unlink(cr, uid, move_ids, context=context)
self._log_event(cr, uid, ids, -1.0, 'Cancel Invoice')
+ self.invoice_cancel_send_note(cr, uid, ids, context=context)
return True
###################
@@ -1240,7 +1241,36 @@ class account_invoice(osv.osv):
# Update the stored value (fields.function), so we write to trigger recompute
self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context)
return True
-
+
+ # -----------------------------------------
+ # OpenChatter notifications and need_action
+ # -----------------------------------------
+
+ def _get_document_type(self, type):
+ type_dict = {
+ 'out_invoice': 'Customer invoice',
+ 'in_invoice': 'Supplier invoice',
+ 'out_refund': 'Customer Refund',
+ 'in_refund': 'Supplier Refund',
+ }
+ return type_dict.get(type, 'Invoice')
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), context=context)
+
+ def invoice_validate_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id], body=_("%s validated.") % (self._get_document_type(obj.type)), context=context)
+
+ def confirm_paid_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), context=context)
+
+ def invoice_cancel_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), context=context)
+
account_invoice()
class account_invoice_line(osv.osv):
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index ef6c2510c54..ca8530fb082 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -243,6 +243,7 @@
+
@@ -338,6 +339,7 @@
+
diff --git a/addons/account/account_invoice_workflow.xml b/addons/account/account_invoice_workflow.xml
index 2af1e192a9b..13db193af8d 100644
--- a/addons/account/account_invoice_workflow.xml
+++ b/addons/account/account_invoice_workflow.xml
@@ -27,7 +27,7 @@
action_date_assign()
action_move_create()
action_number()
-write({'state':'open'})
+invoice_validate()
function
diff --git a/addons/account_asset/i18n/cs.po b/addons/account_asset/i18n/cs.po
index 503a7f9609b..78b7958e229 100644
--- a/addons/account_asset/i18n/cs.po
+++ b/addons/account_asset/i18n/cs.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
-"PO-Revision-Date: 2012-01-11 09:11+0000\n"
+"PO-Revision-Date: 2012-04-06 04:57+0000\n"
"Last-Translator: Jiří Hajda \n"
"Language-Team: Czech \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-02-09 07:10+0000\n"
-"X-Generator: Launchpad (build 14763)\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:56+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
"X-Poedit-Language: Czech\n"
#. module: account_asset
@@ -401,6 +401,8 @@ msgid ""
"currency. You should remove the secondary currency on the account or select "
"a multi-currency view on the journal."
msgstr ""
+"Vybraný účet vašeho záznamu deníku vynucuje použití druhotné měny. Měli "
+"byste odstranit druhotnou měnu z účtu nebo vybrat více-měny."
#. module: account_asset
#: view:asset.asset.report:0
@@ -445,6 +447,8 @@ msgid ""
"The date of your Journal Entry is not in the defined period! You should "
"change the date or remove this constraint from the journal."
msgstr ""
+"Datum vašeho záznamu deníku není v určeném období! Měli byste změnit datum "
+"nebo odstranit omezení z deníku."
#. module: account_asset
#: field:account.asset.asset,note:0 field:account.asset.category,note:0
@@ -507,7 +511,7 @@ msgstr "Zaúčtované řádky odpisů"
#. module: account_asset
#: constraint:account.move.line:0
msgid "Company must be the same for its related account and period."
-msgstr ""
+msgstr "Společnost musí být stejná pro své vztažené účty a období."
#. module: account_asset
#: field:account.asset.asset,child_ids:0
@@ -537,7 +541,7 @@ msgstr "Majetek zakoupený v tomto měsíci"
#. module: account_asset
#: constraint:account.move.line:0
msgid "You can not create journal items on an account of type view."
-msgstr ""
+msgstr "Nemůžete vytvořit položky deníku v účtu typu pohled."
#. module: account_asset
#: view:asset.asset.report:0
@@ -769,7 +773,7 @@ msgstr "Vytvořit pohyby majetku"
#. module: account_asset
#: constraint:account.move.line:0
msgid "You can not create journal items on closed account."
-msgstr ""
+msgstr "Nemůžete vytvořit položky deníku v uzavřeném účtu."
#. module: account_asset
#: model:ir.actions.act_window,help:account_asset.action_asset_asset_report
diff --git a/addons/account_cancel/i18n/cs.po b/addons/account_cancel/i18n/cs.po
new file mode 100644
index 00000000000..0b6a396e044
--- /dev/null
+++ b/addons/account_cancel/i18n/cs.po
@@ -0,0 +1,23 @@
+# Czech translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-02-08 00:35+0000\n"
+"PO-Revision-Date: 2012-04-06 04:54+0000\n"
+"Last-Translator: Jiří Hajda \n"
+"Language-Team: Czech \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: account_cancel
+#: view:account.invoice:0
+msgid "Cancel"
+msgstr "Zrušit"
diff --git a/addons/account_check_writing/i18n/ar.po b/addons/account_check_writing/i18n/ar.po
index f1f12f7bea0..9c35de222f4 100644
--- a/addons/account_check_writing/i18n/ar.po
+++ b/addons/account_check_writing/i18n/ar.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-04-06 04:37+0000\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:56+0000\n"
"X-Generator: Launchpad (build 15060)\n"
#. module: account_check_writing
diff --git a/addons/analytic_user_function/i18n/ja.po b/addons/analytic_user_function/i18n/ja.po
new file mode 100644
index 00000000000..e63fedd273f
--- /dev/null
+++ b/addons/analytic_user_function/i18n/ja.po
@@ -0,0 +1,79 @@
+# Japanese translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-02-08 00:35+0000\n"
+"PO-Revision-Date: 2012-04-08 05:16+0000\n"
+"Last-Translator: Masaki Yamaya \n"
+"Language-Team: Japanese \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-09 04:56+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: analytic_user_function
+#: field:analytic.user.funct.grid,product_id:0
+msgid "Product"
+msgstr "商品"
+
+#. module: analytic_user_function
+#: model:ir.model,name:analytic_user_function.model_analytic_user_funct_grid
+msgid "Relation table between users and products on a analytic account"
+msgstr "分析アカウントのユーザと商品の関係テーブル"
+
+#. module: analytic_user_function
+#: constraint:hr.analytic.timesheet:0
+msgid "You cannot modify an entry in a Confirmed/Done timesheet !."
+msgstr "確認済みのタイムシートの項目を変更することはできません。"
+
+#. module: analytic_user_function
+#: field:analytic.user.funct.grid,account_id:0
+#: model:ir.model,name:analytic_user_function.model_account_analytic_account
+msgid "Analytic Account"
+msgstr "分析アカウント"
+
+#. module: analytic_user_function
+#: view:account.analytic.account:0
+#: field:account.analytic.account,user_product_ids:0
+msgid "Users/Products Rel."
+msgstr "ユーザ・商品の関係"
+
+#. module: analytic_user_function
+#: field:analytic.user.funct.grid,user_id:0
+msgid "User"
+msgstr "ユーザ"
+
+#. module: analytic_user_function
+#: code:addons/analytic_user_function/analytic_user_function.py:96
+#: code:addons/analytic_user_function/analytic_user_function.py:131
+#, python-format
+msgid "There is no expense account define for this product: \"%s\" (id:%d)"
+msgstr "商品 \"%s\" (id:%d) のアカウントが定義されていません。"
+
+#. module: analytic_user_function
+#: code:addons/analytic_user_function/analytic_user_function.py:95
+#: code:addons/analytic_user_function/analytic_user_function.py:130
+#, python-format
+msgid "Error !"
+msgstr "エラー"
+
+#. module: analytic_user_function
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr "エラー。反復した分析アカウントを作ることはできません"
+
+#. module: analytic_user_function
+#: model:ir.model,name:analytic_user_function.model_hr_analytic_timesheet
+msgid "Timesheet Line"
+msgstr "タイムシートの行"
+
+#. module: analytic_user_function
+#: view:analytic.user.funct.grid:0
+msgid "User's Product for this Analytic Account"
+msgstr "この分析アカウントのユーザの商品"
diff --git a/addons/association/i18n/ja.po b/addons/association/i18n/ja.po
new file mode 100644
index 00000000000..02e034238c6
--- /dev/null
+++ b/addons/association/i18n/ja.po
@@ -0,0 +1,135 @@
+# Japanese translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:14+0000\n"
+"PO-Revision-Date: 2012-04-08 06:15+0000\n"
+"Last-Translator: Masaki Yamaya \n"
+"Language-Team: Japanese \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-09 04:56+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,wiki:0
+msgid "Wiki"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Event Management"
+msgstr "イベント管理"
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,project_gtd:0
+msgid "Getting Things Done"
+msgstr "物事を完了"
+
+#. module: association
+#: model:ir.module.module,description:association.module_meta_information
+msgid "This module is to create Profile for Associates"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,progress:0
+msgid "Configuration Progress"
+msgstr "設定を進行中"
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid ""
+"Here are specific applications related to the Association Profile you "
+"selected."
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "title"
+msgstr "タイトル"
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,event_project:0
+msgid "Helps you to manage and organize your events."
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,config_logo:0
+msgid "Image"
+msgstr "画像"
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,hr_expense:0
+msgid ""
+"Tracks and manages employee expenses, and can automatically re-invoice "
+"clients if the expenses are project-related."
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,project_gtd:0
+msgid ""
+"GTD is a methodology to efficiently organise yourself and your tasks. This "
+"module fully integrates GTD principle with OpenERP's project management."
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Resources Management"
+msgstr ""
+
+#. module: association
+#: model:ir.module.module,shortdesc:association.module_meta_information
+msgid "Association profile"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,hr_expense:0
+msgid "Expenses Tracking"
+msgstr ""
+
+#. module: association
+#: model:ir.actions.act_window,name:association.action_config_install_module
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Association Application Configuration"
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,wiki:0
+msgid ""
+"Lets you create wiki pages and page groups in order to keep track of "
+"business knowledge and share it with and between your employees."
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,project:0
+msgid ""
+"Helps you manage your projects and tasks by tracking them, generating "
+"plannings, etc..."
+msgstr ""
+
+#. module: association
+#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard
+msgid "profile.association.config.install_modules_wizard"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,event_project:0
+msgid "Events"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+#: field:profile.association.config.install_modules_wizard,project:0
+msgid "Project Management"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Configure"
+msgstr ""
diff --git a/addons/auth_openid/i18n/ar.po b/addons/auth_openid/i18n/ar.po
index 7887f023e14..a36f5ea011d 100644
--- a/addons/auth_openid/i18n/ar.po
+++ b/addons/auth_openid/i18n/ar.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-04-06 04:37+0000\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:56+0000\n"
"X-Generator: Launchpad (build 15060)\n"
#. #-#-#-#-# auth_openid.pot (OpenERP Server 6.1rc1) #-#-#-#-#
diff --git a/addons/base_crypt/i18n/cs.po b/addons/base_crypt/i18n/cs.po
new file mode 100644
index 00000000000..38b1cfda3a5
--- /dev/null
+++ b/addons/base_crypt/i18n/cs.po
@@ -0,0 +1,46 @@
+# Czech translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-02-08 00:36+0000\n"
+"PO-Revision-Date: 2012-04-06 05:20+0000\n"
+"Last-Translator: Jiří Hajda \n"
+"Language-Team: Czech \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: base_crypt
+#: model:ir.model,name:base_crypt.model_res_users
+msgid "res.users"
+msgstr "res.users"
+
+#. module: base_crypt
+#: sql_constraint:res.users:0
+msgid "You can not have two users with the same login !"
+msgstr "Nemůžete mít dva uživatele se stejným přihlašovacím jménem !"
+
+#. module: base_crypt
+#: constraint:res.users:0
+msgid "The chosen company is not in the allowed companies for this user"
+msgstr ""
+"Vybraná společnost není v povolených společnostech pro tohoto uživatele"
+
+#. module: base_crypt
+#: code:addons/base_crypt/crypt.py:140
+#, python-format
+msgid "Please specify the password !"
+msgstr "Prosíme zadejte heslo!"
+
+#. module: base_crypt
+#: code:addons/base_crypt/crypt.py:140
+#, python-format
+msgid "Error"
+msgstr "Chyba"
diff --git a/addons/base_iban/i18n/cs.po b/addons/base_iban/i18n/cs.po
index 624cd1ced60..6d07d09d8bb 100644
--- a/addons/base_iban/i18n/cs.po
+++ b/addons/base_iban/i18n/cs.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
-"PO-Revision-Date: 2010-08-03 01:50+0000\n"
-"Last-Translator: Mantavya Gajjar (Open ERP) \n"
+"PO-Revision-Date: 2012-04-06 06:16+0000\n"
+"Last-Translator: Jiří Hajda \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: 2012-02-09 06:01+0000\n"
-"X-Generator: Launchpad (build 14763)\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
#. module: base_iban
#: constraint:res.partner.bank:0
@@ -23,27 +23,30 @@ msgid ""
"Please define BIC/Swift code on bank for bank type IBAN Account to make "
"valid payments"
msgstr ""
+"\n"
+"Prosíme určete kód BIC/Swift u banky pro IBAN účet bankovního typu k ověření "
+"plateb"
#. module: base_iban
#: code:addons/base_iban/base_iban.py:139
#, python-format
msgid "This IBAN does not pass the validation check, please verify it"
-msgstr ""
+msgstr "Tento IBAN neprošel testem ověření, prosíme zkontrolujte jej"
#. module: base_iban
#: model:res.partner.bank.type,format_layout:base_iban.bank_iban
msgid "%(bank_name)s: IBAN %(acc_number)s - BIC %(bank_bic)s"
-msgstr ""
+msgstr "%(bank_name)s: IBAN %(acc_number)s - BIC %(bank_bic)s"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_swift_field
msgid "bank_bic"
-msgstr ""
+msgstr "bank_bic"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_zip_field
msgid "zip"
-msgstr "zip"
+msgstr "psč"
#. module: base_iban
#: help:res.partner.bank,iban:0
@@ -53,12 +56,12 @@ msgstr "Mezinárodní Bankovní Číslo Účtu"
#. module: base_iban
#: model:ir.model,name:base_iban.model_res_partner_bank
msgid "Bank Accounts"
-msgstr ""
+msgstr "Bankovní účty"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_country_field
msgid "country_id"
-msgstr "id_státu"
+msgstr "country_id"
#. module: base_iban
#: code:addons/base_iban/base_iban.py:136
@@ -66,7 +69,7 @@ msgstr "id_státu"
msgid ""
"The IBAN does not seem to be correct. You should have entered something like "
"this %s"
-msgstr ""
+msgstr "IBAN nevypadá jako správný. Měli byste zadat něco jako toto %s"
#. module: base_iban
#: field:res.partner.bank,iban:0
@@ -77,7 +80,7 @@ msgstr "IBAN"
#: code:addons/base_iban/base_iban.py:140
#, python-format
msgid "The IBAN is invalid, it should begin with the country code"
-msgstr ""
+msgstr "IBAN je neplatný, měl by začínat kódem země"
#. module: base_iban
#: model:res.partner.bank.type,name:base_iban.bank_iban
@@ -87,7 +90,7 @@ msgstr "Účet IBAN"
#. module: base_iban
#: constraint:res.partner.bank:0
msgid "The RIB and/or IBAN is not valid"
-msgstr ""
+msgstr "RIB a/nebo IBAN není platný"
#~ msgid "Invalid XML for View Architecture!"
#~ msgstr "Invalidní XML pro zobrazení architektury!"
diff --git a/addons/base_iban/i18n/ja.po b/addons/base_iban/i18n/ja.po
new file mode 100644
index 00000000000..6a23a021336
--- /dev/null
+++ b/addons/base_iban/i18n/ja.po
@@ -0,0 +1,91 @@
+# Japanese translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-02-08 00:36+0000\n"
+"PO-Revision-Date: 2012-04-08 06:11+0000\n"
+"Last-Translator: Masaki Yamaya \n"
+"Language-Team: Japanese \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-09 04:56+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: base_iban
+#: constraint:res.partner.bank:0
+msgid ""
+"\n"
+"Please define BIC/Swift code on bank for bank type IBAN Account to make "
+"valid payments"
+msgstr ""
+
+#. module: base_iban
+#: code:addons/base_iban/base_iban.py:139
+#, python-format
+msgid "This IBAN does not pass the validation check, please verify it"
+msgstr ""
+
+#. module: base_iban
+#: model:res.partner.bank.type,format_layout:base_iban.bank_iban
+msgid "%(bank_name)s: IBAN %(acc_number)s - BIC %(bank_bic)s"
+msgstr ""
+
+#. module: base_iban
+#: model:res.partner.bank.type.field,name:base_iban.bank_swift_field
+msgid "bank_bic"
+msgstr ""
+
+#. module: base_iban
+#: model:res.partner.bank.type.field,name:base_iban.bank_zip_field
+msgid "zip"
+msgstr ""
+
+#. module: base_iban
+#: help:res.partner.bank,iban:0
+msgid "International Bank Account Number"
+msgstr "国際銀行口座番号"
+
+#. module: base_iban
+#: model:ir.model,name:base_iban.model_res_partner_bank
+msgid "Bank Accounts"
+msgstr "銀行口座"
+
+#. module: base_iban
+#: model:res.partner.bank.type.field,name:base_iban.bank_country_field
+msgid "country_id"
+msgstr ""
+
+#. module: base_iban
+#: code:addons/base_iban/base_iban.py:136
+#, python-format
+msgid ""
+"The IBAN does not seem to be correct. You should have entered something like "
+"this %s"
+msgstr ""
+
+#. module: base_iban
+#: field:res.partner.bank,iban:0
+msgid "IBAN"
+msgstr "国際銀行口座番号"
+
+#. module: base_iban
+#: code:addons/base_iban/base_iban.py:140
+#, python-format
+msgid "The IBAN is invalid, it should begin with the country code"
+msgstr ""
+
+#. module: base_iban
+#: model:res.partner.bank.type,name:base_iban.bank_iban
+msgid "IBAN Account"
+msgstr ""
+
+#. module: base_iban
+#: constraint:res.partner.bank:0
+msgid "The RIB and/or IBAN is not valid"
+msgstr "銀行情報のRIBまたはIBANが正しくありません。"
diff --git a/addons/base_module_record/i18n/cs.po b/addons/base_module_record/i18n/cs.po
index 05034f6c84a..c38439da947 100644
--- a/addons/base_module_record/i18n/cs.po
+++ b/addons/base_module_record/i18n/cs.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
-"PO-Revision-Date: 2011-09-09 10:24+0000\n"
+"PO-Revision-Date: 2012-04-06 05:26+0000\n"
"Last-Translator: Jiří Hajda \n"
"Language-Team: Czech \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-02-09 06:14+0000\n"
-"X-Generator: Launchpad (build 14763)\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
"X-Poedit-Language: Czech\n"
#. module: base_module_record
@@ -90,6 +90,9 @@ msgid ""
"publish it on http://www.openerp.com, in the 'Modules' section. You can do "
"it through the website or using features of the 'base_module_publish' module."
msgstr ""
+"Pokud myslíte, že váš modul může zajímat jiné lidi, byli bychom rádi, abyste "
+"jej zveřejnili v sekci 'Moduly' na http://www.openerp.com. Můžete to provést "
+"přes webové stránky nebo použitím schopnosti modulu 'base_module_publish'."
#. module: base_module_record
#: wizard_field:base_module_record.module_record_data,init,check_date:0
diff --git a/addons/base_tools/i18n/cs.po b/addons/base_tools/i18n/cs.po
new file mode 100644
index 00000000000..6215f692393
--- /dev/null
+++ b/addons/base_tools/i18n/cs.po
@@ -0,0 +1,32 @@
+# Czech translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:14+0000\n"
+"PO-Revision-Date: 2012-04-06 06:17+0000\n"
+"Last-Translator: Jiří Hajda \n"
+"Language-Team: Czech \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: base_tools
+#: model:ir.module.module,shortdesc:base_tools.module_meta_information
+msgid "Common base for tools modules"
+msgstr "Obecný základ pro nástrojové moduly"
+
+#. module: base_tools
+#: model:ir.module.module,description:base_tools.module_meta_information
+msgid ""
+"\n"
+" "
+msgstr ""
+"\n"
+" "
diff --git a/addons/base_vat/i18n/cs.po b/addons/base_vat/i18n/cs.po
index 277f65c1989..b770b46f8fd 100644
--- a/addons/base_vat/i18n/cs.po
+++ b/addons/base_vat/i18n/cs.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
-"PO-Revision-Date: 2011-08-07 19:04+0000\n"
-"Last-Translator: Jan B. Krejčí \n"
+"PO-Revision-Date: 2012-04-06 06:22+0000\n"
+"Last-Translator: Jiří Hajda \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: 2012-02-09 06:15+0000\n"
-"X-Generator: Launchpad (build 14763)\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
#. module: base_vat
#: code:addons/base_vat/base_vat.py:141
@@ -23,31 +23,33 @@ msgid ""
"This VAT number does not seem to be valid.\n"
"Note: the expected format is %s"
msgstr ""
+"Toto DIČ nevypadá jako platné.\n"
+"Poznámka: očekávaný formát je %s"
#. module: base_vat
#: sql_constraint:res.company:0
msgid "The company name must be unique !"
-msgstr ""
+msgstr "Jméno společnosti musí být jedinečné !"
#. module: base_vat
#: constraint:res.partner:0
msgid "Error ! You cannot create recursive associated members."
-msgstr ""
+msgstr "Chyba ! Nemůžete vytvořit rekurzivní přidružené členy."
#. module: base_vat
#: field:res.company,vat_check_vies:0
msgid "VIES VAT Check"
-msgstr ""
+msgstr "Kontrola DIČ přes VIES"
#. module: base_vat
#: model:ir.model,name:base_vat.model_res_company
msgid "Companies"
-msgstr ""
+msgstr "Společnosti"
#. module: base_vat
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
-msgstr ""
+msgstr "Chyba! Nemůžete vytvořit rekurzivní společnosti."
#. module: base_vat
#: help:res.partner,vat_subjected:0
@@ -55,11 +57,13 @@ msgid ""
"Check this box if the partner is subjected to the VAT. It will be used for "
"the VAT legal statement."
msgstr ""
+"Zaškrtněte toto políčko, pokud partner podléhá DPH. Toto bude použito pro "
+"přiznání k DPH."
#. module: base_vat
#: model:ir.model,name:base_vat.model_res_partner
msgid "Partner"
-msgstr ""
+msgstr "Partner"
#. module: base_vat
#: help:res.company,vat_check_vies:0
@@ -67,6 +71,8 @@ msgid ""
"If checked, Partners VAT numbers will be fully validated against EU's VIES "
"service rather than via a simple format validation (checksum)."
msgstr ""
+"Pokud je zaškrtnuto, DIČ partnera bude plně ověřeno proti službě VIES EU "
+"raději než přes jednoduché ověření formátu (kontrolní součet)."
#. module: base_vat
#: field:res.partner,vat_subjected:0
diff --git a/addons/board/board.py b/addons/board/board.py
index 61ade1203bb..6c28aa33c40 100644
--- a/addons/board/board.py
+++ b/addons/board/board.py
@@ -186,45 +186,4 @@ class board_line(osv.osv):
'position': lambda *args: 'left'
}
-class res_log_report(osv.osv):
- """ Log Report """
- _name = "res.log.report"
- _auto = False
- _description = "Log Report"
- _columns = {
- 'name': fields.char('Year', size=64, required=False, readonly=True),
- 'month':fields.selection([('01', 'January'), ('02', 'February'), \
- ('03', 'March'), ('04', 'April'),\
- ('05', 'May'), ('06', 'June'), \
- ('07', 'July'), ('08', 'August'),\
- ('09', 'September'), ('10', 'October'),\
- ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
- 'creation_date': fields.date('Creation Date', readonly=True),
- 'res_model': fields.char('Object', size=128),
- 'nbr': fields.integer('# of Entries', readonly=True)
- }
-
- def init(self, cr):
- """
- Log Report
- @param cr: the current row, from the database cursor
- """
- tools.drop_view_if_exists(cr,'res_log_report')
- cr.execute("""
- CREATE OR REPLACE VIEW res_log_report AS (
- SELECT
- l.id as id,
- 1 as nbr,
- to_char(l.create_date, 'YYYY') as name,
- to_char(l.create_date, 'MM') as month,
- to_char(l.create_date, 'YYYY-MM-DD') as day,
- to_char(l.create_date, 'YYYY-MM-DD') as creation_date,
- l.res_model as res_model,
- date_trunc('day',l.create_date) as create_date
- FROM
- res_log l
- )""")
-res_log_report()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/board/board_data_admin.xml b/addons/board/board_data_admin.xml
index 8cefd04a3b7..5f8c2f1b05c 100644
--- a/addons/board/board_data_admin.xml
+++ b/addons/board/board_data_admin.xml
@@ -1,6 +1,7 @@
-
+
+
user.connection.tree
@@ -21,115 +22,11 @@
-
-
- Latest Activities
- res.log
- form
- tree,form
-
-
-
-
- res.log.report.select
- res.log.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- res.log.report.tree
- res.log.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
Configuration Overview
board.config.overview
-
-
- board.res.log.report.graph
- res.log.report
- graph
-
-
-
-
-
-
-
-
- Monthly Activity per Document
- res.log.report
- form
- graph,tree
- [('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]
- {'group_by':['res_model'],'group_by_no_leaf':1}
-
-
-
-
-
- board.weekly.res.log.report.graph
- res.log.report
- graph
-
-
-
-
-
-
-
-
- Weekly Global Activity
- res.log.report
- form
- graph,tree
- [('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]
- {'group_by':['day'],'group_by_no_leaf':1}
-
-
-
board.administration.form
board.board
@@ -164,5 +61,5 @@
-
+
diff --git a/addons/board/i18n/cs.po b/addons/board/i18n/cs.po
index 1252b26e977..5b2f1f21026 100644
--- a/addons/board/i18n/cs.po
+++ b/addons/board/i18n/cs.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
-"PO-Revision-Date: 2009-12-23 20:43+0000\n"
-"Last-Translator: Kuvaly [LCT] \n"
+"PO-Revision-Date: 2012-04-06 06:15+0000\n"
+"Last-Translator: Jiří Hajda \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: 2012-02-09 06:40+0000\n"
-"X-Generator: Launchpad (build 14763)\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
"X-Poedit-Language: Czech\n"
#. module: board
@@ -40,13 +40,13 @@ msgstr "Poslední spojení"
#. module: board
#: view:res.log.report:0
msgid "Log created in last month"
-msgstr ""
+msgstr "Záznam vytvořený minulý měsíc"
#. module: board
#: view:board.board:0
#: model:ir.actions.act_window,name:board.open_board_administration_form
msgid "Administration Dashboard"
-msgstr "Správa nástěnky"
+msgstr "Nástěnka správy"
#. module: board
#: view:res.log.report:0
@@ -56,7 +56,7 @@ msgstr "Seskupit podle..."
#. module: board
#: view:res.log.report:0
msgid "Log created in current year"
-msgstr ""
+msgstr "Záznam vytvořený v tomto roce"
#. module: board
#: model:ir.model,name:board.model_board_board
@@ -93,7 +93,7 @@ msgstr "Měsíc"
#. module: board
#: view:res.log.report:0
msgid "Log created in current month"
-msgstr ""
+msgstr "Záznam vytvořený v tomto měsíci"
#. module: board
#: model:ir.actions.act_window,name:board.board_monthly_res_log_report_action
@@ -104,7 +104,7 @@ msgstr "Měsíční činnosti dle dokumentu"
#. module: board
#: view:board.board:0
msgid "Configuration Overview"
-msgstr ""
+msgstr "Přehled nastavení"
#. module: board
#: model:ir.actions.act_window,name:board.action_view_board_list_form
@@ -212,7 +212,7 @@ msgstr "Leden"
#. module: board
#: view:board.board:0
msgid "Users"
-msgstr ""
+msgstr "Uživatelé"
#. module: board
#: selection:res.log.report,month:0
@@ -265,7 +265,7 @@ msgstr "Model"
#. module: board
#: model:ir.actions.act_window,name:board.board_homepage_action
msgid "Home Page"
-msgstr ""
+msgstr "Domovská stránka"
#. module: board
#: model:ir.actions.act_window,name:board.action_latest_activities_tree
diff --git a/addons/board/security/ir.model.access.csv b/addons/board/security/ir.model.access.csv
index 2275cc7d47d..bc9e0844923 100644
--- a/addons/board/security/ir.model.access.csv
+++ b/addons/board/security/ir.model.access.csv
@@ -3,4 +3,3 @@ access_board_board all,board.board,model_board_board,,1,0,0,0
access_board_board_line all,board.board.line,model_board_board_line,,1,0,0,0
access_board_board system,board.board system,model_board_board,base.group_system,1,1,1,1
access_board_board_line system,board.board.line system,model_board_board_line,base.group_system,1,1,1,1
-access_res_log_report all,res.log.report,model_res_log_report,,1,0,0,0
diff --git a/addons/claim_from_delivery/i18n/cs.po b/addons/claim_from_delivery/i18n/cs.po
new file mode 100644
index 00000000000..6f3a8ca0a81
--- /dev/null
+++ b/addons/claim_from_delivery/i18n/cs.po
@@ -0,0 +1,23 @@
+# Czech translation for openobject-addons
+# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-02-08 00:36+0000\n"
+"PO-Revision-Date: 2012-04-06 04:57+0000\n"
+"Last-Translator: Jiří Hajda \n"
+"Language-Team: Czech \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-04-07 04:55+0000\n"
+"X-Generator: Launchpad (build 15060)\n"
+
+#. module: claim_from_delivery
+#: model:ir.actions.act_window,name:claim_from_delivery.action_claim_from_delivery
+msgid "Claim"
+msgstr "Pohledávka"
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 6fa84a83560..467ea64e633 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -127,7 +127,7 @@ class crm_case_section(osv.osv):
def name_get(self, cr, uid, ids, context=None):
"""Overrides orm name_get method"""
- if not isinstance(ids, list) :
+ if not isinstance(ids, list) :
ids = [ids]
res = []
if not ids:
@@ -256,7 +256,40 @@ class crm_base(object):
data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
return {'value': data}
- def case_open(self, cr, uid, ids, *args):
+ def case_get_note_msg_prefix(self, cr, uid, id, context=None):
+ return ''
+
+ def case_open_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ msg = '%s has been opened.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=msg, context=context)
+ return True
+
+ def case_close_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ msg = '%s has been closed.'% (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=msg, context=context)
+ return True
+
+ def case_cancel_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ msg = '%s has been canceled.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=msg, context=context)
+ return True
+
+ def case_pending_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ msg = '%s is now pending.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=msg, context=context)
+ return True
+
+ def case_reset_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ msg = '%s has been renewed.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=msg, context=context)
+ return True
+
+ def case_open(self, cr, uid, ids, context=None):
"""Opens Case
:param ids: List of case Ids
"""
@@ -265,12 +298,13 @@ class crm_base(object):
data = {'state': 'open', 'active': True}
if not case.user_id:
data['user_id'] = uid
- self.write(cr, uid, case.id, data)
-
+ self.write(cr, uid, [case.id], data)
+ self.case_open_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'open')
+
return True
- def case_close(self, cr, uid, ids, *args):
+ def case_close(self, cr, uid, ids, context=None):
"""Closes Case
:param ids: List of case Ids
"""
@@ -278,10 +312,11 @@ class crm_base(object):
cases[0].state # to fill the browse record cache
self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'), })
# We use the cache of cases to keep the old case state
+ self.case_close_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'done')
return True
- def case_cancel(self, cr, uid, ids, *args):
+ def case_cancel(self, cr, uid, ids, context=None):
"""Cancels Case
:param ids: List of case Ids
"""
@@ -289,26 +324,29 @@ class crm_base(object):
cases[0].state # to fill the browse record cache
self.write(cr, uid, ids, {'state': 'cancel', 'active': True})
# We use the cache of cases to keep the old case state
+ self.case_cancel_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'cancel')
return True
- def case_pending(self, cr, uid, ids, *args):
+ def case_pending(self, cr, uid, ids, context=None):
"""Marks case as pending
:param ids: List of case Ids
"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.write(cr, uid, ids, {'state': 'pending', 'active': True})
+ self.case_pending_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'pending')
return True
- def case_reset(self, cr, uid, ids, *args):
+ def case_reset(self, cr, uid, ids, context=None):
"""Resets case as draft
:param ids: List of case Ids
"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.write(cr, uid, ids, {'state': 'draft', 'active': True})
+ self.case_reset_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'draft')
return True
@@ -323,12 +361,12 @@ class crm_base(object):
return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context)
class crm_case(crm_base):
- """ A simple python class to be used for common functions
+ """ A simple python class to be used for common functions
Object that inherit from this class should inherit from mailgate.thread
And need a stage_id field
- And object that inherit (orm inheritance) from a class the overwrite copy
+ And object that inherit (orm inheritance) from a class the overwrite copy
"""
-
+
def stage_find(self, cr, uid, section_id, domain=[], order='sequence'):
domain = list(domain)
if section_id:
@@ -387,34 +425,45 @@ class crm_case(crm_base):
default.update({ 'date_open': False })
return super(crm_case, self).copy(cr, uid, id, default, context=context)
+ def case_escalate_send_note(self, cr, uid, ids, new_section=None, context=None):
+ for id in ids:
+ if new_section:
+ msg = '%s has been escalated to %s.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context), new_section.name)
+ else:
+ msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], 'System Notification', msg, context=context)
+ return True
- def case_open(self, cr, uid, ids, *args):
+ def case_get_note_msg_prefix(self, cr, uid, id, context=None):
+ return ''
+
+ def case_open(self, cr, uid, ids, context=None):
"""Opens Case"""
cases = self.browse(cr, uid, ids)
- self.message_append(cr, uid, cases, _('Open'))
for case in cases:
data = {'state': 'open', 'active': True }
if not case.user_id:
data['user_id'] = uid
- self.write(cr, uid, case.id, data)
+ self.write(cr, uid, [case.id], data)
+ self.case_open_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'open')
return True
- def case_close(self, cr, uid, ids, *args):
+ def case_close(self, cr, uid, ids, context=None):
"""Closes Case"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
- self.message_append(cr, uid, cases, _('Close'))
self.write(cr, uid, ids, {'state': 'done',
'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
})
#
# We use the cache of cases to keep the old case state
#
+ self.case_close_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'done')
return True
- def case_escalate(self, cr, uid, ids, *args):
+ def case_escalate(self, cr, uid, ids, context=None):
"""Escalates case to parent level"""
cases = self.browse(cr, uid, ids)
for case in cases:
@@ -427,42 +476,37 @@ class crm_case(crm_base):
else:
raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.'))
self.write(cr, uid, [case.id], data)
+ case.case_escalate_send_note(case.section_id.parent_id)
cases = self.browse(cr, uid, ids)
- self.message_append(cr, uid, cases, _('Escalate'))
self._action(cr, uid, cases, 'escalate')
return True
- def case_cancel(self, cr, uid, ids, *args):
+ def case_cancel(self, cr, uid, ids, context=None):
"""Cancels Case"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
- self.message_append(cr, uid, cases, _('Cancel'))
self.write(cr, uid, ids, {'state': 'cancel',
'active': True})
+ self.case_cancel_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'cancel')
- for case in cases:
- message = _("The case '%s' has been cancelled.") % (case.name,)
- self.log(cr, uid, case.id, message)
return True
- def case_pending(self, cr, uid, ids, *args):
+ def case_pending(self, cr, uid, ids, context=None):
"""Marks case as pending"""
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
- self.message_append(cr, uid, cases, _('Pending'))
self.write(cr, uid, ids, {'state': 'pending', 'active': True})
+ self.case_pending_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, 'pending')
return True
- def case_reset(self, cr, uid, ids, *args):
+ def case_reset(self, cr, uid, ids, context=None):
"""Resets case as draft"""
state = 'draft'
- if 'crm.phonecall' in args:
- state = 'open'
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
- self.message_append(cr, uid, cases, _('Draft'))
self.write(cr, uid, ids, {'state': state, 'active': True})
+ self.case_reset_send_note(cr, uid, ids, context=context)
self._action(cr, uid, cases, state)
return True
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 2b319e565da..00f477a75d7 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -40,7 +40,7 @@ class crm_lead(crm_case, osv.osv):
_name = "crm.lead"
_description = "Lead/Opportunity"
_order = "priority,date_action,id desc"
- _inherit = ['mail.thread','res.partner']
+ _inherit = ['ir.needaction_mixin', 'mail.thread','res.partner']
def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
access_rights_uid = access_rights_uid or uid
@@ -183,7 +183,6 @@ class crm_lead(crm_case, osv.osv):
'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
'subjects': fields.function(_get_email_subject, fnct_search=_history_search, string='Subject of Email', type='char', size=64),
-
# Only used for type opportunity
'probability': fields.float('Probability (%)',group_operator="avg"),
'planned_revenue': fields.float('Expected Revenue'),
@@ -215,6 +214,19 @@ class crm_lead(crm_case, osv.osv):
'color': 0,
}
+ def get_needaction_user_ids(self, cr, uid, ids, context=None):
+ result = dict.fromkeys(ids, [])
+ for obj in self.browse(cr, uid, ids, context=context):
+ # salesman must perform an action when in draft mode
+ if obj.state == 'draft' and obj.user_id:
+ result[obj.id] = [obj.user_id.id]
+ return result
+
+ def create(self, cr, uid, vals, context=None):
+ obj_id = super(crm_lead, self).create(cr, uid, vals, context)
+ self.create_send_note(cr, uid, [obj_id], context=context)
+ return obj_id
+
def on_change_optin(self, cr, uid, ids, optin):
return {'value':{'optin':optin,'optout':False}}
@@ -248,75 +260,58 @@ class crm_lead(crm_case, osv.osv):
def stage_find_won(self, cr, uid, section_id):
return self.stage_find_percent(cr, uid, 100.0, section_id)
- def case_open(self, cr, uid, ids, *args):
- for l in self.browse(cr, uid, ids):
- # When coming from draft override date and stage otherwise just set state
- if l.state == 'draft':
- if l.type == 'lead':
- message = _("The lead '%s' has been opened.") % l.name
- elif l.type == 'opportunity':
- message = _("The opportunity '%s' has been opened.") % l.name
- else:
- message = _("The case '%s' has been opened.") % l.name
- self.log(cr, uid, l.id, message)
+ def case_open(self, cr, uid, ids, context=None):
+ for lead in self.browse(cr, uid, ids, context=context):
+ if lead.state == 'draft':
value = {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')}
- self.write(cr, uid, [l.id], value)
- if l.type == 'opportunity' and not l.stage_id:
- stage_id = self.stage_find(cr, uid, l.section_id.id or False, [('sequence','>',0)])
+ self.write(cr, uid, [lead.id], value)
+ if lead.type == 'opportunity' and not lead.stage_id:
+ stage_id = self.stage_find(cr, uid, lead.section_id.id or False, [('sequence','>',0)])
if stage_id:
- self.stage_set(cr, uid, [l.id], stage_id)
- res = super(crm_lead, self).case_open(cr, uid, ids, *args)
+ self.stage_set(cr, uid, [lead.id], stage_id)
+ res = super(crm_lead, self).case_open(cr, uid, ids, context)
return res
- def case_close(self, cr, uid, ids, *args):
- res = super(crm_lead, self).case_close(cr, uid, ids, *args)
+ def case_close(self, cr, uid, ids, context=None):
+ res = super(crm_lead, self).case_close(cr, uid, ids, context)
self.write(cr, uid, ids, {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
- for case in self.browse(cr, uid, ids):
- if case.type == 'lead':
- message = _("The lead '%s' has been closed.") % case.name
- else:
- message = _("The case '%s' has been closed.") % case.name
- self.log(cr, uid, case.id, message)
return res
- def case_cancel(self, cr, uid, ids, *args):
+ def case_cancel(self, cr, uid, ids, context=None):
"""Overrides cancel for crm_case for setting probability
"""
- res = super(crm_lead, self).case_cancel(cr, uid, ids, args)
+ res = super(crm_lead, self).case_cancel(cr, uid, ids, context)
self.write(cr, uid, ids, {'probability' : 0.0})
return res
- def case_reset(self, cr, uid, ids, *args):
+ def case_reset(self, cr, uid, ids, context=None):
"""Overrides reset as draft in order to set the stage field as empty
"""
- res = super(crm_lead, self).case_reset(cr, uid, ids, *args)
+ res = super(crm_lead, self).case_reset(cr, uid, ids, context)
self.write(cr, uid, ids, {'stage_id': False, 'probability': 0.0})
return res
- def case_mark_lost(self, cr, uid, ids, *args):
+ def case_mark_lost(self, cr, uid, ids, context=None):
"""Mark the case as lost: state = done and probability = 0%
"""
- res = super(crm_lead, self).case_close(cr, uid, ids, *args)
+ res = super(crm_lead, self).case_close(cr, uid, ids, context)
self.write(cr, uid, ids, {'probability' : 0.0})
- for l in self.browse(cr, uid, ids):
- stage_id = self.stage_find_lost(cr, uid, l.section_id.id or False)
+ for lead in self.browse(cr, uid, ids):
+ stage_id = self.stage_find_lost(cr, uid, lead.section_id.id or False)
if stage_id:
- self.stage_set(cr, uid, [l.id], stage_id)
- message = _("The opportunity '%s' has been marked as lost.") % l.name
- self.log(cr, uid, l.id, message)
+ self.stage_set(cr, uid, [lead.id], stage_id)
return res
- def case_mark_won(self, cr, uid, ids, *args):
+ def case_mark_won(self, cr, uid, ids, context=None):
"""Mark the case as lost: state = done and probability = 0%
"""
- res = super(crm_lead, self).case_close(cr, uid, ids, *args)
+ res = super(crm_lead, self).case_close(cr, uid, ids, context=None)
self.write(cr, uid, ids, {'probability' : 100.0})
- for l in self.browse(cr, uid, ids):
- stage_id = self.stage_find_won(cr, uid, l.section_id.id or False)
+ for lead in self.browse(cr, uid, ids):
+ stage_id = self.stage_find_won(cr, uid, lead.section_id.id or False)
if stage_id:
- self.stage_set(cr, uid, [l.id], stage_id)
- message = _("The opportunity '%s' has been been won.") % l.name
- self.log(cr, uid, l.id, message)
+ self.stage_set(cr, uid, [lead.id], stage_id)
+ self.case_mark_won_send_note(cr, uid, [lead.id], context=context)
return res
def set_priority(self, cr, uid, ids, priority):
@@ -324,12 +319,12 @@ class crm_lead(crm_case, osv.osv):
"""
return self.write(cr, uid, ids, {'priority' : priority})
- def set_high_priority(self, cr, uid, ids, *args):
+ def set_high_priority(self, cr, uid, ids, context=None):
"""Set lead priority to high
"""
return self.set_priority(cr, uid, ids, '1')
- def set_normal_priority(self, cr, uid, ids, *args):
+ def set_normal_priority(self, cr, uid, ids, context=None):
"""Set lead priority to normal
"""
return self.set_priority(cr, uid, ids, '3')
@@ -422,7 +417,7 @@ class crm_lead(crm_case, osv.osv):
subject = subject[0] + ", ".join(subject[1:])
details = "\n\n".join(details)
- return self.message_append(cr, uid, [opportunity_id], subject, body_text=details, context=context)
+ return self.message_append_note(cr, uid, [opportunity_id], subject=subject, body=details)
def _merge_opportunity_history(self, cr, uid, opportunity_id, opportunities, context=None):
message = self.pool.get('mail.message')
@@ -529,13 +524,6 @@ class crm_lead(crm_case, osv.osv):
'date_open': time.strftime('%Y-%m-%d %H:%M:%S'),
}
- def _convert_opportunity_notification(self, cr, uid, lead, context=None):
- success_message = _("Lead '%s' has been converted to an opportunity.") % lead.name
- self.message_append(cr, uid, [lead.id], success_message, body_text=success_message, context=context)
- self.log(cr, uid, lead.id, success_message)
- self._send_mail_to_salesman(cr, uid, lead, context=context)
- return True
-
def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_id=False, context=None):
partner = self.pool.get('res.partner')
mail_message = self.pool.get('mail.message')
@@ -551,7 +539,7 @@ class crm_lead(crm_case, osv.osv):
vals = self._convert_opportunity_data(cr, uid, lead, customer, section_id, context=context)
self.write(cr, uid, [lead.id], vals, context=context)
- self._convert_opportunity_notification(cr, uid, lead, context=context)
+ self.convert_opportunity_send_note(cr, uid, lead, context=context)
#TOCHECK: why need to change partner details in all messages of lead ?
if lead.partner_id:
msg_ids = [ x.id for x in lead.message_ids]
@@ -605,6 +593,7 @@ class crm_lead(crm_case, osv.osv):
res_partner.write(cr, uid, partner_id, {'section_id': lead.section_id.id or False})
contact_id = res_partner.address_get(cr, uid, [partner_id])['default']
res = lead.write({'partner_id' : partner_id, }, context=context)
+ self._lead_set_partner_send_note(cr, uid, [lead.id], context)
return res
def convert_partner(self, cr, uid, ids, action='create', partner_id=False, context=None):
@@ -684,12 +673,12 @@ class crm_lead(crm_case, osv.osv):
'partner_mobile' : lead.partner_id and lead.partner_id.mobile or False,
'priority': lead.priority,
}
-
new_id = phonecall.create(cr, uid, vals, context=context)
- phonecall.case_open(cr, uid, [new_id])
+ phonecall.case_open(cr, uid, [new_id], context=context)
if action == 'log':
- phonecall.case_close(cr, uid, [new_id])
+ phonecall.case_close(cr, uid, [new_id], context=context)
phonecall_dict[lead.id] = new_id
+ self.schedule_phonecall_send_note(cr, uid, [lead.id], new_id, action, context=context)
return phonecall_dict
@@ -767,7 +756,7 @@ class crm_lead(crm_case, osv.osv):
#re-open
values.update(state=crm.AVAILABLE_STATES[1][0])
if not case.date_open:
- values['date_open'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
+ values['date_open'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
res = self.write(cr, uid, [case.id], values, context=context)
return res
@@ -831,17 +820,59 @@ class crm_lead(crm_case, osv.osv):
# change probability of lead(s) if required by stage
if not vals.get('probability') and stage.on_change:
vals['probability'] = stage.probability
- text = _("Changed Stage to: %s") % stage.name
- self.message_append(cr, uid, ids, text, body_text=text, context=context)
for case in self.browse(cr, uid, ids, context=context):
- if case.type == 'lead' or context.get('stage_type') == 'lead':
- message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage.name)
- self.log(cr, uid, case.id, message)
- elif case.type == 'opportunity':
- message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage.name)
- self.log(cr, uid, case.id, message)
-
+ message = _("Stage changed to %s.") % (stage.name)
+ case.message_append_note(body=message)
return super(crm_lead,self).write(cr, uid, ids, vals, context)
+
+ # ----------------------------------------
+ # OpenChatter methods and notifications
+ # ----------------------------------------
+
+ def message_get_subscribers(self, cr, uid, ids, context=None):
+ sub_ids = self.message_get_subscribers_ids(cr, uid, ids, context=context)
+ # add salesman to the subscribers
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.user_id:
+ sub_ids.append(obj.user_id.id)
+ return self.pool.get('res.users').read(cr, uid, sub_ids, context=context)
+
+ def case_get_note_msg_prefix(self, cr, uid, lead, context=None):
+ if isinstance(lead, (int, long)):
+ lead = self.browse(cr, uid, [lead], context=context)[0]
+ return ('Opportunity' if lead.type == 'opportunity' else 'Lead')
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ for id in ids:
+ message = _("%s has been created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], body=message, context=context)
+ return True
+
+ def case_mark_lost_send_note(self, cr, uid, ids, context=None):
+ message = _("Opportunity has been lost.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def case_mark_won_send_note(self, cr, uid, ids, context=None):
+ message = _("Opportunity has been won.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def schedule_phonecall_send_note(self, cr, uid, ids, phonecall_id, action, context=None):
+ phonecall = self.pool.get('crm.phonecall').browse(cr, uid, [phonecall_id], context=context)[0]
+ if action == 'log': prefix = 'Logged'
+ else: prefix = 'Scheduled'
+ message = _("%s a call for the %s.") % (prefix, phonecall.date)
+ return self. message_append_note(cr, uid, ids, body=message, context=context)
+
+ def _lead_set_partner_send_note(self, cr, uid, ids, context=None):
+ for lead in self.browse(cr, uid, ids, context=context):
+ message = _("%s partner is now set to %s." % (self.case_get_note_msg_prefix(cr, uid, lead, context=context), lead.partner_id.name))
+ lead.message_append_note(body=message)
+ return True
+
+ def convert_opportunity_send_note(self, cr, uid, lead, context=None):
+ message = _("Lead has been converted to an opportunity.")
+ lead.message_append_note(body=message)
+ return True
crm_lead()
diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml
index e4d32cdaa13..19987f8f61a 100644
--- a/addons/crm/crm_lead_demo.xml
+++ b/addons/crm/crm_lead_demo.xml
@@ -220,21 +220,21 @@
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index a0a17e9b985..52b7c88c2d4 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -143,29 +143,6 @@
type="object" icon="gtk-convert" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -176,13 +153,6 @@
-
-
-
-
-
-
-
@@ -195,6 +165,7 @@
+
@@ -545,37 +516,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -588,6 +529,7 @@
+
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index 3b4d701590c..d3b427246e3 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -42,7 +42,7 @@ class crm_meeting(crm_base, osv.osv):
_name = 'crm.meeting'
_description = "Meeting"
_order = "id desc"
- _inherit = "calendar.event"
+ _inherit = ["calendar.event", 'ir.needaction_mixin', "mail.thread"]
_columns = {
# From crm.case
'name': fields.char('Summary', size=124, required=True, states={'done': [('readonly', True)]}),
@@ -78,7 +78,55 @@ class crm_meeting(crm_base, osv.osv):
'user_id': lambda self, cr, uid, ctx: uid,
}
- def case_open(self, cr, uid, ids, *args):
+ def create(self, cr, uid, vals, context=None):
+ obj_id = super(crm_meeting, self).create(cr, uid, vals, context=context)
+ self.create_send_note(cr, uid, [obj_id], context=context)
+ return obj_id
+
+ def get_needaction_user_ids(self, cr, uid, ids, context=None):
+ result = dict.fromkeys(ids, [])
+ for obj in self.browse(cr, uid, ids, context=context):
+ if (obj.state == 'draft' and obj.user_id):
+ result[obj.id] = [obj.user_id.id]
+ return result
+
+ def case_get_note_msg_prefix(self, cr, uid, id, context=None):
+ return 'Meeting'
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ # update context: if come from phonecall, default state values can make the message_append_note crash
+ context.pop('default_state', False)
+ for meeting in self.browse(cr, uid, ids, context=context):
+ message = _("A meeting has been scheduled on %s.") % (meeting.date)
+ if meeting.opportunity_id: # meeting can be create from phonecalls or opportunities, therefore checking for the parent
+ lead = meeting.opportunity_id
+ parent_message = _("Meeting linked to the opportunity %s has been created and cscheduled on %s.") % (lead.name, meeting.date)
+ lead.message_append_note(_('System Notification'), message)
+ elif meeting.phonecall_id:
+ phonecall = meeting.phonecall_id
+ parent_message = _("Meeting linked to the phonecall %s has been created and cscheduled on %s.") % (phonecall.name, meeting.date)
+ phonecall.message_append_note(body=message)
+ else:
+ parent_message = message
+ if parent_message:
+ meeting.message_append_note(body=parent_message)
+ return True
+
+ def case_close_send_note(self, cr, uid, ids, context=None):
+ message = _("Meeting has been done.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def case_open_send_note(self, cr, uid, ids, context=None):
+ for meeting in self.browse(cr, uid, ids, context=context):
+ if meeting.state != 'draft':
+ return False
+ message = _("Meeting has been confirmed.")
+ meeting.message_append_note(body=message)
+ return True
+
+ def case_open(self, cr, uid, ids, context=None):
"""Confirms meeting
@param self: The object pointer
@param cr: the current row, from the database cursor,
@@ -86,11 +134,9 @@ class crm_meeting(crm_base, osv.osv):
@param ids: List of Meeting Ids
@param *args: Tuple Value for additional Params
"""
- res = super(crm_meeting, self).case_open(cr, uid, ids, args)
+ res = super(crm_meeting, self).case_open(cr, uid, ids, context)
for (id, name) in self.name_get(cr, uid, ids):
- message = _("The meeting '%s' has been confirmed.") % name
id=base_calendar.base_calendar_id2real_id(id)
- self.log(cr, uid, id, message)
return res
crm_meeting()
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index d94fe9e8566..a82a34d80ce 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -212,6 +212,7 @@
+
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index c6a59d9aace..4fad3ad30ff 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -32,6 +32,7 @@ class crm_phonecall(crm_base, osv.osv):
_name = "crm.phonecall"
_description = "Phonecall"
_order = "id desc"
+ _inherit = ['ir.needaction_mixin', 'mail.thread']
_columns = {
# From crm.case
'id': fields.integer('ID', readonly=True),
@@ -47,12 +48,12 @@ class crm_phonecall(crm_base, osv.osv):
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
'state': fields.selection([
- ('draft', 'Draft'),
- ('open', 'Todo'),
- ('cancel', 'Cancelled'),
- ('done', 'Held'),
+ ('draft', 'Draft'),
+ ('open', 'Todo'),
+ ('cancel', 'Cancelled'),
+ ('done', 'Held'),
('pending', 'Not Held'),
- ], 'State', size=16, readonly=True,
+ ], 'State', size=16, readonly=True,
help='The state is set to \'Todo\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the call is over, the state is set to \'Held\'.\
@@ -67,9 +68,9 @@ class crm_phonecall(crm_base, osv.osv):
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
- 'date_closed': fields.datetime('Closed', readonly=True),
- 'date': fields.datetime('Date'),
- 'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'date': fields.datetime('Date'),
+ 'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
}
@@ -80,13 +81,20 @@ class crm_phonecall(crm_base, osv.osv):
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'priority': crm.AVAILABLE_PRIORITIES[2][0],
- 'state': _get_default_state,
+ 'priority': crm.AVAILABLE_PRIORITIES[2][0],
+ 'state': _get_default_state,
'user_id': lambda self,cr,uid,ctx: uid,
'active': 1,
}
- def case_close(self, cr, uid, ids, *args):
+ def create(self, cr, uid, vals, context=None):
+ obj_id = super(crm_phonecall, self).create(cr, uid, vals, context)
+ for phonecall in self.browse(cr, uid, [obj_id], context=context):
+ if not phonecall.opportunity_id:
+ self.case_open_send_note(cr, uid, [obj_id], context=context)
+ return obj_id
+
+ def case_close(self, cr, uid, ids, context=None):
"""Overrides close for crm_case for setting close date
"""
res = True
@@ -96,22 +104,22 @@ class crm_phonecall(crm_base, osv.osv):
if phone.duration <=0:
duration = datetime.now() - datetime.strptime(phone.date, '%Y-%m-%d %H:%M:%S')
data.update({'duration': duration.seconds/float(60)})
- res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], args)
+ res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], context)
self.write(cr, uid, [phone_id], data)
return res
- def case_reset(self, cr, uid, ids, *args):
+ def case_reset(self, cr, uid, ids, context=None):
"""Resets case as Todo
"""
- res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
+ res = super(crm_phonecall, self).case_reset(cr, uid, ids, context)
self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
return res
- def case_open(self, cr, uid, ids, *args):
+ def case_open(self, cr, uid, ids, context=None):
"""Overrides cancel for crm_case for setting Open Date
"""
- res = super(crm_phonecall, self).case_open(cr, uid, ids, *args)
+ res = super(crm_phonecall, self).case_open(cr, uid, ids, context)
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
return res
@@ -143,9 +151,7 @@ class crm_phonecall(crm_base, osv.osv):
'partner_mobile' : call.partner_mobile,
'priority': call.priority,
}
-
new_id = self.create(cr, uid, vals, context=context)
- self.case_open(cr, uid, [new_id])
if action == 'log':
self.case_close(cr, uid, [new_id])
phonecall_dict[call.id] = new_id
@@ -162,7 +168,9 @@ class crm_phonecall(crm_base, osv.osv):
return partner_id
def _call_set_partner(self, cr, uid, ids, partner_id, context=None):
- return self.write(cr, uid, ids, {'partner_id' : partner_id}, context=context)
+ write_res = self.write(cr, uid, ids, {'partner_id' : partner_id}, context=context)
+ self._call_set_partner_send_note(cr, uid, ids, context)
+ return write_res
def _call_create_partner_address(self, cr, uid, phonecall, partner_id, context=None):
address = self.pool.get('res.partner')
@@ -231,7 +239,7 @@ class crm_phonecall(crm_base, osv.osv):
'section_id': call.section_id and call.section_id.id or False,
'description': call.description or False,
'priority': call.priority,
- 'type': 'opportunity',
+ 'type': 'opportunity',
'phone': call.partner_phone or False,
'email_from': default_contact and default_contact.email,
})
@@ -243,7 +251,7 @@ class crm_phonecall(crm_base, osv.osv):
self.case_close(cr, uid, [call.id])
opportunity.case_open(cr, uid, [opportunity_id])
opportunity_dict[call.id] = opportunity_id
- return opportunity_dict
+ return opportunity_dict
def action_make_meeting(self, cr, uid, ids, context=None):
"""
@@ -289,6 +297,41 @@ class crm_phonecall(crm_base, osv.osv):
}
return value
+
+ # ----------------------------------------
+ # OpenChatter methods and notifications
+ # ----------------------------------------
+
+ def get_needaction_user_ids(self, cr, uid, ids, context=None):
+ result = dict.fromkeys(ids)
+ for obj in self.browse(cr, uid, ids, context=context):
+ result[obj.id] = []
+ if (obj.state == 'draft' and obj.user_id):
+ result[obj.id] = [obj.user_id.id]
+ return result
+
+ def case_get_note_msg_prefix(self, cr, uid, id, context=None):
+ return 'Phonecall'
+
+ def case_reset_send_note(self, cr, uid, ids, context=None):
+ message = _('Phonecall has been reset and set as open.')
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def case_open_send_note(self, cr, uid, ids, context=None):
+ lead_obj = self.pool.get('crm.lead')
+ for phonecall in self.browse(cr, uid, ids, context=context):
+ phonecall.message_subscribe([phonecall.user_id.id], context=context)
+ if phonecall.opportunity_id:
+ lead = phonecall.opportunity_id
+ message = _("Phonecall linked to the opportunity %s has been created and scheduled on %s.") % (lead.name, phonecall.date)
+ else:
+ message = _("Phonecall has been created and opened.")
+ phonecall.message_append_note(body=message)
+ return True
+
+ def _call_set_partner_send_note(self, cr, uid, ids, context=None):
+ return self.message_append_note(cr, uid, ids, body=_("Partner has been created"), context=context)
+
crm_phonecall()
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 74a6a7ec6aa..ae0e0ce7f3c 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -120,6 +120,7 @@
states="cancel" type="object"
icon="gtk-convert" />
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index 3df7b002cec..b03f25281af 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -2,7 +2,7 @@
-