diff --git a/addons/.bzrignore b/addons/.bzrignore
index 8d98f9debde..8c348710117 100644
--- a/addons/.bzrignore
+++ b/addons/.bzrignore
@@ -1 +1,2 @@
.*
+**/node_modules
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 87e6a66740c..bf1da5cb71b 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -561,10 +561,14 @@ class account_invoice(osv.osv):
def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
res = {}
+ if isinstance(ids, (int, long)):
+ ids = [ids]
if not date_invoice:
date_invoice = time.strftime('%Y-%m-%d')
if not payment_term_id:
- return {'value':{'date_due': date_invoice}} #To make sure the invoice has a due date when no payment term
+ inv = self.browse(cr, uid, ids[0])
+ #To make sure the invoice due date should contain due date which is entered by user when there is no payment term defined
+ return {'value':{'date_due': inv.date_due and inv.date_due or date_invoice}}
pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
if pterm_list:
pterm_list = [line[0] for line in pterm_list]
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 314e3423996..7f5fa9707c1 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -800,7 +800,7 @@ class account_move_line(osv.osv):
r_id = move_rec_obj.create(cr, uid, {
'type': type,
'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge)
- })
+ }, context=context)
move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context)
return True
diff --git a/addons/account/edi/invoice.py b/addons/account/edi/invoice.py
index 91913920bac..2c2a754de3b 100644
--- a/addons/account/edi/invoice.py
+++ b/addons/account/edi/invoice.py
@@ -266,7 +266,7 @@ class account_invoice(osv.osv, EDIMixin):
params = {
"cmd": "_xclick",
"business": inv.company_id.paypal_account,
- "item_name": inv.company_id.name + " Invoice " + inv.number,
+ "item_name": "%s Invoice %s" % (inv.company_id.name, inv.number or ''),
"invoice": inv.number,
"amount": inv.residual,
"currency_code": inv.currency_id.name,
diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 89d238b16e9..8ab93c2fcbb 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -25,7 +25,7 @@ from dateutil.relativedelta import relativedelta
from operator import itemgetter
from os.path import join as opj
-from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT as DF
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.translate import _
from openerp.osv import fields, osv
from openerp import tools
diff --git a/addons/account/test/account_bank_statement.yml b/addons/account/test/account_bank_statement.yml
index 3711cff4d56..28828e0e3ea 100644
--- a/addons/account/test/account_bank_statement.yml
+++ b/addons/account/test/account_bank_statement.yml
@@ -67,9 +67,10 @@
Then I cancel Bank Statements and verifies that it raises a warning
-
!python {model: account.bank.statement}: |
+ from openerp.osv import osv
try:
self.button_cancel(cr, uid, [ref("account_bank_statement_0")])
assert False, "An exception should have been raised, the journal should not let us cancel moves!"
- except Exception:
+ except osv.except_osv:
# exception was raised as expected, as the journal does not allow cancelling moves
pass
diff --git a/addons/account/test/account_supplier_invoice.yml b/addons/account/test/account_supplier_invoice.yml
index 02c3d367050..2232b8dc00e 100644
--- a/addons/account/test/account_supplier_invoice.yml
+++ b/addons/account/test/account_supplier_invoice.yml
@@ -73,14 +73,16 @@
I cancel the account move which is in posted state and verifies that it gives warning message
-
!python {model: account.move}: |
+ from openerp.osv import osv
inv_obj = self.pool.get('account.invoice')
inv = inv_obj.browse(cr, uid, ref('account_invoice_supplier0'))
try:
mov_cancel = self.button_cancel(cr, uid, [inv.move_id.id], {'lang': u'en_US', 'tz': False,
'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')],
'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')})
- except Exception, e:
- assert e, 'Warning message has not been raised'
+ assert False, "This should never happen!"
+ except osv.except_osv:
+ pass
-
I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values
-
diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml
index 77ebf02570f..be1d710c09d 100644
--- a/addons/account/wizard/account_report_aged_partner_balance_view.xml
+++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml
@@ -11,7 +11,8 @@
-
+
+
diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py
index 871aea9e4d9..b8dc562f3a0 100644
--- a/addons/account/wizard/account_report_common.py
+++ b/addons/account/wizard/account_report_common.py
@@ -34,7 +34,10 @@ class account_common_report(osv.osv_memory):
res = {}
if chart_account_id:
company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id
- res['value'] = {'company_id': company_id}
+ now = time.strftime('%Y-%m-%d')
+ domain = [('company_id', '=', company_id), ('date_start', '<', now), ('date_stop', '>', now)]
+ fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1)
+ res['value'] = {'company_id': company_id, 'fiscalyear_id': fiscalyears and fiscalyears[0] or False}
return res
_columns = {
@@ -124,10 +127,11 @@ class account_common_report(osv.osv_memory):
now = time.strftime('%Y-%m-%d')
company_id = False
ids = context.get('active_ids', [])
- domain = [('date_start', '<', now), ('date_stop', '>', now)]
if ids and context.get('active_model') == 'account.account':
company_id = self.pool.get('account.account').browse(cr, uid, ids[0], context=context).company_id.id
- domain += [('company_id', '=', company_id)]
+ else: # use current company id
+ company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
+ domain = [('company_id', '=', company_id), ('date_start', '<', now), ('date_stop', '>', now)]
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1)
return fiscalyears and fiscalyears[0] or False
diff --git a/addons/account_accountant/i18n/ja.po b/addons/account_accountant/i18n/ja.po
index 9e2208e06cd..1da9c374c7f 100644
--- a/addons/account_accountant/i18n/ja.po
+++ b/addons/account_accountant/i18n/ja.po
@@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
-"PO-Revision-Date: 2012-04-13 22:35+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2013-07-30 22:25+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: 2013-03-16 05:47+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
#. module: account_accountant
#: model:ir.actions.client,name:account_accountant.action_client_account_menu
msgid "Open Accounting Menu"
-msgstr ""
+msgstr "会計メニューを開く"
#~ msgid ""
#~ "\n"
diff --git a/addons/account_bank_statement_extensions/i18n/ru.po b/addons/account_bank_statement_extensions/i18n/ru.po
new file mode 100644
index 00000000000..61b054e7563
--- /dev/null
+++ b/addons/account_bank_statement_extensions/i18n/ru.po
@@ -0,0 +1,361 @@
+# Russian 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-08-05 10:40+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Russian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-08-06 04:47+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
+
+#. module: account_bank_statement_extensions
+#: help:account.bank.statement.line.global,name:0
+msgid "Originator to Beneficiary Information"
+msgstr "Информация от плательщика получателю"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+#: selection:account.bank.statement.line,state:0
+msgid "Confirmed"
+msgstr "Подтверждено"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement:0
+#: view:account.bank.statement.line:0
+msgid "Glob. Id"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: selection:account.bank.statement.line.global,type:0
+msgid "CODA"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,parent_id:0
+msgid "Parent Code"
+msgstr "Основной код"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Debit"
+msgstr "Дебет"
+
+#. module: account_bank_statement_extensions
+#: view:cancel.statement.line:0
+#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_cancel_statement_line
+#: model:ir.model,name:account_bank_statement_extensions.model_cancel_statement_line
+msgid "Cancel selected statement lines"
+msgstr "Отмена выбранных позиций выписки"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,val_date:0
+msgid "Value Date"
+msgstr "Дата зачисления"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Group By..."
+msgstr "Группировать по ..."
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+#: selection:account.bank.statement.line,state:0
+msgid "Draft"
+msgstr "Черновик"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Statement"
+msgstr "Выписка"
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_confirm_statement_line
+#: model:ir.model,name:account_bank_statement_extensions.model_confirm_statement_line
+msgid "Confirm selected statement lines"
+msgstr "Подтверждение выбранных позиций выписки"
+
+#. module: account_bank_statement_extensions
+#: report:bank.statement.balance.report:0
+#: model:ir.actions.report.xml,name:account_bank_statement_extensions.bank_statement_balance_report
+msgid "Bank Statement Balances Report"
+msgstr "Отчет об остатках банковской выписки"
+
+#. module: account_bank_statement_extensions
+#: view:cancel.statement.line:0
+msgid "Cancel Lines"
+msgstr "Отменить позиции"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line.global:0
+#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line_global
+msgid "Batch Payment Info"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,state:0
+msgid "Status"
+msgstr "Статус"
+
+#. module: account_bank_statement_extensions
+#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129
+#, python-format
+msgid ""
+"Delete operation not allowed. Please go to the associated bank "
+"statement in order to delete and/or modify bank statement line."
+msgstr ""
+"Операция удаления запрещена. Пожалуйста, обратитесь к соответствующей "
+"банковской выписке для удаления/изменения позиции."
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+msgid "or"
+msgstr "или"
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+msgid "Confirm Lines"
+msgstr "Подтвердить позиции"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line.global:0
+msgid "Transactions"
+msgstr "Операции"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,type:0
+msgid "Type"
+msgstr "Тип"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+#: report:bank.statement.balance.report:0
+msgid "Journal"
+msgstr "Журнал"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Confirmed Statement Lines."
+msgstr "Подтвержденные позиции выписки."
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Credit Transactions."
+msgstr "Операции по кредиту"
+
+#. module: account_bank_statement_extensions
+#: model:ir.actions.act_window,help:account_bank_statement_extensions.action_cancel_statement_line
+msgid "cancel selected statement lines."
+msgstr "отменить выбранные позиции выписки"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,counterparty_number:0
+msgid "Counterparty Number"
+msgstr "Число контрагентов"
+
+#. module: account_bank_statement_extensions
+#: report:bank.statement.balance.report:0
+msgid "Closing Balance"
+msgstr "Итоговый баланс"
+
+#. module: account_bank_statement_extensions
+#: report:bank.statement.balance.report:0
+msgid "Date"
+msgstr "Дата"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+#: field:account.bank.statement.line,globalisation_amount:0
+msgid "Glob. Amount"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Debit Transactions."
+msgstr "Операции по дебету"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Extended Filters..."
+msgstr "Расширенные фильтры..."
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+msgid "Confirmed lines cannot be changed anymore."
+msgstr "Нельзя изменить подтвержденные позиции."
+
+#. module: account_bank_statement_extensions
+#: view:cancel.statement.line:0
+msgid "Are you sure you want to cancel the selected Bank Statement lines ?"
+msgstr ""
+"Вы уверены, что хотите отменить выбранные позиции банковской выписки ?"
+
+#. module: account_bank_statement_extensions
+#: report:bank.statement.balance.report:0
+msgid "Name"
+msgstr "Название"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,name:0
+msgid "OBI"
+msgstr "Назначение"
+
+#. module: account_bank_statement_extensions
+#: selection:account.bank.statement.line.global,type:0
+msgid "ISO 20022"
+msgstr "ISO 20022"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Notes"
+msgstr "Примечания"
+
+#. module: account_bank_statement_extensions
+#: selection:account.bank.statement.line.global,type:0
+msgid "Manual"
+msgstr "Ручной"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Bank Transaction"
+msgstr "Банковские операции"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Credit"
+msgstr "Кредит"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,amount:0
+msgid "Amount"
+msgstr "Сумма"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Fin.Account"
+msgstr "Фин. Счет"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,counterparty_currency:0
+msgid "Counterparty Currency"
+msgstr "Валюта контрагента"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,counterparty_bic:0
+msgid "Counterparty BIC"
+msgstr "БИК контрагента"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,child_ids:0
+msgid "Child Codes"
+msgstr "Субкоды"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Search Bank Transactions"
+msgstr "Поиск банковских операций"
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+msgid "Are you sure you want to confirm the selected Bank Statement lines ?"
+msgstr ""
+"Вы уверены, что хотите, подтвердить выбранные позиции банковской выписки ?"
+
+#. module: account_bank_statement_extensions
+#: help:account.bank.statement.line,globalisation_id:0
+msgid ""
+"Code to identify transactions belonging to the same globalisation level "
+"within a batch payment"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Draft Statement Lines."
+msgstr "Черновики позиций выписки."
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Glob. Am."
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line
+msgid "Bank Statement Line"
+msgstr "Позиция банковской выписки"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,code:0
+msgid "Code"
+msgstr "Код"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,counterparty_name:0
+msgid "Counterparty Name"
+msgstr "Название контрагента"
+
+#. module: account_bank_statement_extensions
+#: model:ir.model,name:account_bank_statement_extensions.model_res_partner_bank
+msgid "Bank Accounts"
+msgstr "Банковские счета"
+
+#. module: account_bank_statement_extensions
+#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement
+msgid "Bank Statement"
+msgstr "Банковская выписка"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Statement Line"
+msgstr "Позиция выписки"
+
+#. module: account_bank_statement_extensions
+#: sql_constraint:account.bank.statement.line.global:0
+msgid "The code must be unique !"
+msgstr "Код должен быть уникальным !"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line.global,bank_statement_line_ids:0
+#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_bank_statement_line
+#: model:ir.ui.menu,name:account_bank_statement_extensions.bank_statement_line
+msgid "Bank Statement Lines"
+msgstr "Позиции банковской выписки"
+
+#. module: account_bank_statement_extensions
+#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129
+#, python-format
+msgid "Warning!"
+msgstr "Внимание!"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line.global:0
+msgid "Child Batch Payments"
+msgstr ""
+
+#. module: account_bank_statement_extensions
+#: view:confirm.statement.line:0
+msgid "Cancel"
+msgstr "Отмена"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Statement Lines"
+msgstr "Позиции выписки"
+
+#. module: account_bank_statement_extensions
+#: view:account.bank.statement.line:0
+msgid "Total Amount"
+msgstr "Итоговая сумма"
+
+#. module: account_bank_statement_extensions
+#: field:account.bank.statement.line,globalisation_id:0
+msgid "Globalisation ID"
+msgstr ""
diff --git a/addons/account_budget/i18n/ja.po b/addons/account_budget/i18n/ja.po
index f69a34b9a82..4dd1ba0298f 100644
--- a/addons/account_budget/i18n/ja.po
+++ b/addons/account_budget/i18n/ja.po
@@ -8,14 +8,14 @@ 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: 2012-06-13 17:16+0000\n"
-"Last-Translator: Akira Hiyama \n"
+"PO-Revision-Date: 2013-07-30 22:29+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: 2013-03-16 05:34+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
#. module: account_budget
#: view:account.budget.analytic:0
@@ -418,7 +418,7 @@ msgstr "からの分析"
#. module: account_budget
#: view:crossovered.budget:0
msgid "Draft Budgets"
-msgstr "ドラフト予算"
+msgstr "予算案"
#, python-format
#~ msgid "The General Budget '%s' has no Accounts!"
diff --git a/addons/account_cancel/i18n/uk.po b/addons/account_cancel/i18n/uk.po
new file mode 100644
index 00000000000..5fbae627883
--- /dev/null
+++ b/addons/account_cancel/i18n/uk.po
@@ -0,0 +1,23 @@
+# Ukrainian 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-08-01 11:11+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Ukrainian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-08-02 05:38+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
+
+#. module: account_cancel
+#: view:account.invoice:0
+msgid "Cancel"
+msgstr ""
diff --git a/addons/account_check_writing/i18n/bs.po b/addons/account_check_writing/i18n/bs.po
new file mode 100644
index 00000000000..252798b016f
--- /dev/null
+++ b/addons/account_check_writing/i18n/bs.po
@@ -0,0 +1,246 @@
+# Bosnian 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-08-08 22:05+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Bosnian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-08-09 05:06+0000\n"
+"X-Generator: Launchpad (build 16723)\n"
+
+#. module: account_check_writing
+#: selection:res.company,check_layout:0
+msgid "Check on Top"
+msgstr "Ček na vrhu"
+
+#. module: account_check_writing
+#: report:account.print.check.top:0
+msgid "Open Balance"
+msgstr "Otvoreno saldo"
+
+#. module: account_check_writing
+#: view:account.check.write:0
+#: view:account.voucher:0
+msgid "Print Check"
+msgstr "Štampaj ček"
+
+#. module: account_check_writing
+#: selection:res.company,check_layout:0
+msgid "Check in middle"
+msgstr "Ćek u sredini"
+
+#. module: account_check_writing
+#: help:res.company,check_layout:0
+msgid ""
+"Check on top is compatible with Quicken, QuickBooks and Microsoft Money. "
+"Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on "
+"bottom is compatible with Peachtree, ACCPAC and DacEasy only"
+msgstr ""
+"Ček na vrhu je kompatibilan sa Quicken, QuickBooks i Microsoft Money. Ček u "
+"sredini je kompatibilan sa Peachtree, ACCPAC i DacEasy. Ček na dnu je "
+"kompatibilan sa Peachtree, ACCPAC i DacEasy samo"
+
+#. module: account_check_writing
+#: selection:res.company,check_layout:0
+msgid "Check on bottom"
+msgstr "Ćek na dnu"
+
+#. module: account_check_writing
+#: model:ir.actions.act_window,name:account_check_writing.action_account_check_write
+msgid "Print Check in Batch"
+msgstr "Štampaj čekove grupno"
+
+#. module: account_check_writing
+#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59
+#, python-format
+msgid "One of the printed check already got a number."
+msgstr "Jedan od odštampanih čekova je već dobio broj."
+
+#. module: account_check_writing
+#: help:account.journal,allow_check_writing:0
+msgid "Check this if the journal is to be used for writing checks."
+msgstr ""
+"Označite ovo ako će se za pisanje čekova koristiti dnevnik knjiženja."
+
+#. module: account_check_writing
+#: field:account.journal,allow_check_writing:0
+msgid "Allow Check writing"
+msgstr "Dozvoli pisanje čekova"
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Description"
+msgstr "Opis"
+
+#. module: account_check_writing
+#: model:ir.model,name:account_check_writing.model_account_journal
+msgid "Journal"
+msgstr "Dnevnik knjiženja"
+
+#. module: account_check_writing
+#: model:ir.actions.act_window,name:account_check_writing.action_write_check
+#: model:ir.ui.menu,name:account_check_writing.menu_action_write_check
+msgid "Write Checks"
+msgstr "Piši čekove"
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Discount"
+msgstr "Popust"
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Original Amount"
+msgstr "Originalni iznos"
+
+#. module: account_check_writing
+#: field:res.company,check_layout:0
+msgid "Check Layout"
+msgstr "Raspored čeka"
+
+#. module: account_check_writing
+#: field:account.voucher,allow_check:0
+msgid "Allow Check Writing"
+msgstr "Dozvoli pisanje čeka"
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Payment"
+msgstr "Plaćanje"
+
+#. module: account_check_writing
+#: field:account.journal,use_preprint_check:0
+msgid "Use Preprinted Check"
+msgstr "Koristi pred-odštampane čekove"
+
+#. module: account_check_writing
+#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom
+msgid "Print Check (Bottom)"
+msgstr "Štampaj ček (donji)"
+
+#. module: account_check_writing
+#: model:ir.actions.act_window,help:account_check_writing.action_write_check
+msgid ""
+"
\n"
+" Click to create a new check. \n"
+"
\n"
+" The check payment form allows you to track the payment you "
+"do\n"
+" to your suppliers using checks. When you select a supplier, "
+"the\n"
+" payment method and an amount for the payment, OpenERP will\n"
+" propose to reconcile your payment with the open supplier\n"
+" invoices or bills.\n"
+"
\n"
+" "
+msgstr ""
+"
\n"
+" Kliknite da kreirate nove čekove. \n"
+"
\n"
+" Forma plaćanje čekom omogućava vam da pratite plaćanja koja "
+"izvršavate\n"
+" vašim dobavljačima koristeći čekove. Kada odaberete "
+"dobavljača,\n"
+" metodu plaćanja i iznos za plaćanje, OpenERP će predložiti "
+"da izravna\n"
+" vašu uplatu sa otvorenom fakturom ili računom dobavljača.\n"
+"
\n"
+" "
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Due Date"
+msgstr "Datum dospijeća"
+
+#. module: account_check_writing
+#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle
+msgid "Print Check (Middle)"
+msgstr "Štampaj ček (srednji)"
+
+#. module: account_check_writing
+#: model:ir.model,name:account_check_writing.model_res_company
+msgid "Companies"
+msgstr "Kompanije"
+
+#. module: account_check_writing
+#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59
+#, python-format
+msgid "Error!"
+msgstr "Greška!"
+
+#. module: account_check_writing
+#: help:account.check.write,check_number:0
+msgid "The number of the next check number to be printed."
+msgstr "Broj sljedećeg čeka za štampanje."
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+msgid "Balance Due"
+msgstr "Saldo valute"
+
+#. module: account_check_writing
+#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top
+msgid "Print Check (Top)"
+msgstr "Štampaj ček (na vrhu)"
+
+#. module: account_check_writing
+#: report:account.print.check.bottom:0
+#: report:account.print.check.middle:0
+#: report:account.print.check.top:0
+msgid "Check Amount"
+msgstr "Iznos čeka"
+
+#. module: account_check_writing
+#: model:ir.model,name:account_check_writing.model_account_voucher
+msgid "Accounting Voucher"
+msgstr "Računovodstveni vaučer"
+
+#. module: account_check_writing
+#: view:account.check.write:0
+msgid "or"
+msgstr "ili"
+
+#. module: account_check_writing
+#: field:account.voucher,amount_in_word:0
+msgid "Amount in Word"
+msgstr "Pisani iznos"
+
+#. module: account_check_writing
+#: model:ir.model,name:account_check_writing.model_account_check_write
+msgid "Prin Check in Batch"
+msgstr "Štampaj čekove grupno"
+
+#. module: account_check_writing
+#: view:account.check.write:0
+msgid "Cancel"
+msgstr "Otkaži"
+
+#. module: account_check_writing
+#: field:account.check.write,check_number:0
+msgid "Next Check Number"
+msgstr "Sljedeći broj čeka"
+
+#. module: account_check_writing
+#: view:account.check.write:0
+msgid "Check"
+msgstr "Ček"
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 81eb76ff3a8..597ed01aa1b 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -31,10 +31,10 @@ from openerp.report import report_sxw
class res_currency(osv.osv):
_inherit = "res.currency"
- def _get_current_rate(self, cr, uid, ids, name, arg, context=None):
+ def _get_current_rate(self, cr, uid, ids, raise_on_no_rate=True, context=None):
if context is None:
context = {}
- res = super(res_currency, self)._get_current_rate(cr, uid, ids, name, arg, context=context)
+ res = super(res_currency, self)._get_current_rate(cr, uid, ids, raise_on_no_rate, context=context)
if context.get('voucher_special_currency') in ids and context.get('voucher_special_currency_rate'):
res[context.get('voucher_special_currency')] = context.get('voucher_special_currency_rate')
return res
@@ -932,6 +932,8 @@ class account_voucher(osv.osv):
move_pool = self.pool.get('account.move')
for voucher in self.browse(cr, uid, ids, context=context):
+ # refresh to make sure you don't unlink an already removed move
+ voucher.refresh()
recs = []
for line in voucher.move_ids:
if line.reconcile_id:
@@ -1182,7 +1184,7 @@ class account_voucher(osv.osv):
for line in voucher.line_ids:
#create one move line per voucher line where amount is not 0.0
# AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value)
- if not line.amount and not (line.move_line_id and not float_compare(line.move_line_id.debit, line.move_line_id.credit, precision_rounding=prec) and not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)):
+ if not line.amount and not (line.move_line_id and not float_compare(line.move_line_id.debit, line.move_line_id.credit, precision_digits=prec) and not float_compare(line.move_line_id.debit, 0.0, precision_digits=prec)):
continue
# convert the amount set on the voucher line into the currency of the voucher's company
# this calls res_curreny.compute() with the right context, so that it will take either the rate on the voucher if it is relevant or will use the default behaviour
@@ -1282,10 +1284,8 @@ class account_voucher(osv.osv):
}
new_id = move_line_obj.create(cr, uid, move_line_foreign_currency, context=context)
rec_ids.append(new_id)
-
if line.move_line_id.id:
rec_lst_ids.append(rec_ids)
-
return (tot_line, rec_lst_ids)
def writeoff_move_line_get(self, cr, uid, voucher_id, line_total, move_id, name, company_currency, current_currency, context=None):
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index dea94d59f4e..5d259772363 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -332,14 +332,15 @@
-
+
+ attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
+ groups="analytic.group_analytic_accounting"
+ attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
@@ -494,14 +495,15 @@
-
+
+ attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
+ groups="analytic.group_analytic_accounting"
+ attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
diff --git a/addons/auth_crypt/auth_crypt.py b/addons/auth_crypt/auth_crypt.py
index d0a4fda9632..4651d27fe7d 100644
--- a/addons/auth_crypt/auth_crypt.py
+++ b/addons/auth_crypt/auth_crypt.py
@@ -120,7 +120,7 @@ class res_users(osv.osv):
def set_pw(self, cr, uid, id, name, value, args, context):
if value:
encrypted = md5crypt(value, gen_salt())
- cr.execute('update res_users set password_crypt=%s where id=%s', (encrypted, int(id)))
+ cr.execute("update res_users set password='', password_crypt=%s where id=%s", (encrypted, id))
del value
def get_pw( self, cr, uid, ids, name, args, context ):
@@ -143,7 +143,7 @@ class res_users(osv.osv):
cr.execute('SELECT password, password_crypt FROM res_users WHERE id=%s AND active', (uid,))
if cr.rowcount:
stored_password, stored_password_crypt = cr.fetchone()
- if password and not stored_password_crypt:
+ if stored_password and not stored_password_crypt:
salt = gen_salt()
stored_password_crypt = md5crypt(stored_password, salt)
cr.execute("UPDATE res_users SET password='', password_crypt=%s WHERE id=%s", (stored_password_crypt, uid))
@@ -151,14 +151,15 @@ class res_users(osv.osv):
return super(res_users, self).check_credentials(cr, uid, password)
except openerp.exceptions.AccessDenied:
# check md5crypt
- if stored_password_crypt[:len(magic_md5)] == magic_md5:
- salt = stored_password_crypt[len(magic_md5):11]
- if stored_password_crypt == md5crypt(password, salt):
- return
- elif stored_password_crypt[:len(magic_md5)] == magic_sha256:
- salt = stored_password_crypt[len(magic_md5):11]
- if stored_password_crypt == md5crypt(password, salt):
- return
+ if stored_password_crypt:
+ if stored_password_crypt[:len(magic_md5)] == magic_md5:
+ salt = stored_password_crypt[len(magic_md5):11]
+ if stored_password_crypt == md5crypt(password, salt):
+ return
+ elif stored_password_crypt[:len(magic_md5)] == magic_sha256:
+ salt = stored_password_crypt[len(magic_md5):11]
+ if stored_password_crypt == md5crypt(password, salt):
+ return
# Reraise password incorrect
raise
diff --git a/addons/auth_ldap/__openerp__.py b/addons/auth_ldap/__openerp__.py
index 844f6d9fa84..945dad5e3d2 100644
--- a/addons/auth_ldap/__openerp__.py
+++ b/addons/auth_ldap/__openerp__.py
@@ -92,11 +92,6 @@ allows pre-setting the default groups and menus of the first-time users.
user with the same login (and a blank password), then rename this new
user to a username that does not exist in LDAP, and setup its groups
the way you want.
-
-Interaction with base_crypt:
-----------------------------
-The base_crypt module is not compatible with this module, and will disable LDAP
-authentication if installed at the same time.
""",
'website' : 'http://www.openerp.com',
'category' : 'Authentication',
diff --git a/addons/auth_ldap/users_ldap.py b/addons/auth_ldap/users_ldap.py
index 8e7128ca91e..1e957a184c3 100644
--- a/addons/auth_ldap/users_ldap.py
+++ b/addons/auth_ldap/users_ldap.py
@@ -26,6 +26,7 @@ import openerp.exceptions
from openerp import tools
from openerp.osv import fields, osv
from openerp import SUPERUSER_ID
+from openerp.modules.registry import RegistryManager
_logger = logging.getLogger(__name__)
class CompanyLDAP(osv.osv):
@@ -190,9 +191,9 @@ class CompanyLDAP(osv.osv):
user_obj = self.pool['res.users']
values = self.map_ldap_attributes(cr, uid, conf, login, ldap_entry)
if conf['user']:
+ values['active'] = True
user_id = user_obj.copy(cr, SUPERUSER_ID, conf['user'],
- default={'active': True})
- user_obj.write(cr, SUPERUSER_ID, user_id, values)
+ default=values)
else:
user_id = user_obj.create(cr, SUPERUSER_ID, values)
return user_id
@@ -243,41 +244,31 @@ class users(osv.osv):
user_id = super(users, self).login(db, login, password)
if user_id:
return user_id
- cr = self.pool.db.cursor()
- ldap_obj = self.pool['res.company.ldap']
- for conf in ldap_obj.get_ldap_dicts(cr):
- entry = ldap_obj.authenticate(conf, login, password)
- if entry:
- user_id = ldap_obj.get_or_create_user(
- cr, SUPERUSER_ID, conf, login, entry)
- if user_id:
- cr.execute("""UPDATE res_users
- SET login_date=now() AT TIME ZONE 'UTC'
- WHERE login=%s""",
- (tools.ustr(login),))
- cr.commit()
- break
- cr.close()
- return user_id
-
- def check(self, db, uid, passwd):
- try:
- return super(users,self).check(db, uid, passwd)
- except openerp.exceptions.AccessDenied:
- pass
-
- cr = self.pool.db.cursor()
- cr.execute('SELECT login FROM res_users WHERE id=%s AND active=TRUE',
- (int(uid),))
- res = cr.fetchone()
- if res:
- ldap_obj = self.pool['res.company.ldap']
+ registry = RegistryManager.get(db)
+ with registry.cursor() as cr:
+ ldap_obj = registry.get('res.company.ldap')
for conf in ldap_obj.get_ldap_dicts(cr):
- if ldap_obj.authenticate(conf, res[0], passwd):
- self._uid_cache.setdefault(db, {})[uid] = passwd
- cr.close()
- return True
- cr.close()
- raise openerp.exceptions.AccessDenied()
+ entry = ldap_obj.authenticate(conf, login, password)
+ if entry:
+ user_id = ldap_obj.get_or_create_user(
+ cr, SUPERUSER_ID, conf, login, entry)
+ if user_id:
+ break
+ return user_id
+
+ def check_credentials(self, cr, uid, password):
+ try:
+ super(users, self).check_credentials(cr, uid, password)
+ except openerp.exceptions.AccessDenied:
+
+ cr.execute('SELECT login FROM res_users WHERE id=%s AND active=TRUE',
+ (int(uid),))
+ res = cr.fetchone()
+ if res:
+ ldap_obj = self.pool['res.company.ldap']
+ for conf in ldap_obj.get_ldap_dicts(cr):
+ if ldap_obj.authenticate(conf, res[0], password):
+ return
+ raise
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js
index 131ae5c1c42..5046469a5dc 100644
--- a/addons/auth_oauth/static/src/js/auth_oauth.js
+++ b/addons/auth_oauth/static/src/js/auth_oauth.js
@@ -1,4 +1,6 @@
openerp.auth_oauth = function(instance) {
+ var _t = instance.web._t,
+ _lt = instance.web._lt;
var QWeb = instance.web.qweb;
instance.web.Login.include({
@@ -9,9 +11,11 @@ openerp.auth_oauth = function(instance) {
this.$el.on('click', 'a.zocial', this.on_oauth_sign_in);
this.oauth_providers = [];
if(this.params.oauth_error === 1) {
- this.do_warn("Sign up error.","Sign up is not allowed on this database.");
+ this.do_warn(_t("Sign up error"),_t("Sign up is not allowed on this database."), true);
} else if(this.params.oauth_error === 2) {
- this.do_warn("Authentication error","");
+ this.do_warn(_t("Authentication error"),_t("Access Denied"), true);
+ } else if(this.params.oauth_error === 3) {
+ this.do_warn(_t("Authentication error"),_t("You do not have access to this database or your invitation has expired. Please ask for an invitation and be sure to follow the link in your invitation email."), true);
}
return d.done(this.do_oauth_load).fail(function() {
self.do_oauth_load([]);
diff --git a/addons/auth_oauth_signup/res_users.py b/addons/auth_oauth_signup/res_users.py
index 5eebc02fe04..a06968fa46f 100644
--- a/addons/auth_oauth_signup/res_users.py
+++ b/addons/auth_oauth_signup/res_users.py
@@ -23,6 +23,7 @@ import logging
import simplejson
import openerp
+from openerp.addons.auth_signup.res_users import SignupError
from openerp.osv import osv, fields
_logger = logging.getLogger(__name__)
@@ -35,7 +36,7 @@ class res_users(osv.Model):
try:
login = super(res_users, self)._auth_oauth_signin(cr, uid, provider, validation, params, context=context)
- except openerp.exceptions.AccessDenied:
+ except openerp.exceptions.AccessDenied, access_denied_exception:
if context and context.get('no_user_creation'):
return None
state = simplejson.loads(params['state'])
@@ -52,6 +53,8 @@ class res_users(osv.Model):
'oauth_access_token': params['access_token'],
'active': True,
}
- _, login, _ = self.signup(cr, uid, values, token, context=context)
-
+ try:
+ _, login, _ = self.signup(cr, uid, values, token, context=context)
+ except SignupError:
+ raise access_denied_exception
return login
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index 891837f8813..38beb087c7a 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -26,7 +26,7 @@ from urlparse import urljoin
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
-from openerp.tools.safe_eval import safe_eval
+from ast import literal_eval
from openerp.tools.translate import _
class SignupError(Exception):
@@ -221,12 +221,12 @@ class res_users(osv.Model):
def _signup_create_user(self, cr, uid, values, context=None):
""" create a new user from the template user """
ir_config_parameter = self.pool.get('ir.config_parameter')
- template_user_id = safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.template_user_id', 'False'))
+ template_user_id = literal_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.template_user_id', 'False'))
assert template_user_id and self.exists(cr, uid, template_user_id, context=context), 'Signup: invalid template user'
# check that uninvited users may sign up
if 'partner_id' not in values:
- if not safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')):
+ if not literal_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')):
raise SignupError('Signup is not allowed for uninvited users')
assert values.get('login'), "Signup: no login given for new user"
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index a9061c0afce..64b6f01d05c 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -1187,8 +1187,8 @@ rule or repeating pattern of time to exclude from the recurring rule."),
context = {}
result = []
- for data in super(calendar_event, self).read(cr, uid, select, ['rrule', 'exdate', 'exrule', 'date'], context=context):
- if not data['rrule']:
+ for data in super(calendar_event, self).read(cr, uid, select, ['rrule', 'recurrency', 'exdate', 'exrule', 'date'], context=context):
+ if not data['recurrency'] or not data['rrule']:
result.append(data['id'])
continue
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py
index a12becdc68c..669c8b8fb84 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py
@@ -1,7 +1,7 @@
#########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
-# Copyright (C) 2004-2010 OpenERP SA ().
+# Copyright (C) 2004-2013 OpenERP SA ().
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -78,7 +78,7 @@ class ExportToRML( unohelper.Base, XJobExecutor ):
res = self.sock.execute(database, uid, self.password, 'ir.actions.report.xml', 'sxwtorml',base64.encodestring(data),file_type)
if res['report_rml_content']:
- write_data_to_file( get_absolute_file_path( filename[7:] ), res['report_rml_content'] )
+ write_data_to_file(get_absolute_file_path(filename), res['report_rml_content'])
except Exception,e:
import traceback,sys
info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
@@ -99,8 +99,12 @@ class ExportToRML( unohelper.Base, XJobExecutor ):
oFileDialog.setDefaultName(f_path )
- sPath = oFileDialog.execute() == 1 and oFileDialog.Files[0] or None
+ sPath = oFileDialog.execute() == 1 and oFileDialog.Files[0] or ''
oFileDialog.dispose()
+ sPath = sPath[7:]
+ if sPath.startswith('localhost/'):
+ slash = int(os.name == 'nt')
+ sPath = sPath[9 + slash:]
return sPath
if __name__<>"package" and __name__=="__main__":
diff --git a/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip
index 238f9d19671..2fc61fbf679 100644
Binary files a/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip and b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip differ
diff --git a/addons/base_status/__init__.py b/addons/base_status/__init__.py
index e4107f90a37..ea9d738e614 100644
--- a/addons/base_status/__init__.py
+++ b/addons/base_status/__init__.py
@@ -20,6 +20,5 @@
##############################################################################
import base_state
-import base_stage
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_status/__openerp__.py b/addons/base_status/__openerp__.py
index 79b6dd2016c..b3936ec10cb 100644
--- a/addons/base_status/__openerp__.py
+++ b/addons/base_status/__openerp__.py
@@ -24,11 +24,10 @@
'version': '1.0',
'category': 'Hidden',
'description': """
-This module handles state and stage. It is derived from the crm_base and crm_case classes from crm.
-===================================================================================================
+This module handles state. It is derived from the crm_base and crm_case classes from crm.
+==========================================================================================
* ``base_state``: state management
- * ``base_stage``: stage management
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
diff --git a/addons/base_status/base_stage.py b/addons/base_status/base_stage.py
deleted file mode 100644
index edf9db166af..00000000000
--- a/addons/base_status/base_stage.py
+++ /dev/null
@@ -1,264 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from openerp.osv import fields, osv
-from openerp.tools.translate import _
-
-class base_stage(object):
- """ Base utility mixin class for objects willing to manage their stages.
- Object that inherit from this class should inherit from mailgate.thread
- to have access to the mail gateway, as well as Chatter. Objects
- subclassing this class should define the following colums:
- - ``date_open`` (datetime field)
- - ``date_closed`` (datetime field)
- - ``user_id`` (many2one to res.users)
- - ``partner_id`` (many2one to res.partner)
- - ``stage_id`` (many2one to a stage definition model)
- - ``state`` (selection field, related to the stage_id.state)
- """
-
- def _get_default_partner(self, cr, uid, context=None):
- """ Gives id of partner for current user
- :param context: if portal not in context returns False
- """
- if context is None:
- context = {}
- if context.get('portal'):
- user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- return user.partner_id.id
- return False
-
- def _get_default_email(self, cr, uid, context=None):
- """ Gives default email address for current user
- :param context: if portal not in context returns False
- """
- if context is None:
- context = {}
- if context.get('portal'):
- user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- return user.email
- return False
-
- def _get_default_user(self, cr, uid, context=None):
- """ Gives current user id
- :param context: if portal not in context returns False
- """
- if context is None:
- context = {}
- if not context or context.get('portal'):
- return False
- return uid
-
- def onchange_partner_address_id(self, cr, uid, ids, add, email=False, context=None):
- """ This function returns value of partner email based on Partner Address
- :param add: Id of Partner's address
- :param email: Partner's email ID
- """
- data = {'value': {'email_from': False, 'phone':False}}
- if add:
- address = self.pool.get('res.partner').browse(cr, uid, add)
- data['value'] = {'partner_name': address and address.name or False,
- 'email_from': address and address.email or False,
- 'phone': address and address.phone or False,
- 'street': address and address.street or False,
- 'street2': address and address.street2 or False,
- 'city': address and address.city or False,
- 'state_id': address.state_id and address.state_id.id or False,
- 'zip': address and address.zip or False,
- 'country_id': address.country_id and address.country_id.id or False,
- }
- fields = self.fields_get(cr, uid, context=context or {})
- for key in data['value'].keys():
- if key not in fields:
- del data['value'][key]
- return data
-
- def onchange_partner_id(self, cr, uid, ids, part, email=False):
- """ This function returns value of partner address based on partner
- :param part: Partner's id
- :param email: Partner's email ID
- """
- data={}
- if part:
- addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
- data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
- return {'value': data}
-
- def _get_default_section_id(self, cr, uid, context=None):
- """ Gives default section """
- return False
-
- def _get_default_stage_id(self, cr, uid, context=None):
- """ Gives default stage_id """
- return self.stage_find(cr, uid, [], None, [('state', '=', 'draft')], context=context)
-
- def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
- """ Find stage, with a given (optional) domain on the search,
- ordered by the order parameter. If several stages match the
- search criterions, the first one will be returned, according
- to the requested search order.
- This method is meant to be overriden by subclasses. That way
- specific behaviors can be achieved for every class inheriting
- from base_stage.
-
- :param cases: browse_record of cases
- :param section_id: section limitating the search, given for
- a generic search (for example default search).
- A section models concepts such as Sales team
- (for CRM), ou departments (for HR).
- :param domain: a domain on the search of stages
- :param order: order of the search
- """
- return False
-
- def stage_set_with_state_name(self, cr, uid, cases, state_name, context=None):
- """ Set a new stage, with a state_name instead of a stage_id
- :param cases: browse_record of cases
- """
- if isinstance(cases, (int, long)):
- cases = self.browse(cr, uid, cases, context=context)
- for case in cases:
- stage_id = self.stage_find(cr, uid, [case], None, [('state', '=', state_name)], context=context)
- if stage_id:
- self.stage_set(cr, uid, [case.id], stage_id, context=context)
- return True
-
- def stage_set(self, cr, uid, ids, stage_id, context=None):
- """ Set the new stage. This methods is the right method to call
- when changing states. It also checks whether an onchange is
- defined, and execute it.
- """
- value = {}
- if hasattr(self, 'onchange_stage_id'):
- value = self.onchange_stage_id(cr, uid, ids, stage_id, context=context)['value']
- value['stage_id'] = stage_id
- return self.write(cr, uid, ids, value, context=context)
-
- def stage_change(self, cr, uid, ids, op, order, context=None):
- """ Change the stage and take the next one, based on a condition
- writen for the 'sequence' field and an operator. This methods
- checks whether the case has a current stage, and takes its
- sequence. Otherwise, a default 0 sequence is chosen and this
- method will therefore choose the first available stage.
- For example if op is '>' and current stage has a sequence of
- 10, this will call stage_find, with [('sequence', '>', '10')].
- """
- for case in self.browse(cr, uid, ids, context=context):
- seq = 0
- if case.stage_id:
- seq = case.stage_id.sequence or 0
- section_id = None
- next_stage_id = self.stage_find(cr, uid, [case], None, [('sequence', op, seq)],order, context=context)
- if next_stage_id:
- return self.stage_set(cr, uid, [case.id], next_stage_id, context=context)
- return False
-
- def stage_next(self, cr, uid, ids, context=None):
- """ This function computes next stage for case from its current stage
- using available stage for that case type
- """
- return self.stage_change(cr, uid, ids, '>','sequence', context)
-
- def stage_previous(self, cr, uid, ids, context=None):
- """ This function computes previous stage for case from its current
- stage using available stage for that case type
- """
- return self.stage_change(cr, uid, ids, '<', 'sequence desc', context)
-
- def copy(self, cr, uid, id, default=None, context=None):
- """ Overrides orm copy method to avoid copying messages,
- as well as date_closed and date_open columns if they
- exist."""
- if default is None:
- default = {}
-
- if hasattr(self, '_columns'):
- if self._columns.get('date_closed'):
- default.update({ 'date_closed': False, })
- if self._columns.get('date_open'):
- default.update({ 'date_open': False })
- return super(base_stage, self).copy(cr, uid, id, default, context=context)
-
- 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 case_open(self, cr, uid, ids, context=None):
- """ Opens case """
- cases = self.browse(cr, uid, ids, context=context)
- for case in cases:
- data = {'active': True}
- if not case.user_id:
- data['user_id'] = uid
- self.case_set(cr, uid, [case.id], 'open', data, context=context)
- return True
-
- def case_close(self, cr, uid, ids, context=None):
- """ Closes case """
- return self.case_set(cr, uid, ids, 'done', {'active': True, 'date_closed': fields.datetime.now()}, context=context)
-
- def case_cancel(self, cr, uid, ids, context=None):
- """ Cancels case """
- return self.case_set(cr, uid, ids, 'cancel', {'active': True}, context=context)
-
- def case_pending(self, cr, uid, ids, context=None):
- """ Set case as pending """
- return self.case_set(cr, uid, ids, 'pending', {'active': True}, context=context)
-
- def case_reset(self, cr, uid, ids, context=None):
- """ Resets case as draft """
- return self.case_set(cr, uid, ids, 'draft', {'active': True}, context=context)
-
- def case_set(self, cr, uid, ids, new_state_name=None, values_to_update=None, new_stage_id=None, context=None):
- """ Generic method for setting case. This methods wraps the update
- of the record.
-
- :params new_state_name: the new state of the record; this method
- will call ``stage_set_with_state_name``
- that will find the stage matching the
- new state, using the ``stage_find`` method.
- :params new_stage_id: alternatively, you may directly give the
- new stage of the record
- :params state_name: the new value of the state, such as
- 'draft' or 'close'.
- :params update_values: values that will be added with the state
- update when writing values to the record.
- """
- cases = self.browse(cr, uid, ids, context=context)
- # 1. update the stage
- if new_state_name:
- self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context)
- elif not (new_stage_id is None):
- self.stage_set(cr, uid, ids, new_stage_id, context=context)
- # 2. update values
- if values_to_update:
- self.write(cr, uid, ids, values_to_update, context=context)
- return True
diff --git a/addons/base_status/i18n/bs.po b/addons/base_status/i18n/bs.po
new file mode 100644
index 00000000000..0fdd8821dd2
--- /dev/null
+++ b/addons/base_status/i18n/bs.po
@@ -0,0 +1,80 @@
+# Bosnian 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-08-08 22:20+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Bosnian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-08-09 05:06+0000\n"
+"X-Generator: Launchpad (build 16723)\n"
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:107
+#, python-format
+msgid "Error !"
+msgstr "Greška !"
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:166
+#, python-format
+msgid "%s has been opened."
+msgstr "%s je bio otvoren."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:199
+#, python-format
+msgid "%s has been renewed."
+msgstr "%s je bio obnovljen."
+
+#. module: base_status
+#: code:addons/base_status/base_stage.py:210
+#, python-format
+msgid "Error!"
+msgstr "Greška!"
+
+#. 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 ""
+"Ne možete eskalirati, već ste na najvišem nivou u odnosu na kategoriju "
+"prodajnog tima."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:193
+#, python-format
+msgid "%s is now pending."
+msgstr "%s je sad Na čekanju."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:187
+#, python-format
+msgid "%s has been canceled."
+msgstr "%s je bio otkazan."
+
+#. 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 ""
+"Već ste na najvišem nivou vaše kategorije prodajnog tima.\n"
+"Zato ne možete dalje eskalirati."
+
+#. module: base_status
+#: code:addons/base_status/base_state.py:181
+#, python-format
+msgid "%s has been closed."
+msgstr "%s je bio zatvoren."
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index 4f50d2281fe..65737ad234e 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -381,6 +381,10 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
_.each(data.contexts, context.add, context);
_.each(data.domains, domain.add, domain);
+ context.add({
+ group_by: instance.web.pyeval.eval('groupbys', data.groupbys || [])
+ });
+
var c = instance.web.pyeval.eval('context', context);
for(var k in c) {
if (c.hasOwnProperty(k) && /^search_default_/.test(k)) {
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index e7ab7df27ea..3e6b55006fa 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -116,6 +116,7 @@ Dashboard for CRM will include:
'test/crm_lead_onchange.yml',
'test/crm_lead_copy.yml',
'test/crm_lead_unlink.yml',
+ 'test/crm_lead_find_stage.yml',
],
'css': [
'static/src/css/crm.css'
diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml
index 19baa5a5709..6bbd450ca38 100644
--- a/addons/crm/board_crm_view.xml
+++ b/addons/crm/board_crm_view.xml
@@ -19,7 +19,11 @@
formgraph,tree,form
- [('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]
+
+ ['|',
+ '!', '&', ('probability', '=', 100), ('stage_id.on_change', '=', 1),
+ '!', '&', ('probability', '=', 0), ('stage_id.sequence', '!=', 1),
+ ('type', '=', 'opportunity')]{'search_default_Stage':1}
@@ -43,8 +47,9 @@
formgraph,tree,form
- [('state','!=','cancel'),('opening_date','>',context_today().strftime("%Y-%m-%d"))]
- {'search_default_Stage':1}
+
+ ['!', '&', ('probability', '=', 0), ('stage_id.sequence', '!=', 1)]
+ {'search_default_user': 1, 'search_default_Stage': 1}
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index d1194508b71..04a17b9dbc0 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -26,15 +26,6 @@ from openerp import tools
from openerp.osv import fields
from openerp.osv import osv
-MAX_LEVEL = 15
-AVAILABLE_STATES = [
- ('draft', 'New'),
- ('cancel', 'Cancelled'),
- ('open', 'In Progress'),
- ('pending', 'Pending'),
- ('done', 'Closed')
-]
-
AVAILABLE_PRIORITIES = [
('1', 'Highest'),
('2', 'High'),
@@ -72,16 +63,13 @@ class crm_case_stage(osv.osv):
'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"),
'on_change': fields.boolean('Change Probability Automatically', help="Setting this stage will change the probability automatically on the opportunity."),
'requirements': fields.text('Requirements'),
- 'section_ids':fields.many2many('crm.case.section', 'section_stage_rel', 'stage_id', 'section_id', string='Sections',
+ 'section_ids': fields.many2many('crm.case.section', 'section_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(AVAILABLE_STATES, 'Related Status', required=True,
- help="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 is automatically closed."),
'case_default': fields.boolean('Default to New Sales Team',
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('Fold by Default',
help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
- 'type': fields.selection([ ('lead','Lead'),
+ 'type': fields.selection([('lead', 'Lead'),
('opportunity', 'Opportunity'),
('both', 'Both')],
string='Type', size=16, required=True,
@@ -91,7 +79,7 @@ class crm_case_stage(osv.osv):
_defaults = {
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
- 'state': 'open',
+ 'on_change': True,
'fold': False,
'type': 'both',
'case_default': True,
diff --git a/addons/crm/crm_action_rule_demo.xml b/addons/crm/crm_action_rule_demo.xml
index 569b2d676e0..8eac91c06e2 100644
--- a/addons/crm/crm_action_rule_demo.xml
+++ b/addons/crm/crm_action_rule_demo.xml
@@ -5,7 +5,7 @@
Draft Leadscrm.lead
- [('state','=','draft')]
+ [('stage_id.sequence', '=', 1)]
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 4c4122cd819..11204044a66 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -22,14 +22,13 @@
import crm
from datetime import datetime
from operator import itemgetter
-from openerp.osv import fields, osv, orm
-import time
+
from openerp import SUPERUSER_ID
from openerp import tools
-from openerp.tools.translate import _
-from openerp.tools import html2plaintext
-
from openerp.addons.base.res.res_partner import format_address
+from openerp.osv import fields, osv, orm
+from openerp.tools import html2plaintext
+from openerp.tools.translate import _
CRM_LEAD_FIELDS_TO_MERGE = ['name',
'partner_id',
@@ -61,11 +60,7 @@ CRM_LEAD_FIELDS_TO_MERGE = ['name',
'email_from',
'email_cc',
'partner_name']
-CRM_LEAD_PENDING_STATES = (
- crm.AVAILABLE_STATES[2][0], # Cancelled
- crm.AVAILABLE_STATES[3][0], # Done
- crm.AVAILABLE_STATES[4][0], # Pending
-)
+
class crm_lead(format_address, osv.osv):
""" CRM Lead Case """
@@ -75,13 +70,11 @@ class crm_lead(format_address, osv.osv):
_inherit = ['mail.thread', 'ir.needaction_mixin']
_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',
- },
'stage_id': {
- 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj.state not in ['new', 'draft', 'cancel', 'done'],
+ 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence == 1,
+ 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: (obj.stage_id and obj.stage_id.sequence != 1) and obj.probability < 100,
+ 'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.probability == 100 and obj.stage_id and obj.stage_id.on_change,
+ 'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence != 1,
},
}
@@ -99,7 +92,7 @@ class crm_lead(format_address, osv.osv):
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)
+ return self.stage_find(cr, uid, [], section_id, [('sequence', '=', '1')], context=context)
def _resolve_section_id_from_context(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
@@ -150,7 +143,7 @@ class crm_lead(format_address, osv.osv):
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
# restore order of the search
- result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
+ result.sort(lambda x, y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
fold = {}
for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context):
@@ -158,7 +151,7 @@ class crm_lead(format_address, osv.osv):
return result, fold
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- res = super(crm_lead,self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
+ res = super(crm_lead, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if view_type == 'form':
res['arch'] = self.fields_view_get_address(cr, user, res['arch'], context=context)
return res
@@ -220,17 +213,6 @@ class crm_lead(format_address, osv.osv):
res[lead.id][field] = abs(int(duration))
return res
- def _history_search(self, cr, uid, obj, name, args, context=None):
- res = []
- msg_obj = self.pool.get('mail.message')
- message_ids = msg_obj.search(cr, uid, [('email_from','!=',False), ('subject', args[0][1], args[0][2])], context=context)
- lead_ids = self.search(cr, uid, [('message_ids', 'in', message_ids)], context=context)
-
- if lead_ids:
- return [('id', 'in', lead_ids)]
- else:
- return [('id', '=', '0')]
-
_columns = {
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
select=True, help="Linked partner (optional). Usually created when converting the lead."),
@@ -243,10 +225,10 @@ class crm_lead(format_address, osv.osv):
'email_from': fields.char('Email', size=128, help="Email address of the contact", select=1),
'section_id': fields.many2one('crm.case.section', 'Sales Team',
select=True, track_visibility='onchange', help='When sending mails, the default email address is taken from the sales team.'),
- 'create_date': fields.datetime('Creation Date' , readonly=True),
- 'email_cc': fields.text('Global CC', size=252 , help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
+ 'create_date': fields.datetime('Creation Date', readonly=True),
+ 'email_cc': fields.text('Global CC', help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'description': fields.text('Notes'),
- 'write_date': fields.datetime('Update Date' , readonly=True),
+ 'write_date': fields.datetime('Update Date', readonly=True),
'categ_ids': fields.many2many('crm.case.categ', 'crm_lead_category_rel', 'lead_id', 'category_id', 'Categories', \
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \
@@ -264,17 +246,15 @@ class crm_lead(format_address, osv.osv):
domain="['&', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"),
'user_id': fields.many2one('res.users', 'Salesperson', select=True, track_visibility='onchange'),
'referred': fields.char('Referred By', size=64),
- 'date_open': fields.datetime('Opened', readonly=True),
+ 'date_open': fields.datetime('Assigned', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
multi='day_close', type="float", store=True),
- 'state': fields.related('stage_id', 'state', type="selection", store=True,
- selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
- help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
+ 'date_last_stage_update': fields.datetime('Last Stage Update', select=True),
# Only used for type opportunity
- 'probability': fields.float('Success Rate (%)',group_operator="avg"),
+ 'probability': fields.float('Success Rate (%)', group_operator="avg"),
'planned_revenue': fields.float('Expected Revenue', track_visibility='always'),
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
@@ -316,6 +296,7 @@ class crm_lead(format_address, osv.osv):
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'color': 0,
+ 'date_last_stage_update': fields.datetime.now(),
}
_sql_constraints = [
@@ -325,7 +306,7 @@ class crm_lead(format_address, osv.osv):
def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
if not stage_id:
return {'value': {}}
- stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context)
+ stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context=context)
if not stage.on_change:
return {'value': {}}
return {'value': {'probability': stage.probability}}
@@ -358,22 +339,6 @@ class crm_lead(format_address, osv.osv):
section_id = section_ids[0]
return {'value': {'section_id': section_id}}
- def _check(self, cr, uid, ids=False, context=None):
- """ Override of the base.stage method.
- Function called by the scheduler to process cases for date actions
- Only works on not done and cancelled cases
- """
- cr.execute('select * from crm_case \
- where (date_action_last<%s or date_action_last is null) \
- and (date_action_next<=%s or date_action_next is null) \
- and state not in (\'cancel\',\'done\')',
- (time.strftime("%Y-%m-%d %H:%M:%S"),
- time.strftime('%Y-%m-%d %H:%M:%S')))
-
- ids2 = map(lambda x: x[0], cr.fetchall() or [])
- cases = self.browse(cr, uid, ids2, context=context)
- return self._action(cr, uid, cases, False, context=context)
-
def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None):
""" Override of the base.stage method
Parameter of the stage search taken from the lead:
@@ -385,16 +350,16 @@ class crm_lead(format_address, osv.osv):
if isinstance(cases, (int, long)):
cases = self.browse(cr, uid, cases, context=context)
# collect all section_ids
- section_ids = []
+ section_ids = set()
types = ['both']
if not cases:
- type = context.get('default_type')
- types += [type]
+ ctx_type = context.get('default_type')
+ types += [ctx_type]
if section_id:
- section_ids.append(section_id)
+ section_ids.add(section_id)
for lead in cases:
if lead.section_id:
- section_ids.append(lead.section_id.id)
+ section_ids.add(lead.section_id.id)
if lead.type not in types:
types.append(lead.type)
# OR all section_ids and OR with case_default
@@ -403,8 +368,7 @@ class crm_lead(format_address, osv.osv):
search_domain += [('|')] * len(section_ids)
for section_id in section_ids:
search_domain.append(('section_ids', '=', section_id))
- else:
- search_domain.append(('case_default', '=', True))
+ search_domain.append(('case_default', '=', True))
# AND with cases types
search_domain.append(('type', 'in', types))
# AND with the domain in parameter
@@ -415,27 +379,29 @@ class crm_lead(format_address, osv.osv):
return stage_ids[0]
return False
- 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)
+ stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 0.0), ('on_change', '=', True), ('sequence', '>', 1)], context=context)
if stage_id:
- self.stage_set(cr, uid, [lead.id], stage_id, context=context)
- return True
+ return self.write(cr, uid, [lead.id], {'stage_id': stage_id}, context=context)
+ else:
+ raise osv.except_osv(_('Warning!'),
+ _('To relieve your sales pipe and group all Lost opportunities, configure one of your sales stage as follow:\n'
+ 'probability = 0 %, select "Change Probability Automatically".\n'
+ 'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
def case_mark_won(self, cr, uid, ids, context=None):
""" Mark the case as won: state=done and probability=100 """
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)
+ stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0), ('on_change', '=', True), ('sequence', '>', 1)], context=context)
if stage_id:
- self.stage_set(cr, uid, [lead.id], stage_id, context=context)
- return True
+ return self.write(cr, uid, [lead.id], {'stage_id': stage_id}, context=context)
+ else:
+ raise osv.except_osv(_('Warning!'),
+ _('To relieve your sales pipe and group all Won opportunities, configure one of your sales stage as follow:\n'
+ 'probability = 100 % and select "Change Probability Automatically".\n'
+ 'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
def case_escalate(self, cr, uid, ids, context=None):
""" Escalates case to parent level """
@@ -451,20 +417,20 @@ class crm_lead(format_address, osv.osv):
self.write(cr, uid, [case.id], data, context=context)
return True
- def set_priority(self, cr, uid, ids, priority):
+ def set_priority(self, cr, uid, ids, priority, context=None):
""" Set lead priority
"""
- return self.write(cr, uid, ids, {'priority' : priority})
+ return self.write(cr, uid, ids, {'priority': priority}, context=context)
def set_high_priority(self, cr, uid, ids, context=None):
""" Set lead priority to high
"""
- return self.set_priority(cr, uid, ids, '1')
+ return self.set_priority(cr, uid, ids, '1', context=context)
def set_normal_priority(self, cr, uid, ids, context=None):
""" Set lead priority to normal
"""
- return self.set_priority(cr, uid, ids, '3')
+ return self.set_priority(cr, uid, ids, '3', context=context)
def _merge_get_result_type(self, cr, uid, opps, context=None):
"""
@@ -640,7 +606,8 @@ class crm_lead(format_address, osv.osv):
sequenced_opps = []
for opportunity in opportunities:
sequence = -1
- if opportunity.stage_id and opportunity.stage_id.state != 'cancel':
+ # TDE: was "if opportunity.stage_id and opportunity.stage_id.state != 'cancel':"
+ if opportunity.probability == 0 and opportunity.stage_id and opportunity.stage_id.sequence != 1 and opportunity.stage_id.fold:
sequence = opportunity.stage_id.sequence
sequenced_opps.append(((int(sequence != -1 and opportunity.type == 'opportunity'), sequence, -opportunity.id), opportunity))
@@ -701,7 +668,7 @@ class crm_lead(format_address, osv.osv):
'phone': customer and customer.phone or lead.phone,
}
if not lead.stage_id or lead.stage_id.type=='lead':
- val['stage_id'] = self.stage_find(cr, uid, [lead], section_id, [('state', '=', 'draft'),('type', 'in', ('opportunity','both'))], context=context)
+ val['stage_id'] = self.stage_find(cr, uid, [lead], section_id, [('sequence', '=', '1'), ('type', 'in', ('opportunity','both'))], context=context)
return val
def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_id=False, context=None):
@@ -710,7 +677,8 @@ class crm_lead(format_address, osv.osv):
partner = self.pool.get('res.partner')
customer = partner.browse(cr, uid, partner_id, context=context)
for lead in self.browse(cr, uid, ids, context=context):
- if lead.state in ('done', 'cancel'):
+ # TDE: was if lead.state in ('done', 'cancel'):
+ if (lead.probability == '100') or (lead.probability == '0' and lead.stage_id.sequence != '1'):
continue
vals = self._convert_opportunity_data(cr, uid, lead, customer, section_id, context=context)
self.write(cr, uid, [lead.id], vals, context=context)
@@ -940,6 +908,10 @@ class crm_lead(format_address, osv.osv):
return super(crm_lead, self).create(cr, uid, vals, context=create_context)
def write(self, cr, uid, ids, vals, context=None):
+ # stage change: update date_last_stage_update
+ if 'stage_id' in vals:
+ vals['date_last_stage_update'] = fields.datetime.now()
+ # stage change with new stage: update probability
if vals.get('stage_id') and not vals.get('probability'):
onchange_stage_values = self.onchange_stage_id(cr, uid, ids, vals.get('stage_id'), context=context)['value']
vals.update(onchange_stage_values)
diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml
index 219ff2cdeee..3c299fef704 100644
--- a/addons/crm/crm_lead_data.xml
+++ b/addons/crm/crm_lead_data.xml
@@ -5,71 +5,57 @@
New
-
- draft
-
-
+ 1
+ 0
+ 1
+ 1both
- Opportunity
-
- open
-
-
- lead
-
- Dead
-
-
- cancel
-
-
+ 1
+ 0
+ 1
+ 30leadQualification
-
- open
-
-
+ 1
+ 20
+ 1
+ 40opportunityProposition
-
- open
-
-
+ 1
+ 40
+ 50opportunityNegotiation
-
- open
-
-
+ 1
+ 60
+ 60opportunityWon
-
-
- done
-
-
-
+ 1
+ 100
+ 1
+ 70opportunity
-
+ Lost
-
-
-
- cancel
-
-
+ 1
+ 1
+ 0
+ 1
+ 80opportunity
@@ -77,7 +63,7 @@
+ (4, ref('stage_lead7'))]"/>
@@ -161,7 +147,7 @@
Lead Createdcrm.lead
- Opportunity created
+ Lead createdStage Changed
diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml
index 3917fadbd32..dab17888d7a 100644
--- a/addons/crm/crm_lead_demo.xml
+++ b/addons/crm/crm_lead_demo.xml
@@ -6,9 +6,9 @@
leadPlan to Attend a Training
- Jason Dunagan
+ Jacques DunaganLe Club SARL
- jason@leclub.fr
+ jdunagan@leclub.frTraining Manager73, rue Léon Dierx
@@ -20,14 +20,25 @@
1
-
+ Hello,
-I am Jason from Le Club SARL.
-I am intertested to attend a training organized in your company.
-Can you send me the details ?
-
+I am Jacques from Le Club SARL.
+I am interested to attend a training organized in your company.
+Could you please send me the details ?
+
+
+
+
+
+ Inquiry
+ crm.lead
+
+ Hello,
+ I am Jacques from Le Club SARL. I am interested to attend a training organized in your company.
+ Can you send me the details ?
]]>
+ email
@@ -44,10 +55,20 @@ Can you send me the details ?
4
-
+
-
+
+
+
+
+
+ Need Details
+ crm.lead
+
+
+ Want to know features and benefits to use the new software.
+ comment
@@ -65,8 +86,10 @@ Can you send me the details ?
2
-
-
+
+
+
+
@@ -82,10 +105,12 @@ Can you send me the details ?
3
-
-
-
-
+
+
+
+
+
+
@@ -105,8 +130,8 @@ Can you send me the details ?
3
-
-
+
+ Hi,
Can you send me a quotation for 20 computers with speakers?
@@ -116,7 +141,6 @@ Purchase Manager
Stonage IT,
Franklinville
Contact: +1 813 494 5005
-
@@ -134,9 +158,8 @@ Contact: +1 813 494 5005
3
-
+
-
@@ -153,9 +176,8 @@ Contact: +1 813 494 5005
5
-
-
-
+
+
@@ -173,9 +195,8 @@ Contact: +1 813 494 5005
4
-
-
-
+
+
@@ -193,12 +214,8 @@ Contact: +1 813 494 5005
2
-
+
-
-
-
-
@@ -215,14 +232,13 @@ Contact: +1 813 494 5005
2
-
+ Hi,
I would like to know more about specification and cost of laptops of your company.
Thanks,
Andrew
-
@@ -239,9 +255,8 @@ Andrew
3
-
+
-
@@ -258,15 +273,23 @@ Andrew
2
-
-
-
+
+
+
+
+
@@ -289,8 +312,7 @@ Andrew
Meeting for pricing information.
-
-
+
@@ -316,7 +338,6 @@ Andrew
-
@@ -337,10 +358,12 @@ Andrew
Call to ask system requirement
-
-
+
+
+
+ opportunity
@@ -362,8 +385,7 @@ Andrew
Convert to quote
-
-
+
@@ -388,10 +410,12 @@ Andrew
Send price list regarding our interventions
-
-
+
+
+
+ opportunity
@@ -413,9 +437,12 @@ Andrew
Call to define real needs about training
-
+
+
+
+ opportunity
@@ -437,8 +464,7 @@ Andrew
Ask for the good receprion of the proposition
-
-
+
@@ -455,8 +481,7 @@ Andrew
2
-
-
+
@@ -470,8 +495,7 @@ Andrew
3
-
-
+
@@ -489,8 +513,7 @@ Andrew
3
-
-
+
@@ -505,8 +528,7 @@ Andrew
5
-
-
+
@@ -525,8 +547,7 @@ Andrew
-
-
+
@@ -549,8 +570,7 @@ Andrew
Conf call with technical service
-
-
+
@@ -574,21 +594,10 @@ Andrew
Send Catalogue by Email
-
-
-
+
+
-
-
-
-
-
-
-
-
-
- bWlncmF0aW9uIHRlc3Q=
@@ -682,26 +691,9 @@ Andrew
-
- Inquiry
- crm.lead
-
- Hello,
- I am Jason from Le Club SARL. I am interested to attend a training organized in your company.
- Can you send me the details ?]]>
- email
-
-
- Need Details
- crm.lead
-
- Want to know features and benefits to use the new software.
- comment
-
-
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index aa5aac76b9d..849cecaac85 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -12,9 +12,10 @@
crm.case.stage
-
-
+
+
+
@@ -94,7 +95,8 @@