diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 43aaa2f58c1..a380a69dc03 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -99,7 +99,6 @@ for a particular financial year and for preparation of vouchers there is a modul
'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
- 'partner_view.xml',
'data/account_data.xml',
'data/data_account_type.xml',
'data/configurable_account_chart.xml',
@@ -112,6 +111,7 @@ for a particular financial year and for preparation of vouchers there is a modul
'project/wizard/account_analytic_journal_report_view.xml',
'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
'project/wizard/account_analytic_chart_view.xml',
+ 'partner_view.xml',
'product_view.xml',
'account_assert_test.xml',
'process/statement_process.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index 9b9878e6cb9..f06f5a6186a 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1669,7 +1669,7 @@ class account_move_reconcile(osv.osv):
elif reconcile.line_partial_ids:
first_partner = reconcile.line_partial_ids[0].partner_id.id
move_lines = reconcile.line_partial_ids
- if any([line.partner_id.id != first_partner for line in move_lines]):
+ if any([(line.account_id.type in ('receivable', 'payable') and line.partner_id.id != first_partner) for line in move_lines]):
return False
return True
diff --git a/addons/account/account_financial_report_data.xml b/addons/account/account_financial_report_data.xml
index 6410a5e887c..e8ff33151c3 100644
--- a/addons/account/account_financial_report_data.xml
+++ b/addons/account/account_financial_report_data.xml
@@ -6,16 +6,19 @@
-->
Profit and Loss
+ sumIncome
+ detail_with_hierarchyaccount_typeExpense
+ detail_with_hierarchyaccount_type
diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml
index 58e824a6250..b03babc63ac 100644
--- a/addons/account/account_installer.xml
+++ b/addons/account/account_installer.xml
@@ -20,10 +20,11 @@
+
-
+
-
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index c47cf70b673..ab6ad97b180 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -635,6 +635,26 @@ class account_invoice(osv.osv):
self.create_workflow(cr, uid, ids)
return True
+ # ----------------------------------------
+ # Mail related methods
+ # ----------------------------------------
+
+ def _get_formview_action(self, cr, uid, id, context=None):
+ """ Update form view id of action to open the invoice """
+ action = super(account_invoice, self)._get_formview_action(cr, uid, id, context=context)
+ obj = self.browse(cr, uid, id, context=context)
+ if obj.type == 'in_invoice':
+ model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_supplier_form')
+ action.update({
+ 'views': [(view_id, 'form')],
+ })
+ else:
+ model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form')
+ action.update({
+ 'views': [(view_id, 'form')],
+ })
+ return action
+
# Workflow stuff
#################
@@ -722,7 +742,7 @@ class account_invoice(osv.osv):
inv = self.browse(cr, uid, id)
cur_obj = self.pool.get('res.currency')
- company_currency = inv.company_id.currency_id.id
+ company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id.id
if inv.type in ('out_invoice', 'in_refund'):
sign = 1
else:
@@ -769,6 +789,7 @@ class account_invoice(osv.osv):
return move_lines
def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
+ company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id
if not inv.tax_line:
for tax in compute_taxes.values():
ait_obj.create(cr, uid, tax)
@@ -782,7 +803,7 @@ class account_invoice(osv.osv):
if not key in compute_taxes:
raise osv.except_osv(_('Warning!'), _('Global taxes defined, but they are not in invoice lines !'))
base = compute_taxes[key]['base']
- if abs(base - tax.base) > inv.company_id.currency_id.rounding:
+ if abs(base - tax.base) > company_currency.rounding:
raise osv.except_osv(_('Warning!'), _('Tax base different!\nClick on compute to update the tax base.'))
for key in compute_taxes:
if not key in tax_key:
@@ -869,7 +890,7 @@ class account_invoice(osv.osv):
ctx.update({'lang': inv.partner_id.lang})
if not inv.date_invoice:
self.write(cr, uid, [inv.id], {'date_invoice': fields.date.context_today(self,cr,uid,context=context)}, context=ctx)
- company_currency = inv.company_id.currency_id.id
+ company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id.id
# create the analytical lines
# one move line per invoice line
iml = self._get_analytic_lines(cr, uid, inv.id, context=ctx)
@@ -985,7 +1006,8 @@ class account_invoice(osv.osv):
'line_id': line,
'journal_id': journal_id,
'date': date,
- 'narration':inv.comment
+ 'narration': inv.comment,
+ 'company_id': inv.company_id.id,
}
period_id = inv.period_id and inv.period_id.id or False
ctx.update(company_id=inv.company_id.id)
@@ -1438,6 +1460,7 @@ class account_invoice_line(osv.osv):
result = {}
res = self.pool.get('product.product').browse(cr, uid, product, context=context)
+ result['name'] = res.partner_ref
if type in ('out_invoice','out_refund'):
a = res.property_account_income.id
if not a:
@@ -1452,19 +1475,21 @@ class account_invoice_line(osv.osv):
if type in ('out_invoice', 'out_refund'):
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
+ if res.description_sale:
+ result['name'] += '\n'+res.description_sale
else:
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
+ if res.description_purchase:
+ result['name'] += '\n'+res.description_purchase
+
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
if type in ('in_invoice', 'in_refund'):
result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )
else:
result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
- result['name'] = res.partner_ref
result['uos_id'] = uom_id or res.uom_id.id
- if res.description:
- result['name'] += '\n'+res.description
domain = {'uos_id':[('category_id','=',res.uom_id.category_id.id)]}
@@ -1517,8 +1542,7 @@ class account_invoice_line(osv.osv):
if context is None:
context = {}
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
- company_currency = inv.company_id.currency_id.id
-
+ company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id.id
for line in inv.invoice_line:
mres = self.move_line_get_item(cr, uid, line, context)
if not mres:
@@ -1662,8 +1686,7 @@ class account_invoice_tax(osv.osv):
cur_obj = self.pool.get('res.currency')
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
cur = inv.currency_id
- company_currency = inv.company_id.currency_id.id
-
+ company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id.id
for line in inv.invoice_line:
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, line.product_id, inv.partner_id)['taxes']:
val={}
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 006e2c55f5f..d6c25364784 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -626,7 +626,7 @@ class account_move_line(osv.osv):
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
(_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']),
(_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']),
- (_check_currency_amount, 'The amount expressed in the secondary currency must be positif when journal item are debit and negatif when journal item are credit.', ['amount_currency']),
+ (_check_currency_amount, 'The amount expressed in the secondary currency must be positive when the journal item is a debit and negative when if it is a credit.', ['amount_currency']),
(_check_currency_company, "You cannot provide a secondary currency if it is the same than the company one." , ['currency_id']),
]
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index aab63cb6e50..d381559fc64 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2109,10 +2109,8 @@
-
-
-
+
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index ce9a09def08..3940c1e5357 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -313,8 +313,8 @@
TSAJsale
-
-
+
+
@@ -323,8 +323,8 @@
TSCNJsale_refund
-
-
+
+
@@ -334,8 +334,8 @@
TEXJpurchase
-
-
+
+
@@ -344,8 +344,8 @@
TECNJpurchase_refund
-
-
+
+
@@ -355,8 +355,8 @@
TBNKbank
-
-
+
+
@@ -365,8 +365,8 @@
TCHKbank
-
-
+
+
@@ -374,9 +374,9 @@
Cash Journal - (test)TCSHcash
-
-
-
+
+
+
-
-
+
+
@@ -403,8 +403,8 @@
TOEJsituation
-
-
+
+
@@ -413,8 +413,8 @@
USD Bank Journal - (test)TUBKbank
-
-
+
+ formtree,form
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py
index 498cb1369a8..4f712ad58cc 100644
--- a/addons/account/report/account_general_ledger.py
+++ b/addons/account/report/account_general_ledger.py
@@ -23,7 +23,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
##############################################################################
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 799b9b1c9fb..d8dc45f9a3b 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -99,12 +99,13 @@ class account_invoice_report(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual': fields.float('Total Residual', readonly=True),
'user_currency_residual': fields.function(_compute_amounts_in_user_currency, string="Total Residual", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
+ 'country_id': fields.many2one('res.country', 'Country of the Partner Company'),
}
_order = 'date desc'
def _select(self):
select_str = """
- SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id,
+ SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id, sub.country_id,
sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
@@ -172,7 +173,8 @@ class account_invoice_report(osv.osv):
WHERE a.id = ai.id)
ELSE 1::bigint
END::numeric AS residual,
- ai.commercial_partner_id as commercial_partner_id
+ ai.commercial_partner_id as commercial_partner_id,
+ partner.country_id
"""
return select_str
@@ -180,6 +182,7 @@ class account_invoice_report(osv.osv):
from_str = """
FROM account_invoice_line ail
JOIN account_invoice ai ON ai.id = ail.invoice_id
+ JOIN res_partner partner ON ai.commercial_partner_id = partner.id
LEFT JOIN product_product pr ON pr.id = ail.product_id
left JOIN product_template pt ON pt.id = pr.product_tmpl_id
LEFT JOIN product_uom u ON u.id = ail.uos_id
@@ -195,7 +198,7 @@ class account_invoice_report(osv.osv):
ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
- ai.amount_total, u.uom_type, u.category_id, ai.commercial_partner_id
+ ai.amount_total, u.uom_type, u.category_id, ai.commercial_partner_id, partner.country_id
"""
return group_by_str
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 96dc948b09a..5f38db5e71f 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -15,6 +15,7 @@
+
@@ -68,6 +69,7 @@
+
diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 53c604161ea..89d238b16e9 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -25,6 +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.translate import _
from openerp.osv import fields, osv
from openerp import tools
@@ -132,12 +133,43 @@ class account_config_settings(osv.osv_memory):
count = self.pool.get('res.company').search_count(cr, uid, [], context=context)
return bool(count == 1)
+ def _get_default_fiscalyear_data(self, cr, uid, company_id, context=None):
+ """Compute default period, starting and ending date for fiscalyear
+ - if in a fiscal year, use its period, starting and ending date
+ - if past fiscal year, use its period, and new dates [ending date of the latest +1 day ; ending date of the latest +1 year]
+ - if no fiscal year, use monthly, 1st jan, 31th dec of this year
+ :return: (date_start, date_stop, period) at format DEFAULT_SERVER_DATETIME_FORMAT
+ """
+ fiscalyear_ids = self.pool.get('account.fiscalyear').search(cr, uid,
+ [('date_start', '<=', time.strftime(DF)), ('date_stop', '>=', time.strftime(DF)),
+ ('company_id', '=', company_id)])
+ if fiscalyear_ids:
+ # is in a current fiscal year, use this one
+ fiscalyear = self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_ids[0], context=context)
+ if len(fiscalyear.period_ids) == 5: # 4 periods of 3 months + opening period
+ period = '3months'
+ else:
+ period = 'month'
+ return (fiscalyear.date_start, fiscalyear.date_stop, period)
+ else:
+ past_fiscalyear_ids = self.pool.get('account.fiscalyear').search(cr, uid,
+ [('date_stop', '<=', time.strftime(DF)), ('company_id', '=', company_id)])
+ if past_fiscalyear_ids:
+ # use the latest fiscal, sorted by (start_date, id)
+ latest_year = self.pool.get('account.fiscalyear').browse(cr, uid, past_fiscalyear_ids[-1], context=context)
+ latest_stop = datetime.datetime.strptime(latest_year.date_stop, DF)
+ if len(latest_year.period_ids) == 5:
+ period = '3months'
+ else:
+ period = 'month'
+ return ((latest_stop+datetime.timedelta(days=1)).strftime(DF), latest_stop.replace(year=latest_stop.year+1).strftime(DF), period)
+ else:
+ return (time.strftime('%Y-01-01'), time.strftime('%Y-12-31'), 'month')
+
+
_defaults = {
'company_id': _default_company,
'has_default_company': _default_has_default_company,
- 'date_start': lambda *a: time.strftime('%Y-01-01'),
- 'date_stop': lambda *a: time.strftime('%Y-12-31'),
- 'period': 'month',
}
def create(self, cr, uid, values, context=None):
@@ -161,6 +193,7 @@ class account_config_settings(osv.osv_memory):
fiscalyear_count = self.pool.get('account.fiscalyear').search_count(cr, uid,
[('date_start', '<=', time.strftime('%Y-%m-%d')), ('date_stop', '>=', time.strftime('%Y-%m-%d')),
('company_id', '=', company_id)])
+ date_start, date_stop, period = self._get_default_fiscalyear_data(cr, uid, company_id, context=context)
values = {
'expects_chart_of_accounts': company.expects_chart_of_accounts,
'currency_id': company.currency_id.id,
@@ -170,6 +203,9 @@ class account_config_settings(osv.osv_memory):
'has_fiscal_year': bool(fiscalyear_count),
'chart_template_id': False,
'tax_calculation_rounding_method': company.tax_calculation_rounding_method,
+ 'date_start': date_start,
+ 'date_stop': date_stop,
+ 'period': period,
}
# update journals and sequences
for journal_type in ('sale', 'sale_refund', 'purchase', 'purchase_refund'):
@@ -302,4 +338,10 @@ class account_config_settings(osv.osv_memory):
dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_account')
dp.write({'digits': config.decimal_precision})
+ def onchange_analytic_accounting(self, cr, uid, ids, analytic_accounting, context=None):
+ if analytic_accounting:
+ return {'value': {
+ 'module_account_accountant': True,
+ }}
+ return {}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml
index 7977c0fc505..ce8b41fc2da 100644
--- a/addons/account/res_config_view.xml
+++ b/addons/account/res_config_view.xml
@@ -130,7 +130,7 @@
-
+
diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py
index 874a8e3b7c9..bd38e6bbed6 100644
--- a/addons/account/wizard/pos_box.py
+++ b/addons/account/wizard/pos_box.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 33ab3be209c..e493f364a0e 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -259,17 +259,14 @@ class account_analytic_account(osv.osv):
return res
if child_ids:
- cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount), 0.0) \
- FROM account_analytic_line \
- JOIN account_analytic_journal \
- ON account_analytic_line.journal_id = account_analytic_journal.id \
- WHERE account_analytic_line.account_id IN %s \
- AND account_analytic_journal.type = 'sale' \
- GROUP BY account_analytic_line.account_id", (child_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id] = round(sum,2)
+ #Search all invoice lines not in cancelled state that refer to this analytic account
+ inv_line_obj = self.pool.get("account.invoice.line")
+ inv_lines = inv_line_obj.search(cr, uid, ['&', ('account_analytic_id', 'in', child_ids), ('invoice_id.state', '!=', 'cancel')], context=context)
+ for line in inv_line_obj.browse(cr, uid, inv_lines, context=context):
+ res[line.account_analytic_id.id] += line.price_subtotal
for acc in self.browse(cr, uid, res.keys(), context=context):
res[acc.id] = res[acc.id] - (acc.timesheet_ca_invoiced or 0.0)
+
res_final = res
return res_final
@@ -481,7 +478,7 @@ class account_analytic_account(osv.osv):
'remaining_hours': fields.function(_remaining_hours_calc, type='float', string='Remaining Time',
help="Computed using the formula: Maximum Time - Total Worked Time"),
'remaining_hours_to_invoice': fields.function(_remaining_hours_to_invoice_calc, type='float', string='Remaining Time',
- help="Computed using the formula: Maximum Time - Total Invoiced Time"),
+ help="Computed using the formula: Expected on timesheets - Total invoiced on timesheets"),
'fix_price_to_invoice': fields.function(_fix_price_to_invoice_calc, type='float', string='Remaining Time',
help="Sum of quotations for this contract."),
'timesheet_ca_invoiced': fields.function(_timesheet_ca_invoiced_calc, type='float', string='Remaining Time',
@@ -633,6 +630,21 @@ class account_analytic_account(osv.osv):
pass
return result
+
+ def hr_to_invoice_timesheets(self, cr, uid, ids, context=None):
+ domain = [('invoice_id','=',False),('to_invoice','!=',False), ('journal_id.type', '=', 'general'), ('account_id', 'in', ids)]
+ names = [record.name for record in self.browse(cr, uid, ids, context=context)]
+ name = _('Timesheets to Invoice of %s') % ','.join(names)
+ return {
+ 'type': 'ir.actions.act_window',
+ 'name': name,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'domain' : domain,
+ 'res_model': 'account.analytic.line',
+ 'nodestroy': True,
+ }
+
def _prepare_invoice(self, cr, uid, contract, context=None):
context = context or {}
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index d31746e7e70..cd4be740815 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -98,8 +98,8 @@
-
or view
diff --git a/addons/account_analytic_analysis/i18n/ru.po b/addons/account_analytic_analysis/i18n/ru.po
index 3944c48afb6..339d425c717 100644
--- a/addons/account_analytic_analysis/i18n/ru.po
+++ b/addons/account_analytic_analysis/i18n/ru.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
-"PO-Revision-Date: 2011-02-19 12:16+0000\n"
+"PO-Revision-Date: 2013-05-31 07:35+0000\n"
"Last-Translator: Chertykov Denis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:25+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-01 05:16+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: account_analytic_analysis
#: view:account.analytic.account:0
@@ -73,7 +73,7 @@ msgstr ""
#. module: account_analytic_analysis
#: view:account.analytic.account:0
msgid "⇒ Invoice"
-msgstr ""
+msgstr "⇒ Счет"
#. module: account_analytic_analysis
#: field:account.analytic.account,ca_invoiced:0
@@ -196,6 +196,8 @@ msgid ""
"{'required': [('type','=','contract')], 'invisible': [('type','in',['view', "
"'normal','template'])]}"
msgstr ""
+"{'required': [('type','=','contract')], 'invisible': [('type','in',['view', "
+"'normal','template'])]}"
#. module: account_analytic_analysis
#: field:account.analytic.account,real_margin_rate:0
@@ -335,7 +337,7 @@ msgstr "Теоретическая выручка"
#. module: account_analytic_analysis
#: view:account.analytic.account:0
msgid "To Renew"
-msgstr ""
+msgstr "К продлению"
#. module: account_analytic_analysis
#: view:account.analytic.account:0
@@ -431,7 +433,7 @@ msgstr ""
#. module: account_analytic_analysis
#: field:account.analytic.account,toinvoice_total:0
msgid "Total to Invoice"
-msgstr ""
+msgstr "Всего в счет"
#. module: account_analytic_analysis
#: view:account.analytic.account:0
@@ -546,18 +548,18 @@ msgstr "Дата последней операции по этому счету.
#. module: account_analytic_analysis
#: model:ir.model,name:account_analytic_analysis.model_sale_config_settings
msgid "sale.config.settings"
-msgstr ""
+msgstr "sale.config.settings"
#. module: account_analytic_analysis
#: field:sale.config.settings,group_template_required:0
msgid "Mandatory use of templates."
-msgstr ""
+msgstr "Обязательное использование шаблонов."
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.template_of_contract_action
#: model:ir.ui.menu,name:account_analytic_analysis.menu_template_of_contract_action
msgid "Contract Template"
-msgstr ""
+msgstr "Шаблон контракта"
#. module: account_analytic_analysis
#: view:account.analytic.account:0
@@ -612,7 +614,7 @@ msgstr ""
#. module: account_analytic_analysis
#: view:account.analytic.account:0
msgid "Total"
-msgstr ""
+msgstr "Итого"
#~ msgid "Hours summary by user"
#~ msgstr "Итого часов по пользователям"
diff --git a/addons/account_analytic_default/security/account_analytic_default_security.xml b/addons/account_analytic_default/security/account_analytic_default_security.xml
index 63c6e30eb22..cdce2a9955e 100644
--- a/addons/account_analytic_default/security/account_analytic_default_security.xml
+++ b/addons/account_analytic_default/security/account_analytic_default_security.xml
@@ -4,7 +4,7 @@
Analytic Default multi company rule
-
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account_analytic_plans/i18n/ru.po b/addons/account_analytic_plans/i18n/ru.po
index ba32246e8d6..29cb3ea910f 100644
--- a/addons/account_analytic_plans/i18n/ru.po
+++ b/addons/account_analytic_plans/i18n/ru.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-12-21 17:05+0000\n"
-"PO-Revision-Date: 2012-12-28 10:00+0000\n"
+"PO-Revision-Date: 2013-05-31 07:41+0000\n"
"Last-Translator: Chertykov Denis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:26+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-01 05:16+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account4_ids:0
@@ -48,7 +48,7 @@ msgstr "Ставка (%)"
#: code:addons/account_analytic_plans/account_analytic_plans.py:234
#, python-format
msgid "The total should be between %s and %s."
-msgstr ""
+msgstr "Итог должен быть между %s и %s."
#. module: account_analytic_plans
#: view:account.analytic.plan:0
@@ -131,7 +131,7 @@ msgstr "Не показывать пустые строки"
#: code:addons/account_analytic_plans/wizard/account_crossovered_analytic.py:61
#, python-format
msgid "There are no analytic lines related to account %s."
-msgstr ""
+msgstr "Нет позиций аналитики относящихся к счету %s."
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account3_ids:0
@@ -315,7 +315,7 @@ msgstr "Журнал аналитики"
#: code:addons/account_analytic_plans/wizard/analytic_plan_create_model.py:38
#, python-format
msgid "Please put a name and a code before saving the model."
-msgstr ""
+msgstr "Пожалуйста, введите имя и код перед сохранением модели."
#. module: account_analytic_plans
#: report:account.analytic.account.crossovered.analytic:0
@@ -347,7 +347,7 @@ msgstr "Журнал"
#: code:addons/account_analytic_plans/account_analytic_plans.py:486
#, python-format
msgid "You have to define an analytic journal on the '%s' journal."
-msgstr ""
+msgstr "Вы должны определить журнал аналитики для журнала '%s'"
#. module: account_analytic_plans
#: code:addons/account_analytic_plans/account_analytic_plans.py:342
@@ -375,7 +375,7 @@ msgstr "Позиция счета"
#: code:addons/account_analytic_plans/wizard/analytic_plan_create_model.py:41
#, python-format
msgid "There is no analytic plan defined."
-msgstr ""
+msgstr "Аналитический план счетов не определен."
#. module: account_analytic_plans
#: model:ir.model,name:account_analytic_plans.model_account_bank_statement
@@ -402,7 +402,7 @@ msgstr "Разнесение аналитики"
#: code:addons/account_analytic_plans/account_analytic_plans.py:221
#, python-format
msgid "A model with this name and code already exists."
-msgstr ""
+msgstr "Модель с таким названием и кодом уже существует."
#. module: account_analytic_plans
#: help:account.analytic.plan.line,root_analytic_id:0
diff --git a/addons/account_asset/i18n/ru.po b/addons/account_asset/i18n/ru.po
index a0950a98370..d6bc83aacb5 100644
--- a/addons/account_asset/i18n/ru.po
+++ b/addons/account_asset/i18n/ru.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:04+0000\n"
-"PO-Revision-Date: 2011-07-12 12:04+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2013-05-31 08:06+0000\n"
+"Last-Translator: Chertykov Denis \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-03-16 05:50+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-01 05:16+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: account_asset
#: view:account.asset.asset:0
@@ -148,7 +148,7 @@ msgstr ""
#. module: account_asset
#: help:account.asset.asset,method_period:0
msgid "The amount of time between two depreciations, in months"
-msgstr ""
+msgstr "Количество времени между амортизациями, в месяцах"
#. module: account_asset
#: field:account.asset.depreciation.line,depreciation_date:0
@@ -160,7 +160,7 @@ msgstr "Дата амортизации"
#. module: account_asset
#: constraint:account.asset.asset:0
msgid "Error ! You cannot create recursive assets."
-msgstr ""
+msgstr "Ошибка! Нельзя создавать рекурсивные активы."
#. module: account_asset
#: field:asset.asset.report,posted_value:0
@@ -205,7 +205,7 @@ msgstr "# позиций амортизации"
#. module: account_asset
#: field:account.asset.asset,method_period:0
msgid "Number of Months in a Period"
-msgstr ""
+msgstr "Количество месяцев в периоде"
#. module: account_asset
#: view:asset.asset.report:0
@@ -234,7 +234,7 @@ msgstr "Счет активов"
#: model:ir.actions.act_window,name:account_asset.action_asset_depreciation_confirmation_wizard
#: model:ir.ui.menu,name:account_asset.menu_asset_depreciation_confirmation_wizard
msgid "Compute Assets"
-msgstr ""
+msgstr "Вычислить активы"
#. module: account_asset
#: field:account.asset.category,method_period:0
@@ -265,12 +265,12 @@ msgstr "Изменить длительность"
#: help:account.asset.category,method_number:0
#: help:account.asset.history,method_number:0
msgid "The number of depreciations needed to depreciate your asset"
-msgstr ""
+msgstr "Количество амортизаций необходимых для обесценивания актива"
#. module: account_asset
#: view:account.asset.category:0
msgid "Analytic Information"
-msgstr ""
+msgstr "Аналитическая информация"
#. module: account_asset
#: field:account.asset.category,account_analytic_id:0
@@ -293,7 +293,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.depreciation.line,remaining_value:0
msgid "Next Period Depreciation"
-msgstr ""
+msgstr "Следующий период амортизации"
#. module: account_asset
#: help:account.asset.history,method_period:0
@@ -344,7 +344,7 @@ msgstr "Поиск категории актива"
#. module: account_asset
#: view:asset.modify:0
msgid "months"
-msgstr ""
+msgstr "месяцы"
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_invoice_line
@@ -372,7 +372,7 @@ msgstr ""
#: view:asset.depreciation.confirmation.wizard:0
#: view:asset.modify:0
msgid "or"
-msgstr ""
+msgstr "или"
#. module: account_asset
#: field:account.asset.asset,note:0
@@ -406,7 +406,7 @@ msgstr ""
#. module: account_asset
#: view:asset.asset.report:0
msgid "Assets in running state"
-msgstr ""
+msgstr "Активы в рабочем состоянии"
#. module: account_asset
#: view:account.asset.asset:0
@@ -427,7 +427,7 @@ msgstr ""
#: field:account.asset.asset,state:0
#: field:asset.asset.report,state:0
msgid "Status"
-msgstr ""
+msgstr "Статус"
#. module: account_asset
#: field:account.asset.asset,partner_id:0
@@ -474,12 +474,12 @@ msgstr "Вычислить"
#. module: account_asset
#: view:account.asset.history:0
msgid "Asset History"
-msgstr ""
+msgstr "История актива"
#. module: account_asset
#: model:ir.model,name:account_asset.model_asset_depreciation_confirmation_wizard
msgid "asset.depreciation.confirmation.wizard"
-msgstr ""
+msgstr "asset.depreciation.confirmation.wizard"
#. module: account_asset
#: field:account.asset.asset,active:0
@@ -505,7 +505,7 @@ msgstr "История"
#. module: account_asset
#: view:asset.depreciation.confirmation.wizard:0
msgid "Compute Asset"
-msgstr ""
+msgstr "Вычислить актив"
#. module: account_asset
#: field:asset.depreciation.confirmation.wizard,period_id:0
@@ -521,7 +521,7 @@ msgstr "Общий"
#: field:account.asset.asset,prorata:0
#: field:account.asset.category,prorata:0
msgid "Prorata Temporis"
-msgstr ""
+msgstr "По истечении срока"
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_invoice
@@ -553,7 +553,7 @@ msgstr "Элементы журнала"
#. module: account_asset
#: view:asset.modify:0
msgid "Asset Durations to Modify"
-msgstr ""
+msgstr "Актив - интервал времени для изменения"
#. module: account_asset
#: field:account.asset.asset,purchase_date:0
@@ -574,6 +574,8 @@ msgid ""
"Choose the period for which you want to automatically post the depreciation "
"lines of running assets"
msgstr ""
+"Выберите период, за который вы хотите автоматически создавать записи "
+"амортизации для актива"
#. module: account_asset
#: view:account.asset.asset:0
@@ -588,12 +590,12 @@ msgstr "Метод амортизации"
#. module: account_asset
#: field:account.asset.depreciation.line,amount:0
msgid "Current Depreciation"
-msgstr ""
+msgstr "Текущая аммортизация"
#. module: account_asset
#: field:account.asset.asset,name:0
msgid "Asset Name"
-msgstr ""
+msgstr "Название актива"
#. module: account_asset
#: field:account.asset.category,open_asset:0
@@ -618,7 +620,7 @@ msgstr "Журнал"
#. module: account_asset
#: field:account.asset.history,name:0
msgid "History name"
-msgstr ""
+msgstr "Название истории"
#. module: account_asset
#: field:account.asset.depreciation.line,depreciated_value:0
@@ -657,7 +659,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,purchase_value:0
msgid "Gross Value"
-msgstr ""
+msgstr "Валовая стоимость"
#. module: account_asset
#: field:account.asset.category,name:0
@@ -703,12 +705,12 @@ msgstr ""
#. module: account_asset
#: field:account.asset.depreciation.line,sequence:0
msgid "Sequence"
-msgstr ""
+msgstr "Нумерация"
#. module: account_asset
#: help:account.asset.category,method_period:0
msgid "State here the time between 2 depreciations, in months"
-msgstr ""
+msgstr "Время между двумя амортизациями в месяцах"
#. module: account_asset
#: field:account.asset.history,date:0
@@ -729,7 +731,7 @@ msgstr "Число амортизаций"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Create Move"
-msgstr ""
+msgstr "Создать перемещение"
#. module: account_asset
#: view:account.asset.asset:0
diff --git a/addons/account_asset/security/ir.model.access.csv b/addons/account_asset/security/ir.model.access.csv
old mode 100755
new mode 100644
diff --git a/addons/account_asset/wizard/__init__.py b/addons/account_asset/wizard/__init__.py
old mode 100755
new mode 100644
diff --git a/addons/account_asset/wizard/account_asset_change_duration.py b/addons/account_asset/wizard/account_asset_change_duration.py
old mode 100755
new mode 100644
diff --git a/addons/account_asset/wizard/wizard_asset_compute.py b/addons/account_asset/wizard/wizard_asset_compute.py
old mode 100755
new mode 100644
diff --git a/addons/account_check_writing/i18n/ru.po b/addons/account_check_writing/i18n/ru.po
index ba474c72a22..8e68dd7152a 100644
--- a/addons/account_check_writing/i18n/ru.po
+++ b/addons/account_check_writing/i18n/ru.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-12-11 13:00+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2013-06-03 07:47+0000\n"
+"Last-Translator: Chertykov Denis \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-03-16 05:51+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-04 05:20+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: account_check_writing
#: selection:res.company,check_layout:0
@@ -25,13 +25,13 @@ msgstr ""
#. module: account_check_writing
#: report:account.print.check.top:0
msgid "Open Balance"
-msgstr ""
+msgstr "Открытый баланс"
#. module: account_check_writing
#: view:account.check.write:0
#: view:account.voucher:0
msgid "Print Check"
-msgstr ""
+msgstr "Напечатать чек"
#. module: account_check_writing
#: selection:res.company,check_layout:0
@@ -82,7 +82,7 @@ msgstr "Описание"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_account_journal
msgid "Journal"
-msgstr ""
+msgstr "Журнал"
#. module: account_check_writing
#: model:ir.actions.act_window,name:account_check_writing.action_write_check
@@ -95,14 +95,14 @@ msgstr ""
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Discount"
-msgstr ""
+msgstr "Скидка"
#. 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 ""
+msgstr "Первоначальная сумма"
#. module: account_check_writing
#: field:res.company,check_layout:0
@@ -119,7 +119,7 @@ msgstr ""
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Payment"
-msgstr ""
+msgstr "Платеж"
#. module: account_check_writing
#: field:account.journal,use_preprint_check:0
@@ -153,7 +153,7 @@ msgstr ""
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Due Date"
-msgstr ""
+msgstr "Дата исполнения"
#. module: account_check_writing
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle
@@ -163,13 +163,13 @@ msgstr ""
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_res_company
msgid "Companies"
-msgstr ""
+msgstr "Компании"
#. module: account_check_writing
#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59
#, python-format
msgid "Error!"
-msgstr ""
+msgstr "Ошибка!"
#. module: account_check_writing
#: help:account.check.write,check_number:0
@@ -202,12 +202,12 @@ msgstr ""
#. module: account_check_writing
#: view:account.check.write:0
msgid "or"
-msgstr ""
+msgstr "или"
#. module: account_check_writing
#: field:account.voucher,amount_in_word:0
msgid "Amount in Word"
-msgstr ""
+msgstr "Сумма прописью"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_account_check_write
@@ -217,7 +217,7 @@ msgstr ""
#. module: account_check_writing
#: view:account.check.write:0
msgid "Cancel"
-msgstr ""
+msgstr "Отмена"
#. module: account_check_writing
#: field:account.check.write,check_number:0
diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py
index 036feaaf0e5..715860cab83 100644
--- a/addons/account_followup/account_followup.py
+++ b/addons/account_followup/account_followup.py
@@ -165,9 +165,8 @@ class res_partner(osv.osv):
else:
action_text = partner.latest_followup_level_id_without_lit.manual_action_note or ''
- #Check date: put the minimum date if it existed already
- action_date = (partner.payment_next_action_date and min(partner.payment_next_action_date, fields.date.context_today(self, cr, uid, context=context))
- ) or fields.date.context_today(self, cr, uid, context=context)
+ #Check date: only change when it did not exist already
+ action_date = partner.payment_next_action_date or fields.date.context_today(self, cr, uid, context=context)
# Check responsible: if partner has not got a responsible already, take from follow-up
responsible_id = False
diff --git a/addons/account_followup/i18n/ru.po b/addons/account_followup/i18n/ru.po
index f6cb2cf0412..b57c8e4315e 100644
--- a/addons/account_followup/i18n/ru.po
+++ b/addons/account_followup/i18n/ru.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-12-21 17:05+0000\n"
-"PO-Revision-Date: 2011-11-11 15:21+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2013-05-31 10:28+0000\n"
+"Last-Translator: Chertykov Denis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:11+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-01 05:16+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: account_followup
#: model:email.template,subject:account_followup.email_template_account_followup_default
@@ -22,7 +22,7 @@ msgstr ""
#: model:email.template,subject:account_followup.email_template_account_followup_level1
#: model:email.template,subject:account_followup.email_template_account_followup_level2
msgid "${user.company_id.name} Payment Reminder"
-msgstr ""
+msgstr "${user.company_id.name} напоминание о платеже"
#. module: account_followup
#: help:res.partner,latest_followup_level_id:0
@@ -43,12 +43,12 @@ msgstr "Дальнейшие действия"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "%(date)s"
-msgstr ""
+msgstr "%(date)s"
#. module: account_followup
#: field:res.partner,payment_next_action_date:0
msgid "Next Action Date"
-msgstr ""
+msgstr "Дата следующего действия"
#. module: account_followup
#: view:account_followup.followup.line:0
@@ -64,7 +64,7 @@ msgstr ""
#. module: account_followup
#: view:res.partner:0
msgid "⇾ Mark as Done"
-msgstr ""
+msgstr "⇾ отметить как сделанное"
#. module: account_followup
#: field:account_followup.followup.line,manual_action_note:0
@@ -94,7 +94,7 @@ msgstr "Тема эл.письма"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "%(user_signature)s"
-msgstr ""
+msgstr "%(user_signature)s"
#. module: account_followup
#: view:account_followup.followup.line:0
@@ -109,19 +109,19 @@ msgstr ""
#. module: account_followup
#: field:account_followup.print,email_body:0
msgid "Email Body"
-msgstr ""
+msgstr "Тело эл. письма"
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.action_account_followup_print
msgid "Send Follow-Ups"
-msgstr ""
+msgstr "Послать напоминания"
#. module: account_followup
#: report:account_followup.followup.print:0
#: code:addons/account_followup/account_followup.py:263
#, python-format
msgid "Amount"
-msgstr ""
+msgstr "Сумма"
#. module: account_followup
#: help:res.partner,payment_next_action:0
@@ -133,7 +133,7 @@ msgstr ""
#. module: account_followup
#: view:res.partner:0
msgid "No Responsible"
-msgstr ""
+msgstr "Нет ответственного"
#. module: account_followup
#: model:account_followup.followup.line,description:account_followup.demo_followup_line2
@@ -209,17 +209,17 @@ msgstr "Всего по дебету"
#. module: account_followup
#: field:res.partner,payment_next_action:0
msgid "Next Action"
-msgstr ""
+msgstr "Следующее действие"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid ": Partner Name"
-msgstr ""
+msgstr ": Название партнера"
#. module: account_followup
#: field:account_followup.followup.line,manual_action_responsible_id:0
msgid "Assign a Responsible"
-msgstr ""
+msgstr "Назначить ответственного"
#. module: account_followup
#: view:account_followup.followup:0
@@ -305,7 +305,7 @@ msgstr ""
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "%(partner_name)s"
-msgstr ""
+msgstr "%(partner_name)s"
#. module: account_followup
#: model:email.template,body_html:account_followup.email_template_account_followup_level1
@@ -377,7 +377,7 @@ msgstr "Определяет порядок вывода списка напом
#: code:addons/account_followup/wizard/account_followup_print.py:166
#, python-format
msgid " will be sent"
-msgstr ""
+msgstr " будет отправлен"
#. module: account_followup
#: view:account_followup.followup.line:0
@@ -388,7 +388,7 @@ msgstr ""
#: view:account_followup.followup.line:0
#: field:account_followup.followup.line,send_letter:0
msgid "Send a Letter"
-msgstr ""
+msgstr "Отправить письмо"
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.action_account_followup_definition_form
@@ -466,7 +466,7 @@ msgstr "Напечатанное сообщение"
#: code:addons/account_followup/wizard/account_followup_print.py:155
#, python-format
msgid "Anybody"
-msgstr ""
+msgstr "Кто угодно"
#. module: account_followup
#: help:account_followup.followup.line,send_email:0
@@ -528,7 +528,7 @@ msgstr ""
#. module: account_followup
#: view:res.partner:0
msgid "Search Partner"
-msgstr ""
+msgstr "Поиск партнера"
#. module: account_followup
#: model:ir.ui.menu,name:account_followup.account_followup_print_menu
@@ -554,7 +554,7 @@ msgstr ""
#. module: account_followup
#: view:account_followup.print:0
msgid "or"
-msgstr ""
+msgstr "или"
#. module: account_followup
#: view:res.partner:0
diff --git a/addons/account_followup/security/account_followup_security.xml b/addons/account_followup/security/account_followup_security.xml
index 1586403d701..69c9a44a1b9 100644
--- a/addons/account_followup/security/account_followup_security.xml
+++ b/addons/account_followup/security/account_followup_security.xml
@@ -4,7 +4,7 @@
Account Follow-up multi company rule
-
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account_payment/security/account_payment_security.xml b/addons/account_payment/security/account_payment_security.xml
index 4bca00eaa6d..fbe29699e86 100644
--- a/addons/account_payment/security/account_payment_security.xml
+++ b/addons/account_payment/security/account_payment_security.xml
@@ -15,21 +15,21 @@
Payment Mode company rule
-
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]Payment order multi company rule
-
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]Payment line multi company rule
-
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account_test/account_test.py b/addons/account_test/account_test.py
index 98e27380837..cc60108bf20 100644
--- a/addons/account_test/account_test.py
+++ b/addons/account_test/account_test.py
@@ -24,7 +24,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
##############################################################################
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index 345c3378aa0..a043b15a518 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -67,6 +67,7 @@ This module manages:
'test/sales_payment.yml',
'test/account_voucher_report.yml',
'test/case1_usd_usd.yml',
+ 'test/case1_usd_usd_payment_rate.yml',
'test/case2_usd_eur_debtor_in_eur.yml',
'test/case2_usd_eur_debtor_in_usd.yml',
'test/case3_eur_eur.yml',
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index b176c3b8fd9..850162ccf84 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -26,6 +26,19 @@ from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
from openerp.tools import float_compare
+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):
+ if context is None:
+ context = {}
+ res = super(res_currency, self)._get_current_rate(cr, uid, ids, name, arg, 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
+
class res_company(osv.osv):
_inherit = "res.company"
@@ -153,7 +166,7 @@ class account_voucher(osv.osv):
journal = journal_pool.browse(cr, uid, journal_id, context=context)
if journal.currency:
return journal.currency.id
- return False
+ return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
def _get_partner(self, cr, uid, context=None):
if context is None: context = {}
@@ -222,26 +235,26 @@ class account_voucher(osv.osv):
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, type, context=None):
context = context or {}
if not line_dr_ids and not line_cr_ids:
- return {'value':{}}
+ return {'value':{'writeoff_amount': 0.0}}
line_osv = self.pool.get("account.voucher.line")
line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context)
line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context)
-
#compute the field is_multi_currency that is used to hide/display options linked to secondary currency on the voucher
is_multi_currency = False
- if voucher_currency:
- # if the voucher currency is not False, it means it is different than the company currency and we need to display the options
- is_multi_currency = True
- else:
- #loop on the voucher lines to see if one of these has a secondary currency. If yes, we need to define the options
- for voucher_line in line_dr_ids+line_cr_ids:
- company_currency = False
- company_currency = voucher_line.get('move_line_id', False) and self.pool.get('account.move.line').browse(cr, uid, voucher_line.get('move_line_id'), context=context).company_id.currency_id.id
- if voucher_line.get('currency_id', company_currency) != company_currency:
- is_multi_currency = True
- break
+ #loop on the voucher lines to see if one of these has a secondary currency. If yes, we need to see the options
+ for voucher_line in line_dr_ids+line_cr_ids:
+ line_id = voucher_line.get('id') and self.pool.get('account.voucher.line').browse(cr, uid, voucher_line['id'], context=context).move_line_id.id or voucher_line.get('move_line_id')
+ if line_id and self.pool.get('account.move.line').browse(cr, uid, line_id, context=context).currency_id:
+ is_multi_currency = True
+ break
return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, type), 'is_multi_currency': is_multi_currency}}
+ def _get_journal_currency(self, cr, uid, ids, name, args, context=None):
+ res = {}
+ for voucher in self.browse(cr, uid, ids, context=context):
+ res[voucher.id] = voucher.journal_id.currency and voucher.journal_id.currency.id or voucher.company_id.currency_id.id
+ return res
+
def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None):
if not ids: return {}
currency_obj = self.pool.get('res.currency')
@@ -258,20 +271,48 @@ class account_voucher(osv.osv):
return res
def _paid_amount_in_company_currency(self, cr, uid, ids, name, args, context=None):
- if not ids: return {}
+ if context is None:
+ context = {}
+ res = {}
+ ctx = context.copy()
+ for v in self.browse(cr, uid, ids, context=context):
+ ctx.update({'date': v.date})
+ #make a new call to browse in order to have the right date in the context, to get the right currency rate
+ voucher = self.browse(cr, uid, v.id, context=ctx)
+ ctx.update({
+ 'voucher_special_currency': voucher.payment_rate_currency_id and voucher.payment_rate_currency_id.id or False,
+ 'voucher_special_currency_rate': voucher.currency_id.rate * voucher.payment_rate,})
+ res[voucher.id] = self.pool.get('res.currency').compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, voucher.amount, context=ctx)
+ return res
+
+ def _get_currency_help_label(self, cr, uid, currency_id, payment_rate, payment_rate_currency_id, context=None):
+ """
+ This function builds a string to help the users to understand the behavior of the payment rate fields they can specify on the voucher.
+ This string is only used to improve the usability in the voucher form view and has no other effect.
+
+ :param currency_id: the voucher currency
+ :type currency_id: integer
+ :param payment_rate: the value of the payment_rate field of the voucher
+ :type payment_rate: float
+ :param payment_rate_currency_id: the value of the payment_rate_currency_id field of the voucher
+ :type payment_rate_currency_id: integer
+ :return: translated string giving a tip on what's the effect of the current payment rate specified
+ :rtype: str
+ """
+ rml_parser = report_sxw.rml_parse(cr, uid, 'currency_help_label', context=context)
+ currency_pool = self.pool.get('res.currency')
+ currency_str = payment_rate_str = ''
+ if currency_id:
+ currency_str = rml_parser.formatLang(1, currency_obj=currency_pool.browse(cr, uid, currency_id, context=context))
+ if payment_rate_currency_id:
+ payment_rate_str = rml_parser.formatLang(payment_rate, currency_obj=currency_pool.browse(cr, uid, payment_rate_currency_id, context=context))
+ currency_help_label = _('At the operation date, the exchange rate was\n%s = %s') % (currency_str, payment_rate_str)
+ return currency_help_label
+
+ def _fnct_currency_help_label(self, cr, uid, ids, name, args, context=None):
res = {}
- rate = 1.0
for voucher in self.browse(cr, uid, ids, context=context):
- if voucher.currency_id:
- if voucher.company_id.currency_id.id == voucher.payment_rate_currency_id.id:
- rate = 1 / voucher.payment_rate
- else:
- ctx = context.copy()
- ctx.update({'date': voucher.date})
- voucher_rate = self.browse(cr, uid, voucher.id, context=ctx).currency_id.rate
- company_currency_rate = voucher.company_id.currency_id.rate
- rate = voucher_rate * company_currency_rate
- res[voucher.id] = voucher.amount / rate
+ res[voucher.id] = self._get_currency_help_label(cr, uid, voucher.currency_id.id, voucher.payment_rate, voucher.payment_rate_currency_id.id, context=context)
return res
_name = 'account.voucher'
@@ -304,8 +345,7 @@ class account_voucher(osv.osv):
domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}),
-# 'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', readonly=True),
+ 'currency_id': fields.function(_get_journal_currency, type='many2one', relation='res.currency', string='Currency', readonly=True, required=True),
'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'state':fields.selection(
[('draft','Draft'),
@@ -346,6 +386,7 @@ class account_voucher(osv.osv):
help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'),
'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True),
'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'),
+ 'currency_help_label': fields.function(_fnct_currency_help_label, type='text', string="Helping Sentence", help="This sentence helps you to know how to specify the payment rate by giving you the direct effect it has"),
}
_defaults = {
'active': True,
@@ -422,6 +463,8 @@ class account_voucher(osv.osv):
partner_pool = self.pool.get('res.partner')
position_pool = self.pool.get('account.fiscal.position')
line_pool = self.pool.get('account.voucher.line')
+ if not line_ids:
+ line_ids = []
res = {
'tax_amount': False,
'amount': False,
@@ -516,23 +559,26 @@ class account_voucher(osv.osv):
return default
def onchange_rate(self, cr, uid, ids, rate, amount, currency_id, payment_rate_currency_id, company_id, context=None):
- res = {'value': {'paid_amount_in_company_currency': amount}}
- company_currency = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id
- if rate and amount and currency_id:# and currency_id == payment_rate_currency_id:
- voucher_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context).rate
- if company_currency.id == payment_rate_currency_id:
- company_rate = rate
- else:
- company_rate = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.rate
- res['value']['paid_amount_in_company_currency'] = amount / voucher_rate * company_rate
+ res = {'value': {'paid_amount_in_company_currency': amount, 'currency_help_label': self._get_currency_help_label(cr, uid, currency_id, rate, payment_rate_currency_id, context=context)}}
+ if rate and amount and currency_id:
+ company_currency = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id
+ #context should contain the date, the payment currency and the payment rate specified on the voucher
+ amount_in_company_currency = self.pool.get('res.currency').compute(cr, uid, currency_id, company_currency.id, amount, context=context)
+ res['value']['paid_amount_in_company_currency'] = amount_in_company_currency
return res
def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None):
if context is None:
context = {}
- res = self.recompute_voucher_lines(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=context)
ctx = context.copy()
ctx.update({'date': date})
+ #read the voucher rate with the right date in the context
+ currency_id = currency_id or self.pool.get('res.company').browse(cr, uid, company_id, context=ctx).currency_id.id
+ voucher_rate = self.pool.get('res.currency').read(cr, uid, currency_id, ['rate'], context=ctx)['rate']
+ ctx.update({
+ 'voucher_special_currency': payment_rate_currency_id,
+ 'voucher_special_currency_rate': rate * voucher_rate})
+ res = self.recompute_voucher_lines(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=ctx)
vals = self.onchange_rate(cr, uid, ids, rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx)
for key in vals.keys():
res[key].update(vals[key])
@@ -546,6 +592,7 @@ class account_voucher(osv.osv):
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
company_id = journal.company_id.id
payment_rate = 1.0
+ currency_id = currency_id or journal.company_id.currency_id.id
payment_rate_currency_id = currency_id
ctx = context.copy()
ctx.update({'date': date})
@@ -561,24 +608,62 @@ class account_voucher(osv.osv):
# is not in the voucher currency
payment_rate_currency_id = voucher_line['currency_id']
tmp = currency_obj.browse(cr, uid, payment_rate_currency_id, context=ctx).rate
- voucher_currency_id = currency_id or journal.company_id.currency_id.id
- payment_rate = tmp / currency_obj.browse(cr, uid, voucher_currency_id, context=ctx).rate
+ payment_rate = tmp / currency_obj.browse(cr, uid, currency_id, context=ctx).rate
break
+ vals['value'].update({
+ 'payment_rate': payment_rate,
+ 'currency_id': currency_id,
+ 'payment_rate_currency_id': payment_rate_currency_id
+ })
+ #read the voucher rate with the right date in the context
+ voucher_rate = self.pool.get('res.currency').read(cr, uid, currency_id, ['rate'], context=ctx)['rate']
+ ctx.update({
+ 'voucher_special_currency_rate': payment_rate * voucher_rate,
+ 'voucher_special_currency': payment_rate_currency_id})
res = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx)
for key in res.keys():
vals[key].update(res[key])
- vals['value'].update({'payment_rate': payment_rate})
- if payment_rate_currency_id:
- vals['value'].update({'payment_rate_currency_id': payment_rate_currency_id})
return vals
+ def basic_onchange_partner(self, cr, uid, ids, partner_id, journal_id, ttype, context=None):
+ partner_pool = self.pool.get('res.partner')
+ journal_pool = self.pool.get('account.journal')
+ res = {'value': {'account_id': False}}
+ if not partner_id or not journal_id:
+ return res
+
+ journal = journal_pool.browse(cr, uid, journal_id, context=context)
+ partner = partner_pool.browse(cr, uid, partner_id, context=context)
+ account_id = False
+ if journal.type in ('sale','sale_refund'):
+ account_id = partner.property_account_receivable.id
+ elif journal.type in ('purchase', 'purchase_refund','expense'):
+ account_id = partner.property_account_payable.id
+ else:
+ account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
+
+ res['value']['account_id'] = account_id
+ return res
+
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=None):
if not journal_id:
return {}
- res = self.recompute_voucher_lines(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=context)
- vals = self.recompute_payment_rate(cr, uid, ids, res, currency_id, date, ttype, journal_id, amount, context=context)
+ if context is None:
+ context = {}
+ #TODO: comment me and use me directly in the sales/purchases views
+ res = self.basic_onchange_partner(cr, uid, ids, partner_id, journal_id, ttype, context=context)
+ if ttype in ['sale', 'purchase']:
+ return res
+ ctx = context.copy()
+ # not passing the payment_rate currency and the payment_rate in the context but it's ok because they are reset in recompute_payment_rate
+ ctx.update({'date': date})
+ vals = self.recompute_voucher_lines(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=ctx)
+ vals2 = self.recompute_payment_rate(cr, uid, ids, vals, currency_id, date, ttype, journal_id, amount, context=context)
for key in vals.keys():
res[key].update(vals[key])
+ for key in vals2.keys():
+ res[key].update(vals2[key])
+ #TODO: can probably be removed now
#TODO: onchange_partner_id() should not returns [pre_line, line_dr_ids, payment_rate...] for type sale, and not
# [pre_line, line_cr_ids, payment_rate...] for type purchase.
# We should definitively split account.voucher object in two and make distinct on_change functions. In the
@@ -621,8 +706,6 @@ class account_voucher(osv.osv):
if context is None:
context = {}
context_multi_currency = context.copy()
- if date:
- context_multi_currency.update({'date': date})
currency_pool = self.pool.get('res.currency')
move_line_pool = self.pool.get('account.move.line')
@@ -646,18 +729,6 @@ class account_voucher(osv.osv):
journal = journal_pool.browse(cr, uid, journal_id, context=context)
partner = partner_pool.browse(cr, uid, partner_id, context=context)
currency_id = currency_id or journal.company_id.currency_id.id
- account_id = False
- if journal.type in ('sale','sale_refund'):
- account_id = partner.property_account_receivable.id
- elif journal.type in ('purchase', 'purchase_refund','expense'):
- account_id = partner.property_account_payable.id
- else:
- account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
-
- default['value']['account_id'] = account_id
-
- if journal.type not in ('cash', 'bank'):
- return default
total_credit = 0.0
total_debit = 0.0
@@ -715,12 +786,13 @@ class account_voucher(osv.osv):
if _remove_noise_in_o2m():
continue
- if line.currency_id and currency_id==line.currency_id.id:
+ if line.currency_id and currency_id == line.currency_id.id:
amount_original = abs(line.amount_currency)
amount_unreconciled = abs(line.amount_residual_currency)
else:
- amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0)
- amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual))
+ #always use the amount booked in the company currency as the basis of the conversion into the voucher currency
+ amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0, context=context_multi_currency)
+ amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual), context=context_multi_currency)
line_currency_id = line.currency_id and line.currency_id.id or company_currency
rs = {
'name':line.move_id.name,
@@ -766,10 +838,15 @@ class account_voucher(osv.osv):
if context is None:
context = {}
res = {'value': {}}
- #set the default payment rate of the voucher and compute the paid amount in company currency
- if currency_id and currency_id == payment_rate_currency_id:
+ if currency_id:
+ #set the default payment rate of the voucher and compute the paid amount in company currency
ctx = context.copy()
ctx.update({'date': date})
+ #read the voucher rate with the right date in the context
+ voucher_rate = self.pool.get('res.currency').read(cr, uid, currency_id, ['rate'], context=ctx)['rate']
+ ctx.update({
+ 'voucher_special_currency_rate': payment_rate * voucher_rate,
+ 'voucher_special_currency': payment_rate_currency_id})
vals = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx)
for key in vals.keys():
res[key].update(vals[key])
@@ -789,7 +866,8 @@ class account_voucher(osv.osv):
period_pool = self.pool.get('account.period')
currency_obj = self.pool.get('res.currency')
ctx = context.copy()
- ctx.update({'company_id': company_id})
+ ctx.update({'company_id': company_id, 'account_period_prefer_normal': True})
+ voucher_currency_id = currency_id or self.pool.get('res.company').browse(cr, uid, company_id, context=ctx).currency_id.id
pids = period_pool.find(cr, uid, date, context=ctx)
if pids:
res['value'].update({'period_id':pids[0]})
@@ -798,9 +876,8 @@ class account_voucher(osv.osv):
payment_rate = 1.0
if payment_rate_currency_id != currency_id:
tmp = currency_obj.browse(cr, uid, payment_rate_currency_id, context=ctx).rate
- voucher_currency_id = currency_id or self.pool.get('res.company').browse(cr, uid, company_id, context=ctx).currency_id.id
payment_rate = tmp / currency_obj.browse(cr, uid, voucher_currency_id, context=ctx).rate
- vals = self.onchange_payment_rate_currency(cr, uid, ids, currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context=context)
+ vals = self.onchange_payment_rate_currency(cr, uid, ids, voucher_currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context=context)
vals['value'].update({'payment_rate': payment_rate})
for key in vals.keys():
res[key].update(vals[key])
@@ -823,7 +900,15 @@ class account_voucher(osv.osv):
currency_id = False
if journal.currency:
currency_id = journal.currency.id
+ else:
+ currency_id = journal.company_id.currency_id.id
vals['value'].update({'currency_id': currency_id})
+ #in case we want to register the payment directly from an invoice, it's confusing to allow to switch the journal
+ #without seeing that the amount is expressed in the journal currency, and not in the invoice currency. So to avoid
+ #this common mistake, we simply reset the amount to 0 if the currency is not the invoice currency.
+ if context.get('payment_expected_currency') and currency_id != context.get('payment_expected_currency'):
+ vals['value']['amount'] = 0
+ amount = 0
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context)
for key in res.keys():
vals[key].update(res[key])
@@ -905,8 +990,8 @@ class account_voucher(osv.osv):
current_currency = self._get_current_currency(cr, uid, voucher_id, context)
if current_currency <> company_currency:
context_multi_currency = context.copy()
- voucher_brw = self.pool.get('account.voucher').browse(cr, uid, voucher_id, context)
- context_multi_currency.update({'date': voucher_brw.date})
+ voucher = self.pool.get('account.voucher').browse(cr, uid, voucher_id, context)
+ context_multi_currency.update({'date': voucher.date})
return context_multi_currency
return context
@@ -921,33 +1006,33 @@ class account_voucher(osv.osv):
:return: mapping between fieldname and value of account move line to create
:rtype: dict
'''
- voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
+ voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
debit = credit = 0.0
# TODO: is there any other alternative then the voucher type ??
# ANSWER: We can have payment and receipt "In Advance".
# TODO: Make this logic available.
# -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt
- if voucher_brw.type in ('purchase', 'payment'):
- credit = voucher_brw.paid_amount_in_company_currency
- elif voucher_brw.type in ('sale', 'receipt'):
- debit = voucher_brw.paid_amount_in_company_currency
+ if voucher.type in ('purchase', 'payment'):
+ credit = voucher.paid_amount_in_company_currency
+ elif voucher.type in ('sale', 'receipt'):
+ debit = voucher.paid_amount_in_company_currency
if debit < 0: credit = -debit; debit = 0.0
if credit < 0: debit = -credit; credit = 0.0
sign = debit - credit < 0 and -1 or 1
#set the first line of the voucher
move_line = {
- 'name': voucher_brw.name or '/',
+ 'name': voucher.name or '/',
'debit': debit,
'credit': credit,
- 'account_id': voucher_brw.account_id.id,
+ 'account_id': voucher.account_id.id,
'move_id': move_id,
- 'journal_id': voucher_brw.journal_id.id,
- 'period_id': voucher_brw.period_id.id,
- 'partner_id': voucher_brw.partner_id.id,
+ 'journal_id': voucher.journal_id.id,
+ 'period_id': voucher.period_id.id,
+ 'partner_id': voucher.partner_id.id,
'currency_id': company_currency <> current_currency and current_currency or False,
- 'amount_currency': company_currency <> current_currency and sign * voucher_brw.amount or 0.0,
- 'date': voucher_brw.date,
- 'date_maturity': voucher_brw.date_due
+ 'amount_currency': company_currency <> current_currency and sign * voucher.amount or 0.0,
+ 'date': voucher.date,
+ 'date_maturity': voucher.date_due
}
return move_line
@@ -960,31 +1045,31 @@ class account_voucher(osv.osv):
:rtype: dict
'''
seq_obj = self.pool.get('ir.sequence')
- voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
- if voucher_brw.number:
- name = voucher_brw.number
- elif voucher_brw.journal_id.sequence_id:
- if not voucher_brw.journal_id.sequence_id.active:
+ voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
+ if voucher.number:
+ name = voucher.number
+ elif voucher.journal_id.sequence_id:
+ if not voucher.journal_id.sequence_id.active:
raise osv.except_osv(_('Configuration Error !'),
_('Please activate the sequence of selected journal !'))
c = dict(context)
- c.update({'fiscalyear_id': voucher_brw.period_id.fiscalyear_id.id})
- name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=c)
+ c.update({'fiscalyear_id': voucher.period_id.fiscalyear_id.id})
+ name = seq_obj.next_by_id(cr, uid, voucher.journal_id.sequence_id.id, context=c)
else:
raise osv.except_osv(_('Error!'),
_('Please define a sequence on the journal.'))
- if not voucher_brw.reference:
+ if not voucher.reference:
ref = name.replace('/','')
else:
- ref = voucher_brw.reference
+ ref = voucher.reference
move = {
'name': name,
- 'journal_id': voucher_brw.journal_id.id,
- 'narration': voucher_brw.narration,
- 'date': voucher_brw.date,
+ 'journal_id': voucher.journal_id.id,
+ 'narration': voucher.narration,
+ 'date': voucher.date,
'ref': ref,
- 'period_id': voucher_brw.period_id.id,
+ 'period_id': voucher.period_id.id,
}
return move
@@ -1011,7 +1096,10 @@ class account_voucher(osv.osv):
raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
# Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
# the receivable/payable account may have a secondary currency, which render this field mandatory
- account_currency_id = company_currency <> current_currency and current_currency or False
+ if line.account_id.currency_id:
+ account_currency_id = line.account_id.currency_id.id
+ else:
+ account_currency_id = company_currency <> current_currency and current_currency or False
move_line = {
'journal_id': line.voucher_id.journal_id.id,
'period_id': line.voucher_id.period_id.id,
@@ -1054,16 +1142,11 @@ class account_voucher(osv.osv):
:return: the amount in the currency of the voucher's company
:rtype: float
'''
+ if context is None:
+ context = {}
currency_obj = self.pool.get('res.currency')
voucher = self.browse(cr, uid, voucher_id, context=context)
- res = amount
- if voucher.payment_rate_currency_id.id == voucher.company_id.currency_id.id:
- # the rate specified on the voucher is for the company currency
- res = currency_obj.round(cr, uid, voucher.company_id.currency_id, (amount * voucher.payment_rate))
- else:
- # the rate specified on the voucher is not relevant, we use all the rates in the system
- res = currency_obj.compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, amount, context=context)
- return res
+ return currency_obj.compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, amount, context=context)
def voucher_move_line_create(self, cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context=None):
'''
@@ -1087,39 +1170,45 @@ class account_voucher(osv.osv):
tot_line = line_total
rec_lst_ids = []
- voucher_brw = self.pool.get('account.voucher').browse(cr, uid, voucher_id, context)
+ date = self.read(cr, uid, voucher_id, ['date'], context=context)['date']
ctx = context.copy()
- ctx.update({'date': voucher_brw.date})
+ ctx.update({'date': date})
+ voucher = self.pool.get('account.voucher').browse(cr, uid, voucher_id, context=ctx)
+ voucher_currency = voucher.journal_id.currency or voucher.company_id.currency_id
+ ctx.update({
+ 'voucher_special_currency_rate': voucher_currency.rate * voucher.payment_rate ,
+ 'voucher_special_currency': voucher.payment_rate_currency_id and voucher.payment_rate_currency_id.id or False,})
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
- for line in voucher_brw.line_ids:
+ 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)):
continue
# convert the amount set on the voucher line into the currency of the voucher's company
- amount = self._convert_amount(cr, uid, line.untax_amount or line.amount, voucher_brw.id, context=ctx)
+ # 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
+ amount = self._convert_amount(cr, uid, line.untax_amount or line.amount, voucher.id, context=ctx)
# if the amount encoded in voucher is equal to the amount unreconciled, we need to compute the
# currency rate difference
if line.amount == line.amount_unreconciled:
if not line.move_line_id:
raise osv.except_osv(_('Wrong voucher line'),_("The invoice you are willing to pay is not valid anymore."))
- sign = voucher_brw.type in ('payment', 'purchase') and -1 or 1
+ sign = voucher.type in ('payment', 'purchase') and -1 or 1
currency_rate_difference = sign * (line.move_line_id.amount_residual - amount)
else:
currency_rate_difference = 0.0
move_line = {
- 'journal_id': voucher_brw.journal_id.id,
- 'period_id': voucher_brw.period_id.id,
+ 'journal_id': voucher.journal_id.id,
+ 'period_id': voucher.period_id.id,
'name': line.name or '/',
'account_id': line.account_id.id,
'move_id': move_id,
- 'partner_id': voucher_brw.partner_id.id,
+ 'partner_id': voucher.partner_id.id,
'currency_id': line.move_line_id and (company_currency <> line.move_line_id.currency_id.id and line.move_line_id.currency_id.id) or False,
'analytic_account_id': line.account_analytic_id and line.account_analytic_id.id or False,
'quantity': 1,
'credit': 0.0,
'debit': 0.0,
- 'date': voucher_brw.date
+ 'date': voucher.date
}
if amount < 0:
amount = -amount
@@ -1135,9 +1224,9 @@ class account_voucher(osv.osv):
tot_line -= amount
move_line['credit'] = amount
- if voucher_brw.tax_id and voucher_brw.type in ('sale', 'purchase'):
+ if voucher.tax_id and voucher.type in ('sale', 'purchase'):
move_line.update({
- 'account_tax_id': voucher_brw.tax_id.id,
+ 'account_tax_id': voucher.tax_id.id,
})
if move_line.get('account_tax_id', False):
@@ -1149,7 +1238,6 @@ class account_voucher(osv.osv):
foreign_currency_diff = 0.0
amount_currency = False
if line.move_line_id:
- voucher_currency = voucher_brw.currency_id and voucher_brw.currency_id.id or voucher_brw.journal_id.company_id.currency_id.id
# We want to set it on the account move line as soon as the original line had a foreign currency
if line.move_line_id.currency_id and line.move_line_id.currency_id.id != company_currency:
# we compute the amount in that foreign currency.
@@ -1157,22 +1245,19 @@ class account_voucher(osv.osv):
# if the voucher and the voucher line share the same currency, there is no computation to do
sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1
amount_currency = sign * (line.amount)
- elif line.move_line_id.currency_id.id == voucher_brw.payment_rate_currency_id.id:
- # if the rate is specified on the voucher, we must use it
- voucher_rate = currency_obj.browse(cr, uid, voucher_currency, context=ctx).rate
- amount_currency = (move_line['debit'] - move_line['credit']) * voucher_brw.payment_rate * voucher_rate
else:
- # otherwise we use the rates of the system (giving the voucher date in the context)
+ # if the rate is specified on the voucher, it will be used thanks to the special keys in the context
+ # otherwise we use the rates of the system
amount_currency = currency_obj.compute(cr, uid, company_currency, line.move_line_id.currency_id.id, move_line['debit']-move_line['credit'], context=ctx)
- if line.amount == line.amount_unreconciled and line.move_line_id.currency_id.id == voucher_currency:
- sign = voucher_brw.type in ('payment', 'purchase') and -1 or 1
+ if line.amount == line.amount_unreconciled:
+ sign = voucher.type in ('payment', 'purchase') and -1 or 1
foreign_currency_diff = sign * line.move_line_id.amount_residual_currency + amount_currency
move_line['amount_currency'] = amount_currency
voucher_line = move_line_obj.create(cr, uid, move_line)
rec_ids = [voucher_line, line.move_line_id.id]
- if not currency_obj.is_zero(cr, uid, voucher_brw.company_id.currency_id, currency_rate_difference):
+ if not currency_obj.is_zero(cr, uid, voucher.company_id.currency_id, currency_rate_difference):
# Change difference entry in company currency
exch_lines = self._get_exchange_lines(cr, uid, line, move_id, currency_rate_difference, company_currency, current_currency, context=context)
new_id = move_line_obj.create(cr, uid, exch_lines[0],context)
@@ -1219,32 +1304,32 @@ class account_voucher(osv.osv):
currency_obj = self.pool.get('res.currency')
move_line = {}
- voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
- current_currency_obj = voucher_brw.currency_id or voucher_brw.journal_id.company_id.currency_id
+ voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
+ current_currency_obj = voucher.currency_id or voucher.journal_id.company_id.currency_id
if not currency_obj.is_zero(cr, uid, current_currency_obj, line_total):
diff = line_total
account_id = False
write_off_name = ''
- if voucher_brw.payment_option == 'with_writeoff':
- account_id = voucher_brw.writeoff_acc_id.id
- write_off_name = voucher_brw.comment
- elif voucher_brw.type in ('sale', 'receipt'):
- account_id = voucher_brw.partner_id.property_account_receivable.id
+ if voucher.payment_option == 'with_writeoff':
+ account_id = voucher.writeoff_acc_id.id
+ write_off_name = voucher.comment
+ elif voucher.type in ('sale', 'receipt'):
+ account_id = voucher.partner_id.property_account_receivable.id
else:
- account_id = voucher_brw.partner_id.property_account_payable.id
- sign = voucher_brw.type == 'payment' and -1 or 1
+ account_id = voucher.partner_id.property_account_payable.id
+ sign = voucher.type == 'payment' and -1 or 1
move_line = {
'name': write_off_name or name,
'account_id': account_id,
'move_id': move_id,
- 'partner_id': voucher_brw.partner_id.id,
- 'date': voucher_brw.date,
+ 'partner_id': voucher.partner_id.id,
+ 'date': voucher.date,
'credit': diff > 0 and diff or 0.0,
'debit': diff < 0 and -diff or 0.0,
- 'amount_currency': company_currency <> current_currency and (sign * -1 * voucher_brw.writeoff_amount) or False,
+ 'amount_currency': company_currency <> current_currency and (sign * -1 * voucher.writeoff_amount) or False,
'currency_id': company_currency <> current_currency and current_currency or False,
- 'analytic_account_id': voucher_brw.analytic_id and voucher_brw.analytic_id.id or False,
+ 'analytic_account_id': voucher.analytic_id and voucher.analytic_id.id or False,
}
return move_line
@@ -1345,13 +1430,17 @@ class account_voucher_line(osv.osv):
_order = "move_line_id"
# If the payment is in the same currency than the invoice, we keep the same amount
- # Otherwise, we compute from company currency to payment currency
+ # Otherwise, we compute from invoice currency to payment currency
def _compute_balance(self, cr, uid, ids, name, args, context=None):
currency_pool = self.pool.get('res.currency')
rs_data = {}
for line in self.browse(cr, uid, ids, context=context):
ctx = context.copy()
ctx.update({'date': line.voucher_id.date})
+ voucher_rate = self.pool.get('res.currency').read(cr, uid, line.voucher_id.currency_id.id, ['rate'], context=ctx)['rate']
+ ctx.update({
+ 'voucher_special_currency': line.voucher_id.payment_rate_currency_id and line.voucher_id.payment_rate_currency_id.id or False,
+ 'voucher_special_currency_rate': line.voucher_id.payment_rate * voucher_rate})
res = {}
company_currency = line.voucher_id.journal_id.company_id.currency_id.id
voucher_currency = line.voucher_id.currency_id and line.voucher_id.currency_id.id or company_currency
@@ -1361,13 +1450,11 @@ class account_voucher_line(osv.osv):
res['amount_original'] = 0.0
res['amount_unreconciled'] = 0.0
elif move_line.currency_id and voucher_currency==move_line.currency_id.id:
- res['amount_original'] = currency_pool.compute(cr, uid, move_line.currency_id.id, voucher_currency, abs(move_line.amount_currency), context=ctx)
- res['amount_unreconciled'] = currency_pool.compute(cr, uid, move_line.currency_id and move_line.currency_id.id or company_currency, voucher_currency, abs(move_line.amount_residual_currency), context=ctx)
- elif move_line and move_line.credit > 0:
- res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit, context=ctx)
- res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), context=ctx)
+ res['amount_original'] = abs(move_line.amount_currency)
+ res['amount_unreconciled'] = abs(move_line.amount_residual_currency)
else:
- res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit, context=ctx)
+ #always use the amount booked in the company currency as the basis of the conversion into the voucher currency
+ res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit or move_line.debit or 0.0, context=ctx)
res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), context=ctx)
rs_data[line.id] = res
diff --git a/addons/account_voucher/html/account_illu_01.png b/addons/account_voucher/html/account_illu_01.png
new file mode 100644
index 00000000000..2e0dbf4aac2
Binary files /dev/null and b/addons/account_voucher/html/account_illu_01.png differ
diff --git a/addons/account_voucher/html/account_sc_00.png b/addons/account_voucher/html/account_sc_00.png
new file mode 100644
index 00000000000..63332b46575
Binary files /dev/null and b/addons/account_voucher/html/account_sc_00.png differ
diff --git a/addons/account_voucher/html/account_sc_02.png b/addons/account_voucher/html/account_sc_02.png
new file mode 100644
index 00000000000..709e444ba0d
Binary files /dev/null and b/addons/account_voucher/html/account_sc_02.png differ
diff --git a/addons/account_voucher/html/account_sc_03.png b/addons/account_voucher/html/account_sc_03.png
new file mode 100644
index 00000000000..a3e3afc34c0
Binary files /dev/null and b/addons/account_voucher/html/account_sc_03.png differ
diff --git a/addons/account_voucher/html/account_sc_04.png b/addons/account_voucher/html/account_sc_04.png
new file mode 100644
index 00000000000..458c8280c26
Binary files /dev/null and b/addons/account_voucher/html/account_sc_04.png differ
diff --git a/addons/account_voucher/html/account_sc_06.png b/addons/account_voucher/html/account_sc_06.png
new file mode 100644
index 00000000000..9605506c6a5
Binary files /dev/null and b/addons/account_voucher/html/account_sc_06.png differ
diff --git a/addons/account_voucher/html/bazile.png b/addons/account_voucher/html/bazile.png
new file mode 100644
index 00000000000..30f37e70b4a
Binary files /dev/null and b/addons/account_voucher/html/bazile.png differ
diff --git a/addons/account_voucher/html/index.html b/addons/account_voucher/html/index.html
new file mode 100644
index 00000000000..d59c110dde5
--- /dev/null
+++ b/addons/account_voucher/html/index.html
@@ -0,0 +1,140 @@
+
+
+ Create and send professional looking invoices & get paid
+ online. It automatically integrates with other apps to bill
+ automatically based on your activities.
+
+ Send invoices directly to your clients in just a click. The
+ invoice is automatically attached to the email as a PDF file.
+
+
+
+
+
+
+
+
+
+
+
Get Paid Faster
+
Electronic invoicing and automated follow-ups
+
+
+
+
+
+
+Get paid online with paypal or other payment processing service. Get rid of
+the stress of having to constantly remind your debtors. Simply set-up and
+automate follow-ups to get paid quickly.
+
+
+
+
+
+
+
+
+
Connect Your Bank Accounts
+
+
+Import your bank statements and reconcile them in just a few clicks. Prepare
+payment orders based on your supplier invoices and payment terms.
+
+
+
+
+
+
+
+
+
+
+
+
Analyse Your Sales & Costs
+
+
+
+
+
+Get direct access to key information with dynamic and customizable dashboards.
+Analyse your invoicing by product, customer, salesperson, etc.
+
+
+
+
+
+
+
+
Integration With Other Apps
+
+
+Bill automatically based on sales orders, delivery orders, contracts or on time and
+material. Define recurrencies to produce recurring invoice automatically.
+
+
+
+
+
+
+
+
+
+
+
+
Many companies already enjoy it
+
Hear what they have to say !
+
+
+
+
+ OpenERP allowed us to automate sending 10.000 invoices per month.
+
+
+
+
Примечание: если вы не запрашивали сброс пароля, просто проигнорируйте "
+"данное письмо
"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:111
#, python-format
msgid "Please enter a name."
-msgstr ""
+msgstr "Пожалуйста, введите имя"
#. module: auth_signup
#: model:ir.model,name:auth_signup.model_res_users
msgid "Users"
-msgstr ""
+msgstr "Пользователи"
#. module: auth_signup
#: field:res.partner,signup_url:0
@@ -146,7 +155,7 @@ msgstr "Пожалуйста, введите имя пользователя."
#. module: auth_signup
#: selection:res.users,state:0
msgid "Active"
-msgstr ""
+msgstr "Активен"
#. module: auth_signup
#: code:addons/auth_signup/res_users.py:269
@@ -155,39 +164,41 @@ msgid ""
"Cannot send email: no outgoing email server configured.\n"
"You can configure it under Settings/General Settings."
msgstr ""
+"Невозможно отправить email: не настроены сервера исходящей почты.\n"
+"Вы можете настроить их в меню Настройки/Общие настройки"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:12
#, python-format
msgid "Username"
-msgstr ""
+msgstr "Имя пользователя"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:8
#, python-format
msgid "Name"
-msgstr ""
+msgstr "Имя"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:170
#, python-format
msgid "Please enter a username or email address."
-msgstr ""
+msgstr "Пожалуйста, введите имя пользователя или адрес эл. почты."
#. module: auth_signup
#: selection:res.users,state:0
msgid "Resetting Password"
-msgstr ""
+msgstr "Переустановка пароля"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:13
#, python-format
msgid "Username (Email)"
-msgstr ""
+msgstr "Имя пользователя (Email)"
#. module: auth_signup
#: field:res.partner,signup_expiration:0
@@ -198,13 +209,15 @@ msgstr ""
#: help:base.config.settings,auth_signup_reset_password:0
msgid "This allows users to trigger a password reset from the Login page."
msgstr ""
+"Это позволяет пользователям запросить сброс пароля со страницы входа в "
+"систему."
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:22
#, python-format
msgid "Log in"
-msgstr ""
+msgstr "Вход"
#. module: auth_signup
#: field:res.partner,signup_valid:0
@@ -222,7 +235,7 @@ msgstr ""
#: code:addons/auth_signup/static/src/js/auth_signup.js:170
#, python-format
msgid "Login"
-msgstr ""
+msgstr "Вход"
#. module: auth_signup
#. openerp-web
@@ -236,7 +249,7 @@ msgstr ""
#: code:addons/auth_signup/static/src/js/auth_signup.js:120
#, python-format
msgid "Passwords do not match; please retype them."
-msgstr ""
+msgstr "Пароли не совпадают; пожалуйста, введите их заново."
#. module: auth_signup
#. openerp-web
@@ -244,7 +257,7 @@ msgstr ""
#: code:addons/auth_signup/static/src/js/auth_signup.js:167
#, python-format
msgid "No database selected !"
-msgstr ""
+msgstr "Не выбрана база данных!"
#. module: auth_signup
#: view:res.users:0
@@ -254,14 +267,14 @@ msgstr ""
#. module: auth_signup
#: field:base.config.settings,auth_signup_reset_password:0
msgid "Enable password reset from Login page"
-msgstr ""
+msgstr "Включить сброс пароля со страницы входа"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:27
#, python-format
msgid "Back to Login"
-msgstr ""
+msgstr "Вернуться к странице входа"
#. module: auth_signup
#. openerp-web
@@ -273,7 +286,7 @@ msgstr ""
#. module: auth_signup
#: model:ir.model,name:auth_signup.model_res_partner
msgid "Partner"
-msgstr ""
+msgstr "Партнер"
#. module: auth_signup
#: field:res.partner,signup_token:0
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index f4a985280ac..ad28bbb1d57 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -23,6 +23,7 @@ import random
from urllib import urlencode
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
@@ -103,6 +104,9 @@ class res_partner(osv.Model):
def action_signup_prepare(self, cr, uid, ids, context=None):
return self.signup_prepare(cr, uid, ids, context=context)
+ def signup_cancel(self, cr, uid, ids, context=None):
+ return self.write(cr, uid, ids, {'signup_token': False, 'signup_type': False, 'signup_expiration': False}, context=context)
+
def signup_prepare(self, cr, uid, ids, signup_type="signup", expiration=False, context=None):
""" generate a new token for the partners with the given validity, if necessary
:param expiration: the expiration datetime of the token (string, optional)
@@ -202,7 +206,7 @@ class res_users(osv.Model):
})
if partner.company_id:
values['company_id'] = partner.company_id.id
- values['company_ids'] = [(6,0,[partner.company_id.id])]
+ values['company_ids'] = [(6, 0, [partner.company_id.id])]
self._signup_create_user(cr, uid, values, context=context)
else:
# no token, sign up an external user
@@ -259,25 +263,26 @@ class res_users(osv.Model):
pass
if not bool(template):
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email')
- mail_obj = self.pool.get('mail.mail')
assert template._name == 'email.template'
for user in self.browse(cr, uid, ids, context):
if not user.email:
raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
- mail_id = self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, True, context=context)
- mail_state = mail_obj.read(cr, uid, mail_id, ['state'], context=context)
-
- if mail_state and mail_state['state'] == 'exception':
- raise self.pool.get('res.config.settings').get_config_warning(cr, _("Cannot send email: no outgoing email server configured.\nYou can configure it under %(menu:base_setup.menu_general_configuration)s."), context)
- else:
- return True
+ try:
+ self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, force_send=True, raise_exception=True, context=context)
+ except Exception:
+ raise
def create(self, cr, uid, values, context=None):
+ if context is None:
+ context = {}
# overridden to automatically invite user to sign up
user_id = super(res_users, self).create(cr, uid, values, context=context)
user = self.browse(cr, uid, user_id, context=context)
- if context and context.get('reset_password') and user.email:
- ctx = dict(context, create_user=True)
- self.action_reset_password(cr, uid, [user.id], context=ctx)
+ if user.email and not context.get('no_reset_password'):
+ context.update({'create_user': True})
+ try:
+ self.action_reset_password(cr, uid, [user.id], context=context)
+ except MailDeliveryException:
+ self.pool.get('res.partner').signup_cancel(cr, uid, [user.partner_id.id], context=context)
return user_id
diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml
index 28f66eb101d..60c419db737 100644
--- a/addons/auth_signup/res_users_view.xml
+++ b/addons/auth_signup/res_users_view.xml
@@ -31,9 +31,11 @@
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index bbaf907c625..545ee6cf60e 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -57,14 +57,14 @@ openerp.auth_signup = function(instance) {
self.signup_enabled = result.signup;
self.reset_password_enabled = result.reset_password;
if (!self.signup_enabled || self.$("form input[name=login]").val()){
- self.set('login_mode', 'default');
+ self.set('login_mode', self.params.type || 'default');
} else {
self.set('login_mode', 'signup');
}
});
} else {
// TODO: support multiple database mode
- self.set('login_mode', 'default');
+ self.set('login_mode', self.params.type || 'default');
}
});
},
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 9d7d4d34ac4..9309f790013 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -50,6 +50,7 @@ class base_action_rule(osv.osv):
_name = 'base.action.rule'
_description = 'Action Rules'
+ _order = 'sequence'
_columns = {
'name': fields.char('Rule Name', size=64, required=True),
@@ -61,6 +62,9 @@ class base_action_rule(osv.osv):
help="When unchecked, the rule is hidden and will not be executed."),
'sequence': fields.integer('Sequence',
help="Gives the sequence order when displaying a list of rules."),
+ 'kind': fields.selection(
+ [('on_create', 'On Creation'), ('on_write', 'On Update'), ('on_time', 'Based on Timed Condition')],
+ string='When to Run'),
'trg_date_id': fields.many2one('ir.model.fields', string='Trigger Date',
domain="[('model_id', '=', model_id), ('ttype', 'in', ('date', 'datetime'))]"),
'trg_date_range': fields.integer('Delay after trigger date',
@@ -78,10 +82,10 @@ class base_action_rule(osv.osv):
ondelete='restrict',
domain="[('model_id', '=', model_id.model)]",
help="If present, this condition must be satisfied before the update of the record."),
- 'filter_id': fields.many2one('ir.filters', string='After Update Filter',
+ 'filter_id': fields.many2one('ir.filters', string='Filter',
ondelete='restrict',
domain="[('model_id', '=', model_id.model)]",
- help="If present, this condition must be satisfied after the update of the record."),
+ help="If present, this condition must be satisfied before executing the action rule."),
'last_run': fields.datetime('Last Run', readonly=1),
}
@@ -90,7 +94,15 @@ class base_action_rule(osv.osv):
'trg_date_range_type': 'day',
}
- _order = 'sequence'
+ def onchange_kind(self, cr, uid, ids, kind, context=None):
+ clear_fields = []
+ if kind == 'on_create':
+ clear_fields = ['filter_pre_id', 'trg_date_id', 'trg_date_range', 'trg_date_range_type']
+ elif kind == 'on_write':
+ clear_fields = ['trg_date_id', 'trg_date_range', 'trg_date_range_type']
+ elif kind == 'on_time':
+ clear_fields = ['filter_pre_id']
+ return {'value': dict.fromkeys(clear_fields, False)}
def _filter(self, cr, uid, action, action_filter, record_ids, context=None):
""" filter the list record_ids that satisfy the action filter """
@@ -105,14 +117,7 @@ class base_action_rule(osv.osv):
def _process(self, cr, uid, action, record_ids, context=None):
""" process the given action on the records """
- # execute server actions
model = self.pool[action.model_id.model]
- if action.server_action_ids:
- server_action_ids = map(int, action.server_action_ids)
- for record in model.browse(cr, uid, record_ids, context):
- action_server_obj = self.pool.get('ir.actions.server')
- ctx = dict(context, active_model=model._name, active_ids=[record.id], active_id=record.id)
- action_server_obj.run(cr, uid, server_action_ids, context=ctx)
# modify records
values = {}
@@ -127,13 +132,21 @@ class base_action_rule(osv.osv):
follower_ids = map(int, action.act_followers)
model.message_subscribe(cr, uid, record_ids, follower_ids, context=context)
+ # execute server actions
+ if action.server_action_ids:
+ server_action_ids = map(int, action.server_action_ids)
+ for record in model.browse(cr, uid, record_ids, context):
+ action_server_obj = self.pool.get('ir.actions.server')
+ ctx = dict(context, active_model=model._name, active_ids=[record.id], active_id=record.id)
+ action_server_obj.run(cr, uid, server_action_ids, context=ctx)
+
return True
def _wrap_create(self, old_create, model):
""" Return a wrapper around `old_create` calling both `old_create` and
`_process`, in that order.
"""
- def wrapper(cr, uid, vals, context=None):
+ def create(cr, uid, vals, context=None):
# avoid loops or cascading actions
if context and context.get('action'):
return old_create(cr, uid, vals, context=context)
@@ -141,8 +154,8 @@ class base_action_rule(osv.osv):
context = dict(context or {}, action=True)
new_id = old_create(cr, uid, vals, context=context)
- # as it is a new record, we do not consider the actions that have a prefilter
- action_dom = [('model', '=', model), ('trg_date_id', '=', False), ('filter_pre_id', '=', False)]
+ # retrieve the action rules to run on creation
+ action_dom = [('model', '=', model), ('kind', '=', 'on_create')]
action_ids = self.search(cr, uid, action_dom, context=context)
# check postconditions, and execute actions on the records that satisfy them
@@ -151,13 +164,13 @@ class base_action_rule(osv.osv):
self._process(cr, uid, action, [new_id], context=context)
return new_id
- return wrapper
+ return create
def _wrap_write(self, old_write, model):
""" Return a wrapper around `old_write` calling both `old_write` and
`_process`, in that order.
"""
- def wrapper(cr, uid, ids, vals, context=None):
+ def write(cr, uid, ids, vals, context=None):
# avoid loops or cascading actions
if context and context.get('action'):
return old_write(cr, uid, ids, vals, context=context)
@@ -165,8 +178,8 @@ class base_action_rule(osv.osv):
context = dict(context or {}, action=True)
ids = [ids] if isinstance(ids, (int, long, str)) else ids
- # retrieve the action rules to possibly execute
- action_dom = [('model', '=', model), ('trg_date_id', '=', False)]
+ # retrieve the action rules to run on update
+ action_dom = [('model', '=', model), ('kind', '=', 'on_write')]
action_ids = self.search(cr, uid, action_dom, context=context)
actions = self.browse(cr, uid, action_ids, context=context)
@@ -185,7 +198,7 @@ class base_action_rule(osv.osv):
self._process(cr, uid, action, post_ids, context=context)
return True
- return wrapper
+ return write
def _register_hook(self, cr, ids=None):
""" Wrap the methods `create` and `write` of the models specified by
@@ -224,8 +237,8 @@ class base_action_rule(osv.osv):
def _check(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
""" This Function is called by scheduler. """
context = context or {}
- # retrieve all the action rules that have a trg_date_id and no precondition
- action_dom = [('trg_date_id', '!=', False), ('filter_pre_id', '=', False)]
+ # retrieve all the action rules to run based on a timed condition
+ action_dom = [('kind', '=', 'on_time')]
action_ids = self.search(cr, uid, action_dom, context=context)
for action in self.browse(cr, uid, action_ids, context=context):
now = datetime.now()
diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml
index 5eaaf08dad4..c2262adde39 100644
--- a/addons/base_action_rule/base_action_rule_view.xml
+++ b/addons/base_action_rule/base_action_rule_view.xml
@@ -26,24 +26,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
- Select a filter or a timer as condition. An action rule is checked when you create or modify the "Related Document Model". The precondition filter is checked right before the modification while the postcondition filter is checked after the modification. A precondition filter will therefore not work during a creation.
- To create a new filter:
- - Go to your "Related Document Model" page and set the filter parameters in the "Search" view (Example of filter based on Leads/Opportunities: Creation Date "is equal to" 01/01/2012)
- - In this same "Search" view, select the menu "Save Current Filter", enter the name (Ex: Create the 01/01/2012) and add the option "Share with all users"
+
+ Select when the action must be run, and add filters and/or timing conditions.
+
+ In order to create a new filter:
+
+
Go to your "Related Document Model" page and set the filter parameters in the "Search" view (Example of filter based on Leads/Opportunities: Creation Date "is equal to" 01/01/2012)
+
In this same "Search" view, select the menu "Save Current Filter", enter the name (Ex: Create the 01/01/2012) and add the option "Share with all users"
+
The filter must therefore be available in this page.
@@ -76,6 +84,7 @@
+
diff --git a/addons/base_action_rule/i18n/ru.po b/addons/base_action_rule/i18n/ru.po
index c8673c26815..3ca5b1eab04 100644
--- a/addons/base_action_rule/i18n/ru.po
+++ b/addons/base_action_rule/i18n/ru.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-05-10 18:17+0000\n"
-"Last-Translator: Raphael Collet (OpenERP) \n"
+"PO-Revision-Date: 2013-05-31 10:23+0000\n"
+"Last-Translator: Chertykov Denis \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-03-16 05:46+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-06-01 05:16+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: base_action_rule
#: selection:base.action.rule.lead.test,state:0
@@ -58,7 +58,7 @@ msgstr "Добавить подписчиков"
#. module: base_action_rule
#: field:base.action.rule,act_user_id:0
msgid "Set Responsible"
-msgstr ""
+msgstr "Указать ответственного"
#. module: base_action_rule
#: help:base.action.rule,trg_date_range:0
@@ -71,7 +71,7 @@ msgstr ""
#. module: base_action_rule
#: model:ir.model,name:base_action_rule.model_base_action_rule_lead_test
msgid "base.action.rule.lead.test"
-msgstr ""
+msgstr "base.action.rule.lead.test"
#. module: base_action_rule
#: selection:base.action.rule.lead.test,state:0
@@ -142,7 +142,7 @@ msgstr "Часы"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "To create a new filter:"
-msgstr ""
+msgstr "Для создания нового фильтра:"
#. module: base_action_rule
#: field:base.action.rule,active:0
@@ -167,7 +167,7 @@ msgstr ""
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Filter Condition"
-msgstr ""
+msgstr "Условие фильтра"
#. module: base_action_rule
#: view:base.action.rule:0
@@ -216,7 +216,7 @@ msgstr "Тип задержки"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Server actions to run"
-msgstr ""
+msgstr "Действия сервера для запуска"
#. module: base_action_rule
#: help:base.action.rule,active:0
@@ -246,7 +246,7 @@ msgstr "Минуты"
#. module: base_action_rule
#: field:base.action.rule,model_id:0
msgid "Related Document Model"
-msgstr ""
+msgstr "Модель связанного документа"
#. module: base_action_rule
#: help:base.action.rule,filter_pre_id:0
@@ -310,7 +310,7 @@ msgstr "Действия сервера"
#. module: base_action_rule
#: field:base.action.rule.lead.test,name:0
msgid "Subject"
-msgstr ""
+msgstr "Тема"
#~ msgid "Set State to"
#~ msgstr "Уснатовить состояние в"
diff --git a/addons/base_action_rule/tests/base_action_rule_test.py b/addons/base_action_rule/tests/base_action_rule_test.py
index 36c928a84e3..54c72ba0607 100644
--- a/addons/base_action_rule/tests/base_action_rule_test.py
+++ b/addons/base_action_rule/tests/base_action_rule_test.py
@@ -19,8 +19,8 @@ class base_action_rule_test(common.TransactionCase):
'name': "Lead is in done state",
'is_default': False,
'model_id': 'base.action.rule.lead.test',
- 'domain' : "[('state','=','done')]",
- }, context=context)
+ 'domain': "[('state','=','done')]",
+ }, context=context)
def create_filter_draft(self, cr, uid, context=None):
filter_pool = self.registry('ir.filters')
@@ -40,16 +40,16 @@ class base_action_rule_test(common.TransactionCase):
'user_id': self.admin,
}, context=context)
- def create_rule(self, cr, uid, filter_id=False, filter_pre_id=False, context=None):
+ def create_rule(self, cr, uid, kind, filter_id=False, filter_pre_id=False, context=None):
"""
The "Rule 1" says that when a lead goes to the 'draft' state, the responsible for that lead changes to user "demo"
"""
return self.base_action_rule.create(cr,uid,{
- 'name' : "Rule 1",
+ 'name': "Rule 1",
'model_id': self.registry('ir.model').search(cr, uid, [('model','=','base.action.rule.lead.test')], context=context)[0],
- 'active' : 1,
- 'filter_pre_id' : filter_pre_id,
- 'filter_id' : filter_id,
+ 'kind': kind,
+ 'filter_pre_id': filter_pre_id,
+ 'filter_id': filter_id,
'act_user_id': self.demo,
}, context=context)
@@ -64,7 +64,7 @@ class base_action_rule_test(common.TransactionCase):
"""
cr, uid = self.cr, self.uid
filter_draft = self.create_filter_draft(cr, uid)
- self.create_rule(cr, uid, filter_pre_id=filter_draft)
+ self.create_rule(cr, uid, 'on_write', filter_pre_id=filter_draft)
new_lead_id = self.create_lead_test_1(cr, uid)
new_lead = self.model.browse(cr, uid, new_lead_id)
self.assertEquals(new_lead.state, 'draft')
@@ -73,11 +73,11 @@ class base_action_rule_test(common.TransactionCase):
def test_01_check_to_state_draft_post(self):
"""
- Check that a new record (with state = draft) changes its responsible when there is a postcondition filter which check that the state is draft.
+ Check that a new record changes its responsible when there is a postcondition filter which check that the state is draft.
"""
cr, uid = self.cr, self.uid
filter_draft = self.create_filter_draft(cr, uid)
- self.create_rule(cr, uid, filter_id=filter_draft)
+ self.create_rule(cr, uid, 'on_create')
new_lead_id = self.create_lead_test_1(cr, uid)
new_lead = self.model.browse(cr, uid, new_lead_id)
self.assertEquals(new_lead.state, 'draft')
@@ -95,7 +95,7 @@ class base_action_rule_test(common.TransactionCase):
cr, uid = self.cr, self.uid
filter_draft = self.create_filter_draft(cr, uid)
filter_done = self.create_filter_done(cr, uid)
- self.create_rule(cr, uid, filter_pre_id=filter_draft, filter_id=filter_done)
+ self.create_rule(cr, uid, 'on_write', filter_pre_id=filter_draft, filter_id=filter_done)
new_lead_id = self.create_lead_test_1(cr, uid)
new_lead = self.model.browse(cr, uid, new_lead_id)
self.assertEquals(new_lead.state, 'draft')
@@ -133,7 +133,7 @@ class base_action_rule_test(common.TransactionCase):
cr, uid = self.cr, self.uid
filter_draft = self.create_filter_draft(cr, uid)
filter_done = self.create_filter_done(cr, uid)
- self.create_rule(cr, uid, filter_pre_id=filter_draft, filter_id=filter_done)
+ self.create_rule(cr, uid, 'on_write', filter_pre_id=filter_draft, filter_id=filter_done)
new_lead_id = self.create_lead_test_1(cr, uid)
new_lead = self.model.browse(cr, uid, new_lead_id)
self.assertEquals(new_lead.state, 'draft')
diff --git a/addons/base_import/static/lib/select2/README.md b/addons/base_import/static/lib/select2/README.md
old mode 100755
new mode 100644
diff --git a/addons/base_import/static/lib/select2/select2.css b/addons/base_import/static/lib/select2/select2.css
old mode 100755
new mode 100644
diff --git a/addons/base_import/static/lib/select2/select2.js b/addons/base_import/static/lib/select2/select2.js
old mode 100755
new mode 100644
diff --git a/addons/base_import/static/lib/select2/spinner.gif b/addons/base_import/static/lib/select2/spinner.gif
old mode 100755
new mode 100644
diff --git a/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py b/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py
old mode 100644
new mode 100755
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
index 43b452b82e2..9fb6cd11219 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import uno
from com.sun.star.task import XJobExecutor
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py
index ba69174ffc6..2dce1750e34 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import os
import uno
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py
index b85a9d9bb06..e0b66780e8b 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import string
import unohelper
@@ -72,7 +49,7 @@ class Change( unohelper.Base, XJobExecutor ):
'XML-RPC': 'http://',
'XML-RPC secure': 'https://',
'NET-RPC': 'socket://',
- }
+ }
host=port=protocol=''
if docinfo.getUserFieldValue(0):
m = re.match('^(http[s]?://|socket://)([\w.\-]+):(\d{1,5})$', docinfo.getUserFieldValue(0) or '')
@@ -80,7 +57,7 @@ class Change( unohelper.Base, XJobExecutor ):
port = m.group(3)
protocol = m.group(1)
if protocol:
- for (key, value) in self.protocol.iteritems():
+ for (key, value) in self.protocol.iteritems():
if value==protocol:
protocol=key
break
@@ -102,7 +79,7 @@ class Change( unohelper.Base, XJobExecutor ):
self.win.addButton( 'btnNext', -2, -5, 30, 15, 'Next', actionListenerProc = self.btnNext_clicked )
self.win.addButton( 'btnCancel', -2 - 30 - 5 ,-5, 30, 15, 'Cancel', actionListenerProc = self.btnCancel_clicked )
-
+
for i in self.protocol.keys():
self.lstProtocol.addItem(i,self.lstProtocol.getItemCount() )
self.win.doModalDialog( "lstProtocol", protocol)
@@ -110,27 +87,27 @@ class Change( unohelper.Base, XJobExecutor ):
def btnNext_clicked(self, oActionEvent):
global url
aVal=''
- #aVal= Fetature used
+ #aVal= Fetature used
try:
url = self.protocol[self.win.getListBoxSelectedItem("lstProtocol")]+self.win.getEditText("txtHost")+":"+self.win.getEditText("txtPort")
self.sock=RPCSession(url)
desktop=getDesktop()
doc = desktop.getCurrentComponent()
- docinfo=doc.getDocumentInfo()
+ docinfo=doc.getDocumentInfo()
docinfo.setUserFieldValue(0,url)
res=self.sock.listdb()
self.win.endExecute()
ServerParameter(aVal,url)
except :
- import traceback,sys
+ import traceback,sys
info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
- self.logobj.log_write('ServerParameter', LOG_ERROR, info)
+ self.logobj.log_write('ServerParameter', LOG_ERROR, info)
ErrorDialog("Connection to server is fail. Please check your Server Parameter.", "", "Error!")
self.win.endExecute()
-
+
def btnCancel_clicked(self,oActionEvent):
self.win.endExecute()
-
+
if __name__<>"package" and __name__=="__main__":
Change(None)
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py
index c1fa8b22a85..17cc25687b1 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import unohelper
import string
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
index ffa88a8cd06..b8abcb1dc6c 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import uno
import unohelper
@@ -81,7 +57,7 @@ class ConvertFieldsToBraces( unohelper.Base, XJobExecutor ):
if __name__<>"package":
ConvertFieldsToBraces(None)
else:
- g_ImplementationHelper.addImplementation( ConvertFieldsToBraces, "org.openoffice.openerp.report.convertFB", ("com.sun.star.task.Job",),)
+ g_ImplementationHelper.addImplementation( ConvertFieldsToBraces, "org.openoffice.openerp.report.convertFB", ("com.sun.star.task.Job",),)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
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 d2605ce73e4..a12becdc68c 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,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import os
import uno
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py
index 9e3b175b67b..896a5954c7d 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import string
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py
index 90f85e57a0d..8ed4d2c25e8 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py
@@ -1,50 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
-
+#############################################################################
import uno
import string
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py
index 85059d7712c..11c74555447 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
if __name__<>"package":
from ServerParameter import *
from lib.gui import *
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py
index bc7d439c76d..ef1d3548a6e 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import uno
import string
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py
index 138c68b690e..3c6316d9fdb 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import string
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py
index f5e0972d2dd..b6edaecdc44 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import string
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py
index 7e83910a427..dbd0a51d66d 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import uno
import string
@@ -201,7 +177,7 @@ class SendtoServer(unohelper.Base, XJobExecutor):
if self.win.getListBoxSelectedItem("lstResourceType")=='OpenOffice':
params['report_type']=file_type
self.sock.execute(database, uid, self.password, 'ir.actions.report.xml', 'write', int(docinfo.getUserFieldValue(2)), params)
-
+
# Call upload_report as the *last* step, as it will call register_all() and cause the report service
# to be loaded - which requires all the data to be correct in the database
self.sock.execute(database, uid, self.password, 'ir.actions.report.xml', 'upload_report', int(docinfo.getUserFieldValue(2)),base64.encodestring(data),file_type,{})
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py
index c399634bfe5..b09b02699b0 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import uno
import string
import unohelper
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py
index 05f81a5c5b2..132882e0932 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import uno
import string
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py
index 0ccd1c9d011..d7f93351fac 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import Expression
import lib
import Fields
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py
index 4740c61b178..897f9abd00c 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py
@@ -1,49 +1,26 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
+
import compileall
compileall.compile_dir('package')
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py
index 8511bb8343d..cf82d0e1a76 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py
@@ -1,47 +1,23 @@
##########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
##############################################################################
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
index cb86f5f429a..f44404eaa16 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
@@ -1,47 +1,23 @@
##########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
##############################################################################
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
index 1d10f0f6a4c..52af0821790 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
@@ -1,47 +1,23 @@
##########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
##############################################################################
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/gui.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/gui.py
index d75469ca658..92b5ab750ca 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/gui.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/gui.py
@@ -1,47 +1,23 @@
##########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
+# This library 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
+# Lesser General Public License for more details.
#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+# See: http://www.gnu.org/licenses/lgpl.html
#
##############################################################################
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py
index 60edbc71d96..f8d90c30d75 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py
@@ -1,49 +1,25 @@
-##########################################################################
+#########################################################################
#
-# Portions of this file are under the following copyright and license:
+# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
+# Copyright (C) 2004-2010 OpenERP SA ().
#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# Copyright (c) 2003-2004 Danny Brewer
-# d29583@groovegarden.com
+# This library 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
+# Lesser General Public License for more details.
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# This library 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
-# Lesser General Public License for more details.
+# See: http://www.gnu.org/licenses/lgpl.html
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See: http://www.gnu.org/licenses/lgpl.html
-#
-#
-# and other portions are under the following copyright and license:
-#
-#
-# OpenERP, Open Source Management Solution>..
-# Copyright (C) 2004-2010 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 .
-#
-#
-##############################################################################
+#############################################################################
import re
import uno
diff --git a/addons/base_setup/i18n/ru.po b/addons/base_setup/i18n/ru.po
index bfc0807f019..93f65355baa 100644
--- a/addons/base_setup/i18n/ru.po
+++ b/addons/base_setup/i18n/ru.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-12-21 17:05+0000\n"
-"PO-Revision-Date: 2012-12-28 10:09+0000\n"
-"Last-Translator: Chertykov Denis \n"
+"PO-Revision-Date: 2013-05-27 12:19+0000\n"
+"Last-Translator: leksei \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:12+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-28 05:17+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
#. module: base_setup
#: view:sale.config.settings:0
@@ -41,6 +41,8 @@ msgstr "base.config.settings"
msgid ""
"Use external authentication providers, sign in with google, facebook, ..."
msgstr ""
+"Использовать внешние сервисы аутентификации, например, вход через google, "
+"facebook, ..."
#. module: base_setup
#: view:sale.config.settings:0
@@ -68,7 +70,7 @@ msgstr "Участник"
#. module: base_setup
#: view:base.config.settings:0
msgid "Portal access"
-msgstr ""
+msgstr "Доступ к порталу"
#. module: base_setup
#: view:base.config.settings:0
@@ -192,6 +194,9 @@ msgid ""
"When you create a new contact (person or company), you will be able to load "
"all the data from LinkedIn (photos, address, etc)."
msgstr ""
+"Когда вы создаете новый контакт (человека или компанию), у вас есть "
+"возможность загрузить из LinkedIn всю информацию о нем (адреса, фотографии и "
+"т.д.)"
#. module: base_setup
#: help:base.config.settings,module_multi_company:0
@@ -200,6 +205,9 @@ msgid ""
"companies.\n"
" This installs the module multi_company."
msgstr ""
+"Работать в режиме Мульти-компании, с соответствующими правами доступа между "
+"компаниями.\n"
+" Будет установлен модуль multi_company."
#. module: base_setup
#: view:base.config.settings:0
@@ -208,6 +216,9 @@ msgid ""
"You can\n"
" launch the OpenERP Server with the option"
msgstr ""
+"Публичный портал доступен только при использовании одной базы данных. Вы "
+"можете\n"
+" запустить сервер OpenERP с этой опцией"
#. module: base_setup
#: view:base.config.settings:0
@@ -215,6 +226,8 @@ msgid ""
"You will find more options in your company details: address for the header "
"and footer, overdue payments texts, etc."
msgstr ""
+"Больше опций вы можете найти в настройках компании: адреса для "
+"верхнего/нижнего колонтитула, тексты для просроченных платежей и т.д."
#. module: base_setup
#: model:ir.model,name:base_setup.model_sale_config_settings
@@ -238,6 +251,14 @@ msgid ""
"projects,\n"
" etc."
msgstr ""
+"Когда вы отправляете заказчику документы\n"
+" (прайсы, счета), для их получения он "
+"сможет\n"
+" войти на портал, где так же сможет "
+"прочитать\n"
+" новости вашей компании, узнать "
+"обновления по\n"
+" его проектам и т.д."
#. module: base_setup
#: model:ir.model,name:base_setup.model_base_setup_terminology
@@ -252,7 +273,7 @@ msgstr "Клиент"
#. module: base_setup
#: help:base.config.settings,module_portal_anonymous:0
msgid "Enable the public part of openerp, openerp becomes a public website."
-msgstr ""
+msgstr "Включая публичную часть, openerp становится общедоступным сайтом."
#. module: base_setup
#: help:sale.config.settings,module_plugin_thunderbird:0
@@ -274,13 +295,13 @@ msgstr "Контрагент"
#. module: base_setup
#: model:ir.actions.act_window,name:base_setup.action_partner_terminology_config_form
msgid "Use another word to say \"Customer\""
-msgstr ""
+msgstr "Использовать другое слово вместо \"Заказчик\""
#. module: base_setup
#: model:ir.actions.act_window,name:base_setup.action_sale_config
#: view:sale.config.settings:0
msgid "Configure Sales"
-msgstr ""
+msgstr "Настройки продаж"
#. module: base_setup
#: help:sale.config.settings,module_plugin_outlook:0
@@ -297,12 +318,12 @@ msgstr ""
#. module: base_setup
#: view:base.config.settings:0
msgid "Options"
-msgstr ""
+msgstr "Настройки"
#. module: base_setup
#: field:base.config.settings,module_portal:0
msgid "Activate the customer portal"
-msgstr ""
+msgstr "Включить клиентский портал"
#. module: base_setup
#: view:base.config.settings:0
@@ -315,32 +336,32 @@ msgstr ""
#. module: base_setup
#: field:base.config.settings,module_share:0
msgid "Allow documents sharing"
-msgstr ""
+msgstr "Разрешить совместный доступ к документам"
#. module: base_setup
#: view:base.config.settings:0
msgid "(company news, jobs, contact form, etc.)"
-msgstr ""
+msgstr "(новости компании, вакансии, форма обратной связи т.д.)"
#. module: base_setup
#: field:base.config.settings,module_portal_anonymous:0
msgid "Activate the public portal"
-msgstr ""
+msgstr "Включить публичный портал"
#. module: base_setup
#: view:base.config.settings:0
msgid "Configure outgoing email servers"
-msgstr ""
+msgstr "Настроить сервер(а) исходящей почты"
#. module: base_setup
#: view:sale.config.settings:0
msgid "Social Network Integration"
-msgstr ""
+msgstr "Интеграция с социальными сетями"
#. module: base_setup
#: help:base.config.settings,module_portal:0
msgid "Give your customers access to their documents."
-msgstr ""
+msgstr "Разрешить заказчикам доступ к своим документам"
#. module: base_setup
#: view:base.config.settings:0
@@ -352,23 +373,23 @@ msgstr "Отмена"
#: view:base.config.settings:0
#: view:sale.config.settings:0
msgid "Apply"
-msgstr ""
+msgstr "Применить"
#. module: base_setup
#: view:base.setup.terminology:0
msgid "Specify Your Terminology"
-msgstr ""
+msgstr "Определить терминологию"
#. module: base_setup
#: view:base.config.settings:0
#: view:sale.config.settings:0
msgid "or"
-msgstr ""
+msgstr "или"
#. module: base_setup
#: view:base.config.settings:0
msgid "Configure your company data"
-msgstr ""
+msgstr "Настроить информацию о компании"
#~ msgid "City"
#~ msgstr "Город"
diff --git a/addons/base_setup/res_config_view.xml b/addons/base_setup/res_config_view.xml
index 9e026184c9d..8c48f5d7a6b 100644
--- a/addons/base_setup/res_config_view.xml
+++ b/addons/base_setup/res_config_view.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/addons/claim_from_delivery/i18n/ru.po b/addons/claim_from_delivery/i18n/ru.po
index 253e824d1e2..8d97086c22a 100644
--- a/addons/claim_from_delivery/i18n/ru.po
+++ b/addons/claim_from_delivery/i18n/ru.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: 2010-09-30 06:47+0000\n"
+"PO-Revision-Date: 2013-05-27 12:19+0000\n"
"Last-Translator: Chertykov Denis \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-03-16 05:41+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-28 05:17+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
#. module: claim_from_delivery
#: view:stock.picking.out:0
@@ -25,7 +25,7 @@ msgstr ""
#. module: claim_from_delivery
#: model:res.request.link,name:claim_from_delivery.request_link_claim_from_delivery
msgid "Delivery Order"
-msgstr ""
+msgstr "Заказ доставки"
#. module: claim_from_delivery
#: model:ir.actions.act_window,name:claim_from_delivery.action_claim_from_delivery
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index 8e17a882076..e7ab7df27ea 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -81,8 +81,6 @@ Dashboard for CRM will include:
'crm_lead_view.xml',
'crm_lead_menu.xml',
- 'crm_case_section_view.xml',
-
'crm_meeting_menu.xml',
'crm_phonecall_view.xml',
@@ -98,6 +96,8 @@ Dashboard for CRM will include:
'res_config_view.xml',
'base_partner_merge_view.xml',
+
+ 'crm_case_section_view.xml',
],
'demo': [
'crm_demo.xml',
@@ -121,7 +121,8 @@ Dashboard for CRM will include:
'static/src/css/crm.css'
],
'js': [
- 'static/src/js/crm.js'
+ 'static/lib/sparkline/jquery.sparkline.js',
+ 'static/src/js/crm_case_section.js',
],
'installable': True,
'application': True,
diff --git a/addons/crm/base_partner_merge.py b/addons/crm/base_partner_merge.py
index b2645e7fb79..0a8e37b14b7 100644
--- a/addons/crm/base_partner_merge.py
+++ b/addons/crm/base_partner_merge.py
@@ -13,6 +13,7 @@ from openerp.tools import mute_logger
# Validation Library https://pypi.python.org/pypi/validate_email/1.1
from .validate_email import validate_email
+import openerp
from openerp.osv import osv, orm
from openerp.osv import fields
from openerp.osv.orm import browse_record
@@ -101,14 +102,26 @@ class MergePartnerAutomatic(osv.TransientModel):
'current_line_id': fields.many2one('base.partner.merge.line', 'Current Line'),
'line_ids': fields.one2many('base.partner.merge.line', 'wizard_id', 'Lines'),
'partner_ids': fields.many2many('res.partner', string='Contacts'),
+ 'dst_partner_id': fields.many2one('res.partner', string='Destination Contact'),
'exclude_contact': fields.boolean('A user associated to the contact'),
'exclude_journal_item': fields.boolean('Journal Items associated to the contact'),
'maximum_group': fields.integer("Maximum of Group of Contacts"),
}
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ res = super(MergePartnerAutomatic, self).default_get(cr, uid, fields, context)
+ if context.get('active_model') == 'res.partner' and context.get('active_ids'):
+ partner_ids = context['active_ids']
+ res['state'] = 'selection'
+ res['partner_ids'] = partner_ids
+ res['dst_partner_id'] = self._get_ordered_partner(cr, uid, partner_ids, context=context)[-1].id
+ return res
+
_defaults = {
- 'state': 'option',
+ 'state': 'option'
}
def get_fk_on(self, cr, table):
@@ -204,8 +217,8 @@ class MergePartnerAutomatic(osv.TransientModel):
if proxy is None:
return
domain = [(field_model, '=', 'res.partner'), (field_id, '=', src.id)]
- ids = proxy.search(cr, uid, domain, context=context)
- return proxy.write(cr, uid, ids, {field_id: dst_partner.id}, context=context)
+ ids = proxy.search(cr, openerp.SUPERUSER_ID, domain, context=context)
+ return proxy.write(cr, openerp.SUPERUSER_ID, ids, {field_id: dst_partner.id}, context=context)
update_records = functools.partial(update_records, context=context)
@@ -219,9 +232,9 @@ class MergePartnerAutomatic(osv.TransientModel):
proxy = self.pool['ir.model.fields']
domain = [('ttype', '=', 'reference')]
- record_ids = proxy.search(cr, uid, domain, context=context)
+ record_ids = proxy.search(cr, openerp.SUPERUSER_ID, domain, context=context)
- for record in proxy.browse(cr, uid, record_ids, context=context):
+ for record in proxy.browse(cr, openerp.SUPERUSER_ID, record_ids, context=context):
proxy_model = self.pool[record.model]
field_type = proxy_model._columns.get(record.name).__class__._type
@@ -233,11 +246,11 @@ class MergePartnerAutomatic(osv.TransientModel):
domain = [
(record.name, '=', 'res.partner,%d' % partner.id)
]
- model_ids = proxy_model.search(cr, uid, domain, context=context)
+ model_ids = proxy_model.search(cr, openerp.SUPERUSER_ID, domain, context=context)
values = {
record.name: 'res.partner,%d' % dst_partner.id,
}
- proxy_model.write(cr, uid, model_ids, values, context=context)
+ proxy_model.write(cr, openerp.SUPERUSER_ID, model_ids, values, context=context)
def _update_values(self, cr, uid, src_partners, dst_partner, context=None):
_logger.debug('_update_values for dst_partner: %s for src_partners: %r', dst_partner.id, list(map(operator.attrgetter('id'), src_partners)))
@@ -266,22 +279,31 @@ class MergePartnerAutomatic(osv.TransientModel):
_logger.info('Skip recursive partner hierarchies for parent_id %s of partner: %s', parent_id, dst_partner.id)
@mute_logger('openerp.osv.expression', 'openerp.osv.orm')
- def _merge(self, cr, uid, partner_ids, context=None):
+ def _merge(self, cr, uid, partner_ids, dst_partner=None, context=None):
proxy = self.pool.get('res.partner')
partner_ids = proxy.exists(cr, uid, list(partner_ids), context=context)
if len(partner_ids) < 2:
return
- partners = proxy.browse(cr, uid, list(partner_ids), context=context)
- ordered_partners = sorted(sorted(partners,
- key=operator.attrgetter('create_date'), reverse=True),
- key=operator.attrgetter('active'), reverse=True)
+ if len(partner_ids) > 3:
+ raise osv.except_osv(_('Error'), _("For safety reasons, you cannot merge more than 3 contacts together. You can re-open the wizard several times if needed."))
- dst_partner = ordered_partners[-1]
- src_partners = ordered_partners[:-1]
+ if openerp.SUPERUSER_ID != uid and len(set(partner.email for partner in proxy.browse(cr, uid, partner_ids, context=context))) > 1:
+ raise osv.except_osv(_('Error'), _("All contacts must have the same email. Only the Administrator can merge contacts with different emails."))
+
+ if dst_partner and dst_partner.id in partner_ids:
+ src_partners = proxy.browse(cr, uid, [id for id in partner_ids if id != dst_partner.id], context=context)
+ else:
+ ordered_partners = self._get_ordered_partner(cr, uid, partner_ids, context)
+ dst_partner = ordered_partners[-1]
+ src_partners = ordered_partners[:-1]
_logger.info("dst_partner: %s", dst_partner.id)
+ if openerp.SUPERUSER_ID != uid and self._model_is_installed(cr, uid, 'account.move.line', context=context) and \
+ self.pool.get('account.move.line').search(cr, openerp.SUPERUSER_ID, [('partner_id', 'in', [partner.id for partner in src_partners])], context=context):
+ raise osv.except_osv(_('Error'), _("Only the destination contact may be linked to existing Journal Items. Please ask the Administrator if you need to merge several contacts linked to existing Journal Items."))
+
call_it = lambda function: function(cr, uid, src_partners, dst_partner,
context=context)
@@ -289,12 +311,12 @@ class MergePartnerAutomatic(osv.TransientModel):
call_it(self._update_reference_fields)
call_it(self._update_values)
- _logger.info("---merged---")
-
+ _logger.info('(uid = %s) merged the partners %r with %s', uid, list(map(operator.attrgetter('id'), src_partners)), dst_partner.id)
+ dst_partner.message_post(body='%s %s'%(_("Merged with the following partners:"), ", ".join('%s<%s>(ID %s)' % (p.name, p.email or 'n/a', p.id) for p in src_partners)))
+
for partner in src_partners:
partner.unlink()
-
def clean_emails(self, cr, uid, context=None):
"""
Clean the email address of the partner, if there is an email field with
@@ -414,9 +436,16 @@ class MergePartnerAutomatic(osv.TransientModel):
this = self.browse(cr, uid, ids[0], context=context)
if this.current_line_id:
this.current_line_id.unlink()
- return self._next_screen(this)
+ return self._next_screen(cr, uid, this, context)
- def _next_screen(self, this):
+ def _get_ordered_partner(self, cr, uid, partner_ids, context=None):
+ partners = self.pool.get('res.partner').browse(cr, uid, list(partner_ids), context=context)
+ ordered_partners = sorted(sorted(partners,
+ key=operator.attrgetter('create_date'), reverse=True),
+ key=operator.attrgetter('active'), reverse=True)
+ return ordered_partners
+
+ def _next_screen(self, cr, uid, this, context=None):
this.refresh()
values = {}
if this.line_ids:
@@ -426,6 +455,7 @@ class MergePartnerAutomatic(osv.TransientModel):
values.update({
'current_line_id': current_line.id,
'partner_ids': [(6, 0, current_partner_ids)],
+ 'dst_partner_id': self._get_ordered_partner(cr, uid, current_partner_ids, context)[-1].id,
'state': 'selection',
})
else:
@@ -525,7 +555,7 @@ class MergePartnerAutomatic(osv.TransientModel):
query = self._generate_query(groups, this.maximum_group)
self._process_query(cr, uid, ids, query, context=context)
- return self._next_screen(this)
+ return self._next_screen(cr, uid, this, context)
def automatic_process_cb(self, cr, uid, ids, context=None):
assert is_integer_list(ids)
@@ -666,7 +696,7 @@ class MergePartnerAutomatic(osv.TransientModel):
# p1.parent_id = p1.id
# """)
- return self._next_screen(this)
+ return self._next_screen(cr, uid, this, context)
def merge_cb(self, cr, uid, ids, context=None):
assert is_integer_list(ids)
@@ -685,33 +715,12 @@ class MergePartnerAutomatic(osv.TransientModel):
'target': 'new',
}
- self._merge(cr, uid, partner_ids, context=context)
+ self._merge(cr, uid, partner_ids, this.dst_partner_id, context=context)
- this.current_line_id.unlink()
+ if this.current_line_id:
+ this.current_line_id.unlink()
- return self._next_screen(this)
-
- def merge_multi(self, cr, uid, ids, context=None):
-
- active_model = context.get('active_model')
- if active_model != 'res.partner':
- raise osv.except_osv(
- _('Error'),
- _('This wizard can only used with the Partners')
- )
-
- partner_ids = context.get('active_ids', [])
-
- MINIMAL_NUMBER = 2
- if len(partner_ids) < MINIMAL_NUMBER:
- raise osv.except_osv(
- _('Error'),
- _("You can't use this wizard with only one Partner")
- )
-
- self._merge(cr, uid, partner_ids, context=context)
-
- return True
+ return self._next_screen(cr, uid, this, context)
def auto_set_parent_id(self, cr, uid, ids, context=None):
assert is_integer_list(ids)
diff --git a/addons/crm/base_partner_merge_view.xml b/addons/crm/base_partner_merge_view.xml
index 74e7a72d7a8..8ce0b5fd99f 100644
--- a/addons/crm/base_partner_merge_view.xml
+++ b/addons/crm/base_partner_merge_view.xml
@@ -68,9 +68,9 @@
OpenERP will propose you to merge only those having
all these fields in common. (not one of the fields).
-
+
-
+
@@ -98,15 +98,15 @@
redirected to the aggregated contact. You can remove
contacts from this list to avoid merging them.
+
-
+
-
@@ -114,24 +114,9 @@
-
-
- pool.get('base.partner.merge.automatic.wizard').merge_multi(cr, uid, None, context)
- True
-
- Automatic Merge
-
- code
- ir.actions.server
-
-
-
-
- res.partner
- Automatic Merge
-
-
+
+
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 7b6fe02afa8..4c9a60634a5 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -19,13 +19,12 @@
#
##############################################################################
-import base64
-import time
-from lxml import etree
+from datetime import date, datetime
+from dateutil import relativedelta
+
+from openerp import tools
from openerp.osv import fields
from openerp.osv import osv
-from openerp import tools
-from openerp.tools.translate import _
MAX_LEVEL = 15
AVAILABLE_STATES = [
@@ -106,10 +105,57 @@ class crm_case_section(osv.osv):
_inherit = "mail.thread"
_description = "Sales Teams"
_order = "complete_name"
+ # number of periods for lead/opportunities/... tracking in salesteam kanban dashboard/kanban view
+ _period_number = 5
def get_full_name(self, cr, uid, ids, field_name, arg, context=None):
return dict(self.name_get(cr, uid, ids, context=context))
+ def __get_bar_values(self, cr, uid, obj, domain, read_fields, value_field, groupby_field, context=None):
+ """ Generic method to generate data for bar chart values using SparklineBarWidget.
+ This method performs obj.read_group(cr, uid, domain, read_fields, groupby_field).
+
+ :param obj: the target model (i.e. crm_lead)
+ :param domain: the domain applied to the read_group
+ :param list read_fields: the list of fields to read in the read_group
+ :param str value_field: the field used to compute the value of the bar slice
+ :param str groupby_field: the fields used to group
+
+ :return list section_result: a list of dicts: [
+ { 'value': (int) bar_column_value,
+ 'tootip': (str) bar_column_tooltip,
+ }
+ ]
+ """
+ month_begin = date.today().replace(day=1)
+ section_result = [{
+ 'value': 0,
+ 'tooltip': (month_begin + relativedelta.relativedelta(months=-i)).strftime('%B'),
+ } for i in range(self._period_number - 1, -1, -1)]
+ group_obj = obj.read_group(cr, uid, domain, read_fields, groupby_field, context=context)
+ for group in group_obj:
+ group_begin_date = datetime.strptime(group['__domain'][0][2], tools.DEFAULT_SERVER_DATE_FORMAT)
+ month_delta = relativedelta.relativedelta(month_begin, group_begin_date)
+ section_result[self._period_number - (month_delta.months + 1)] = {'value': group.get(value_field, 0), 'tooltip': group_begin_date.strftime('%B')}
+ return section_result
+
+ def _get_opportunities_data(self, cr, uid, ids, field_name, arg, context=None):
+ """ Get opportunities-related data for salesteam kanban view
+ monthly_open_leads: number of open lead during the last months
+ monthly_planned_revenue: planned revenu of opportunities during the last months
+ """
+ obj = self.pool.get('crm.lead')
+ res = dict.fromkeys(ids, False)
+ month_begin = date.today().replace(day=1)
+ groupby_begin = (month_begin + relativedelta.relativedelta(months=-4)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
+ for id in ids:
+ res[id] = dict()
+ lead_domain = [('type', '=', 'lead'), ('section_id', '=', id), ('create_date', '>=', groupby_begin)]
+ res[id]['monthly_open_leads'] = self.__get_bar_values(cr, uid, obj, lead_domain, ['create_date'], 'create_date_count', 'create_date', context=context)
+ opp_domain = [('type', '=', 'opportunity'), ('section_id', '=', id), ('create_date', '>=', groupby_begin)]
+ res[id]['monthly_planned_revenue'] = self.__get_bar_values(cr, uid, obj, opp_domain, ['planned_revenue', 'create_date'], 'planned_revenue', 'create_date', context=context)
+ return res
+
_columns = {
'name': fields.char('Sales Team', size=64, required=True, translate=True),
'complete_name': fields.function(get_full_name, type='char', size=256, readonly=True, store=True),
@@ -129,15 +175,16 @@ class crm_case_section(osv.osv):
'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
help="The email address associated with this team. New emails received will automatically "
"create new leads assigned to the team."),
- 'open_lead_ids': fields.one2many('crm.lead', 'section_id',
- string='Open Leads', readonly=True,
- domain=['&', ('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]),
- 'open_opportunity_ids': fields.one2many('crm.lead', 'section_id',
- string='Open Opportunities', readonly=True,
- domain=['&', '|', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]),
'color': fields.integer('Color Index'),
'use_leads': fields.boolean('Leads',
- help="This enables the management of leads in the sales team. Otherwise the sales team manages only opportunities."),
+ help="The first contact you get with a potential customer is a lead you qualify before converting it into a real business opportunity. Check this box to manage leads in this sales team."),
+
+ 'monthly_open_leads': fields.function(_get_opportunities_data,
+ type="string", readonly=True, multi='_get_opportunities_data',
+ string='Open Leads per Month'),
+ 'monthly_planned_revenue': fields.function(_get_opportunities_data,
+ type="string", readonly=True, multi='_get_opportunities_data',
+ string='Planned Revenue per Month')
}
def _get_stage_common(self, cr, uid, context):
diff --git a/addons/crm/crm_action_rule_demo.xml b/addons/crm/crm_action_rule_demo.xml
index bf1f7d4082f..7204f666db5 100644
--- a/addons/crm/crm_action_rule_demo.xml
+++ b/addons/crm/crm_action_rule_demo.xml
@@ -26,6 +26,7 @@ Description: [[object.description]]
Set Auto Reminder on leads which are not open since 5 days.1
+ on_time5
@@ -54,12 +55,10 @@ object.write({'section_id': sales_team.id})
Set Auto Followers on leads which are urgent and come from USA.2
+ on_create
-
-
- 0
- minutes
+
diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml
index c788872b47e..be5611c03c4 100644
--- a/addons/crm/crm_case_section_view.xml
+++ b/addons/crm/crm_case_section_view.xml
@@ -43,8 +43,7 @@
{
'search_default_section_id': [active_id],
- 'search_default_new': 1,
- 'search_default_open': 1,
+ 'search_default_assigned_to_me': 1,
'default_section_id': active_id,
'stage_type': 'opportunity',
'default_type': 'opportunity',
@@ -79,12 +78,12 @@
-
-
+
+
-
+Manage your sales funnel with no effort. Attract leads, follow-up on phone calls and meetings. Analyse the quality of your leads to make informed decisions and save time by integrating emails directly into the application.
+
+Track your opportunities pipeline with the revolutionary kanban view. Work inside your sales funnel and get instant visual information about next actions, new messages, top opportunities and expected revenues.
+
+
+
+
+
+
+
+
+
+
+
+
+
Social Network Integration
+
+
+
+
+
+
+
+Bring social intelligence to your sales process. Gain insights from social media site LinkedIn to find prospects easily and load their data automatically into your address book.
+
+
+
+
+
+
+
+
+
Lead Management Made Easy
+
+
+Create leads automatically from incoming emails. Analyse leads efficiency and compare performance by campaigns, channels or sales team.
+
+
+Find duplicates, merge leads and assign them to the right salesperson in one operation. Spend less time on administration and more time on qualifying leads.
+
+
+
+
+
+
+
+
+
+
+
+
+
Organize Your Opportunities
+
A clean user interface with everything in one screen
+
+
+
+
+
+
+
+Get your opportunities organized to stay focused on the best deals. Manage all your customer interactions from the opportunity like emails, phone calls, internal notes, meetings and quotations.
+
+Follow opportunities that interrests you to get notified upon specific events: deal won or lost, stage changed, new customer demand, etc.
+
+
+
+
+
+
+
+
Email Integration and Automation
+
+
+Work with the email applications you already use every day. Whether your company uses Microsoft Outlook or Gmail, no one needs to change the way they work, so everyone stays productive.
+
+Route, sort and filter incoming emails automatically. OpenERP CRM handles incoming emails and route them to the right opportunities or sales team. New leads are created on the fly and interested salespersons are notified automatically.
+
+
+
+
+
+
+
+
+
+
+
+
+
Collaborative Agenda
+
+
+
+
+
+
+
+Schedule your meetings and phone calls using the integrated calendar. You can see your agenda and your colleagues' in one view. As a manager, it's easy to see what your team is busy with.
+
+
+
+
+
+
+
+
Lead Automation and Marketing Campaigns
+
Drive performance by automating tasks
+
+
+ Use our marketing campaigns to automate lead acquisition, follow ups and promotions. Define automated actions (e.g. ask a salesperson to call, send an email, ...) based on triggers (no activity since 20 days, answered a promotional email, etc.)
+
+ Optimize campaigns from lead to close, on every channel. Make smarter decisions about where to invest and show the impact of your marketing activities on your company's bottom line.
+
+
+
+
+
+
+
+
+
+
+
+
+
Customize Your Sales Cycle
+
It Fits Your Sales Approach
+
+Customize your sales cycle by configuring sales stages that perfectly fit your sales approach. Control statistics to get accurate forecasts to improve your sales performance at every stage of your customer relationship.
+
+
+
+
+
+
+
+
+
+
+
+
+
Reporting and Dashboards
+
Get access to the right information to take smart decisions
+
+
+
+
+
+
+
+Get the insights you need to make smarter decisions. Design custom dashboards to get a picture of your business at a glance. Dig deeper with real-time reports that anyone can create and share.
+
+
+
+
+
+
+
+
Drive Engagement with Gamification
+
Leverage sales' natural desire for competition
+
+ Reinforce good habits and improve win rates with real-time recognition and rewards inspired by game mechanics. Align sales teams around clear business objectives with challenges, personal objectives and team leader boards.
+
+
+
Leaderboards
+
+
+
+
+ Promote leaders and competition amongst sales team with performance ratios.
+
+
+
+
Personnal Objectives
+
+
+
+
+ Assign clear goals to users to align them with the company objectives.
+
+
+
+
Team Targets
+
+
+
+
+ Compare revenues with forecasts and budgets in real time.
+
+
+
+
+
+
+
+
+
Many companies already enjoy it
+
Hear what they have to say !
+
+
+
+
+ With OpenERP CRM I keep all the information about leads and customers
+ in a single place, and share it with my colleagues. It's great and effective.
+
+
+
+
+
diff --git a/addons/crm/i18n/ru.po b/addons/crm/i18n/ru.po
index 19ae76e9f46..ec2a9f35ee5 100644
--- a/addons/crm/i18n/ru.po
+++ b/addons/crm/i18n/ru.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-12-21 17:04+0000\n"
-"PO-Revision-Date: 2013-03-01 11:27+0000\n"
-"Last-Translator: Антон Лаврёнов \n"
+"PO-Revision-Date: 2013-05-30 13:52+0000\n"
+"Last-Translator: Chertykov Denis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:09+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-31 05:38+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: crm
#: view:crm.lead.report:0
@@ -452,7 +452,7 @@ msgstr "# Предложений"
#, python-format
msgid ""
"Please select more than one element (lead or opportunity) from the list view."
-msgstr ""
+msgstr "Пожалуйста, выберите хотя бы один элемент из списка ниже."
#. module: crm
#: view:crm.lead:0
@@ -1108,7 +1108,7 @@ msgstr "Удалить"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_create
msgid "Opportunity created"
-msgstr ""
+msgstr "Предложение создано"
#. module: crm
#: view:crm.lead:0
@@ -1397,7 +1397,7 @@ msgstr "Сделать"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_lost
msgid "Opportunity lost"
-msgstr ""
+msgstr "Предложение отклонено"
#. module: crm
#: field:crm.lead2opportunity.partner,action:0
@@ -1446,7 +1446,7 @@ msgstr "Пользователи"
#. module: crm
#: model:mail.message.subtype,name:crm.mt_lead_stage
msgid "Stage Changed"
-msgstr ""
+msgstr "Стадия изменена"
#. module: crm
#: field:crm.case.stage,section_ids:0
@@ -1759,7 +1759,7 @@ msgstr "Способ оплаты"
#. module: crm
#: model:ir.model,name:crm.model_crm_lead2opportunity_partner_mass
msgid "Mass Lead To Opportunity Partner"
-msgstr "Массовое проведение предложений партнёру"
+msgstr "Массовое преобразование кандидатов в предложения"
#. module: crm
#: view:sale.config.settings:0
@@ -1917,7 +1917,7 @@ msgstr "Сделать"
#: model:mail.message.subtype,name:crm.mt_lead_convert_to_opportunity
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_opportunity
msgid "Lead to Opportunity"
-msgstr ""
+msgstr "Кандидат в предложение"
#. module: crm
#: field:crm.lead,user_email:0
@@ -2126,7 +2126,7 @@ msgstr ""
#. module: crm
#: view:crm.lead:0
msgid "Address"
-msgstr ""
+msgstr "Адрес"
#. module: crm
#: help:crm.case.section,alias_id:0
@@ -2134,6 +2134,8 @@ msgid ""
"The email address associated with this team. New emails received will "
"automatically create new leads assigned to the team."
msgstr ""
+"Адрес эл. почты связанный с этой командой. Новая полученная эл. почта будет "
+"автоматически создавать новые кандидаты связанные с командой."
#. module: crm
#: view:crm.lead:0
@@ -2192,7 +2194,7 @@ msgstr "Продолжение процесса"
#: selection:crm.lead2opportunity.partner.mass,name:0
#: model:ir.actions.act_window,name:crm.action_crm_lead2opportunity_partner
msgid "Convert to opportunity"
-msgstr "Преобразовать в возможность"
+msgstr "Преобразовать в предложение"
#. module: crm
#: field:crm.opportunity2phonecall,user_id:0
@@ -2234,6 +2236,8 @@ msgid ""
"This stage is not visible, for example in status bar or kanban view, when "
"there are no records in that stage to display."
msgstr ""
+"Эта стадия не видима, например в статус-баре или виде канбан, когда нет "
+"записей этой стадии для отображения."
#. module: crm
#: field:crm.lead.report,nbr:0
@@ -2249,7 +2253,7 @@ msgstr "Отдел продаж, которому принадлежит воп
#. module: crm
#: model:crm.case.resource.type,name:crm.type_lead6
msgid "Banner Ads"
-msgstr ""
+msgstr "Баннер"
#. module: crm
#: field:crm.merge.opportunity,opportunity_ids:0
@@ -2279,7 +2283,7 @@ msgstr "Выполняется"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_convert_to_opportunity
msgid "Lead converted into an opportunity"
-msgstr ""
+msgstr "Кандидат превращенный в предложение"
#. module: crm
#: view:crm.lead:0
@@ -2289,7 +2293,7 @@ msgstr "Нераспределенные кандидаты"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_won
msgid "Opportunity won"
-msgstr ""
+msgstr "Предложение принято"
#. module: crm
#: field:crm.case.categ,object_id:0
@@ -2364,7 +2368,7 @@ msgstr ""
#. module: crm
#: field:crm.case.stage,state:0
msgid "Related Status"
-msgstr ""
+msgstr "Связанный статус"
#. module: crm
#: field:crm.phonecall,name:0
@@ -2410,7 +2414,7 @@ msgstr "Подтвердить"
#. module: crm
#: view:crm.lead:0
msgid "Unread messages"
-msgstr ""
+msgstr "Непрочитанные сообщения"
#. module: crm
#: field:crm.phonecall.report,section_id:0
@@ -2501,7 +2505,7 @@ msgstr "Создание предложений из кандидатов"
#. module: crm
#: model:crm.case.resource.type,name:crm.type_lead3
msgid "Email Campaign - Products"
-msgstr ""
+msgstr "Кампания эл. почты - Продукция"
#. module: crm
#: model:ir.actions.act_window,help:crm.crm_case_categ_phone_incoming0
@@ -2578,7 +2582,7 @@ msgstr "Август"
#: model:mail.message.subtype,name:crm.mt_lead_lost
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_lost
msgid "Opportunity Lost"
-msgstr ""
+msgstr "Предложение отклонено"
#. module: crm
#: field:crm.lead.report,deadline_month:0
@@ -2644,7 +2648,7 @@ msgstr "Сотрудники отдела"
#: view:crm.opportunity2phonecall:0
#: view:crm.phonecall2phonecall:0
msgid "Schedule/Log a Call"
-msgstr ""
+msgstr "Запланировать/Описать звонок"
#. module: crm
#: field:crm.lead,planned_cost:0
@@ -2654,7 +2658,7 @@ msgstr "Планируемые затраты"
#. module: crm
#: help:crm.lead,date_deadline:0
msgid "Estimate of the date on which the opportunity will be won."
-msgstr ""
+msgstr "Оценка даты на которую это предложение будет принято."
#. module: crm
#: help:crm.lead,email_cc:0
@@ -2676,7 +2680,7 @@ msgstr "Описанные звонки"
#: model:mail.message.subtype,name:crm.mt_lead_won
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_won
msgid "Opportunity Won"
-msgstr ""
+msgstr "Предложение принято"
#. module: crm
#: model:ir.actions.act_window,name:crm.crm_case_section_act_tree
@@ -2895,7 +2899,7 @@ msgstr ""
#. module: crm
#: view:crm.lead:0
msgid "Internal Notes"
-msgstr ""
+msgstr "Внутренние заметки"
#. module: crm
#: view:crm.lead:0
@@ -2960,6 +2964,7 @@ msgstr "Проиграно"
#, python-format
msgid "Closed/Cancelled leads cannot be converted into opportunities."
msgstr ""
+"Закрытые/Отмененные кандидаты не могут быть конвертированы в возможности."
#. module: crm
#: view:crm.lead:0
@@ -3050,7 +3055,7 @@ msgstr "Рассылка"
#. module: crm
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_stage
msgid "Opportunity Stage Changed"
-msgstr ""
+msgstr "Этап предложения изменен"
#. module: crm
#: model:ir.actions.act_window,help:crm.crm_lead_stage_act
diff --git a/addons/crm/process/crm_configuration_process.xml b/addons/crm/process/crm_configuration_process.xml
index c56bb8935d9..882c9680268 100644
--- a/addons/crm/process/crm_configuration_process.xml
+++ b/addons/crm/process/crm_configuration_process.xml
@@ -60,24 +60,24 @@
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 759063b3c1d..09853c6379e 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -75,7 +75,7 @@
+ help="Leads/Opportunities that are assigned to one of the sale teams I manage" groups="base.group_multi_salesteams"/>
+ help="Phone calls that are assigned to one of the sale teams I manage" groups="base.group_multi_salesteams"/>
-
+
-
+
diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv
index b09c201df2b..cadb8c24550 100644
--- a/addons/crm/security/ir.model.access.csv
+++ b/addons/crm/security/ir.model.access.csv
@@ -12,7 +12,7 @@ access_crm_phonecall_manager,crm.phonecall.manager,model_crm_phonecall,base.grou
access_crm_case_categ,crm.case.categ,model_crm_case_categ,base.group_user,1,0,0,0
access_crm_lead,crm.lead,model_crm_lead,base.group_sale_salesman,1,1,1,0
access_crm_phonecall,crm.phonecall,model_crm_phonecall,base.group_sale_salesman,1,1,1,0
-access_crm_case_section_user,crm.case.section.user,model_crm_case_section,base.group_sale_salesman,1,1,1,0
+access_crm_case_section_user,crm.case.section.user,model_crm_case_section,base.group_sale_salesman,1,0,0,0
access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,base.group_sale_manager,1,1,1,1
access_crm_case_stage,crm.case.stage,model_crm_case_stage,,1,0,0,0
access_crm_case_stage_manager,crm.case.stage,model_crm_case_stage,base.group_sale_manager,1,1,1,1
diff --git a/addons/crm/static/lib/sparkline/jquery.sparkline.js b/addons/crm/static/lib/sparkline/jquery.sparkline.js
new file mode 100644
index 00000000000..c003923e03b
--- /dev/null
+++ b/addons/crm/static/lib/sparkline/jquery.sparkline.js
@@ -0,0 +1,3047 @@
+/**
+*
+* jquery.sparkline.js
+*
+* v2.1.1
+* (c) Splunk, Inc
+* Contact: Gareth Watts (gareth@splunk.com)
+* http://omnipotent.net/jquery.sparkline/
+*
+* Generates inline sparkline charts from data supplied either to the method
+* or inline in HTML
+*
+* Compatible with Internet Explorer 6.0+ and modern browsers equipped with the canvas tag
+* (Firefox 2.0+, Safari, Opera, etc)
+*
+* License: New BSD License
+*
+* Copyright (c) 2012, Splunk Inc.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*
+* * Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* * Neither the name of Splunk Inc nor the names of its contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+* SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*
+* Usage:
+* $(selector).sparkline(values, options)
+*
+* If values is undefined or set to 'html' then the data values are read from the specified tag:
+*
Sparkline: 1,4,6,6,8,5,3,5
+* $('.sparkline').sparkline();
+* There must be no spaces in the enclosed data set
+*
+* Otherwise values must be an array of numbers or null values
+*
Sparkline: This text replaced if the browser is compatible
+* $('#sparkline1').sparkline([1,4,6,6,8,5,3,5])
+* $('#sparkline2').sparkline([1,4,6,null,null,5,3,5])
+*
+* Values can also be specified in an HTML comment, or as a values attribute:
+*
Sparkline:
+*
Sparkline:
+* $('.sparkline').sparkline();
+*
+* For line charts, x values can also be specified:
+*
Sparkline: 1:1,2.7:4,3.4:6,5:6,6:8,8.7:5,9:3,10:5
+* $('#sparkline1').sparkline([ [1,1], [2.7,4], [3.4,6], [5,6], [6,8], [8.7,5], [9,3], [10,5] ])
+*
+* By default, options should be passed in as teh second argument to the sparkline function:
+* $('.sparkline').sparkline([1,2,3,4], {type: 'bar'})
+*
+* Options can also be set by passing them on the tag itself. This feature is disabled by default though
+* as there's a slight performance overhead:
+* $('.sparkline').sparkline([1,2,3,4], {enableTagOptions: true})
+*
Sparkline: loading
+* Prefix all options supplied as tag attribute with "spark" (configurable by setting tagOptionPrefix)
+*
+* Supported options:
+* lineColor - Color of the line used for the chart
+* fillColor - Color used to fill in the chart - Set to '' or false for a transparent chart
+* width - Width of the chart - Defaults to 3 times the number of values in pixels
+* height - Height of the chart - Defaults to the height of the containing element
+* chartRangeMin - Specify the minimum value to use for the Y range of the chart - Defaults to the minimum value supplied
+* chartRangeMax - Specify the maximum value to use for the Y range of the chart - Defaults to the maximum value supplied
+* chartRangeClip - Clip out of range values to the max/min specified by chartRangeMin and chartRangeMax
+* chartRangeMinX - Specify the minimum value to use for the X range of the chart - Defaults to the minimum value supplied
+* chartRangeMaxX - Specify the maximum value to use for the X range of the chart - Defaults to the maximum value supplied
+* composite - If true then don't erase any existing chart attached to the tag, but draw
+* another chart over the top - Note that width and height are ignored if an
+* existing chart is detected.
+* tagValuesAttribute - Name of tag attribute to check for data values - Defaults to 'values'
+* enableTagOptions - Whether to check tags for sparkline options
+* tagOptionPrefix - Prefix used for options supplied as tag attributes - Defaults to 'spark'
+* disableHiddenCheck - If set to true, then the plugin will assume that charts will never be drawn into a
+* hidden dom element, avoding a browser reflow
+* disableInteraction - If set to true then all mouseover/click interaction behaviour will be disabled,
+* making the plugin perform much like it did in 1.x
+* disableTooltips - If set to true then tooltips will be disabled - Defaults to false (tooltips enabled)
+* disableHighlight - If set to true then highlighting of selected chart elements on mouseover will be disabled
+* defaults to false (highlights enabled)
+* highlightLighten - Factor to lighten/darken highlighted chart values by - Defaults to 1.4 for a 40% increase
+* tooltipContainer - Specify which DOM element the tooltip should be rendered into - defaults to document.body
+* tooltipClassname - Optional CSS classname to apply to tooltips - If not specified then a default style will be applied
+* tooltipOffsetX - How many pixels away from the mouse pointer to render the tooltip on the X axis
+* tooltipOffsetY - How many pixels away from the mouse pointer to render the tooltip on the r axis
+* tooltipFormatter - Optional callback that allows you to override the HTML displayed in the tooltip
+* callback is given arguments of (sparkline, options, fields)
+* tooltipChartTitle - If specified then the tooltip uses the string specified by this setting as a title
+* tooltipFormat - A format string or SPFormat object (or an array thereof for multiple entries)
+* to control the format of the tooltip
+* tooltipPrefix - A string to prepend to each field displayed in a tooltip
+* tooltipSuffix - A string to append to each field displayed in a tooltip
+* tooltipSkipNull - If true then null values will not have a tooltip displayed (defaults to true)
+* tooltipValueLookups - An object or range map to map field values to tooltip strings
+* (eg. to map -1 to "Lost", 0 to "Draw", and 1 to "Win")
+* numberFormatter - Optional callback for formatting numbers in tooltips
+* numberDigitGroupSep - Character to use for group separator in numbers "1,234" - Defaults to ","
+* numberDecimalMark - Character to use for the decimal point when formatting numbers - Defaults to "."
+* numberDigitGroupCount - Number of digits between group separator - Defaults to 3
+*
+* There are 7 types of sparkline, selected by supplying a "type" option of 'line' (default),
+* 'bar', 'tristate', 'bullet', 'discrete', 'pie' or 'box'
+* line - Line chart. Options:
+* spotColor - Set to '' to not end each line in a circular spot
+* minSpotColor - If set, color of spot at minimum value
+* maxSpotColor - If set, color of spot at maximum value
+* spotRadius - Radius in pixels
+* lineWidth - Width of line in pixels
+* normalRangeMin
+* normalRangeMax - If set draws a filled horizontal bar between these two values marking the "normal"
+* or expected range of values
+* normalRangeColor - Color to use for the above bar
+* drawNormalOnTop - Draw the normal range above the chart fill color if true
+* defaultPixelsPerValue - Defaults to 3 pixels of width for each value in the chart
+* highlightSpotColor - The color to use for drawing a highlight spot on mouseover - Set to null to disable
+* highlightLineColor - The color to use for drawing a highlight line on mouseover - Set to null to disable
+* valueSpots - Specify which points to draw spots on, and in which color. Accepts a range map
+*
+* bar - Bar chart. Options:
+* barColor - Color of bars for postive values
+* negBarColor - Color of bars for negative values
+* zeroColor - Color of bars with zero values
+* nullColor - Color of bars with null values - Defaults to omitting the bar entirely
+* barWidth - Width of bars in pixels
+* colorMap - Optional mappnig of values to colors to override the *BarColor values above
+* can be an Array of values to control the color of individual bars or a range map
+* to specify colors for individual ranges of values
+* barSpacing - Gap between bars in pixels
+* zeroAxis - Centers the y-axis around zero if true
+*
+* tristate - Charts values of win (>0), lose (<0) or draw (=0)
+* posBarColor - Color of win values
+* negBarColor - Color of lose values
+* zeroBarColor - Color of draw values
+* barWidth - Width of bars in pixels
+* barSpacing - Gap between bars in pixels
+* colorMap - Optional mappnig of values to colors to override the *BarColor values above
+* can be an Array of values to control the color of individual bars or a range map
+* to specify colors for individual ranges of values
+*
+* discrete - Options:
+* lineHeight - Height of each line in pixels - Defaults to 30% of the graph height
+* thesholdValue - Values less than this value will be drawn using thresholdColor instead of lineColor
+* thresholdColor
+*
+* bullet - Values for bullet graphs msut be in the order: target, performance, range1, range2, range3, ...
+* options:
+* targetColor - The color of the vertical target marker
+* targetWidth - The width of the target marker in pixels
+* performanceColor - The color of the performance measure horizontal bar
+* rangeColors - Colors to use for each qualitative range background color
+*
+* pie - Pie chart. Options:
+* sliceColors - An array of colors to use for pie slices
+* offset - Angle in degrees to offset the first slice - Try -90 or +90
+* borderWidth - Width of border to draw around the pie chart, in pixels - Defaults to 0 (no border)
+* borderColor - Color to use for the pie chart border - Defaults to #000
+*
+* box - Box plot. Options:
+* raw - Set to true to supply pre-computed plot points as values
+* values should be: low_outlier, low_whisker, q1, median, q3, high_whisker, high_outlier
+* When set to false you can supply any number of values and the box plot will
+* be computed for you. Default is false.
+* showOutliers - Set to true (default) to display outliers as circles
+* outlierIQR - Interquartile range used to determine outliers. Default 1.5
+* boxLineColor - Outline color of the box
+* boxFillColor - Fill color for the box
+* whiskerColor - Line color used for whiskers
+* outlierLineColor - Outline color of outlier circles
+* outlierFillColor - Fill color of the outlier circles
+* spotRadius - Radius of outlier circles
+* medianColor - Line color of the median line
+* target - Draw a target cross hair at the supplied value (default undefined)
+*
+*
+*
+* Examples:
+* $('#sparkline1').sparkline(myvalues, { lineColor: '#f00', fillColor: false });
+* $('.barsparks').sparkline('html', { type:'bar', height:'40px', barWidth:5 });
+* $('#tristate').sparkline([1,1,-1,1,0,0,-1], { type:'tristate' }):
+* $('#discrete').sparkline([1,3,4,5,5,3,4,5], { type:'discrete' });
+* $('#bullet').sparkline([10,12,12,9,7], { type:'bullet' });
+* $('#pie').sparkline([1,1,2], { type:'pie' });
+*/
+
+/*jslint regexp: true, browser: true, jquery: true, white: true, nomen: false, plusplus: false, maxerr: 500, indent: 4 */
+
+(function(factory) {
+ if(typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ }
+ else {
+ factory(jQuery);
+ }
+}
+(function($) {
+ 'use strict';
+
+ var UNSET_OPTION = {},
+ getDefaults, createClass, SPFormat, clipval, quartile, normalizeValue, normalizeValues,
+ remove, isNumber, all, sum, addCSS, ensureArray, formatNumber, RangeMap,
+ MouseHandler, Tooltip, barHighlightMixin,
+ line, bar, tristate, discrete, bullet, pie, box, defaultStyles, initStyles,
+ VShape, VCanvas_base, VCanvas_canvas, VCanvas_vml, pending, shapeCount = 0;
+
+ /**
+ * Default configuration settings
+ */
+ getDefaults = function () {
+ return {
+ // Settings common to most/all chart types
+ common: {
+ type: 'line',
+ lineColor: '#00f',
+ fillColor: '#cdf',
+ defaultPixelsPerValue: 3,
+ width: 'auto',
+ height: 'auto',
+ composite: false,
+ tagValuesAttribute: 'values',
+ tagOptionsPrefix: 'spark',
+ enableTagOptions: false,
+ enableHighlight: true,
+ highlightLighten: 1.4,
+ tooltipSkipNull: true,
+ tooltipPrefix: '',
+ tooltipSuffix: '',
+ disableHiddenCheck: false,
+ numberFormatter: false,
+ numberDigitGroupCount: 3,
+ numberDigitGroupSep: ',',
+ numberDecimalMark: '.',
+ disableTooltips: false,
+ disableInteraction: false
+ },
+ // Defaults for line charts
+ line: {
+ spotColor: '#f80',
+ highlightSpotColor: '#5f5',
+ highlightLineColor: '#f22',
+ spotRadius: 1.5,
+ minSpotColor: '#f80',
+ maxSpotColor: '#f80',
+ lineWidth: 1,
+ normalRangeMin: undefined,
+ normalRangeMax: undefined,
+ normalRangeColor: '#ccc',
+ drawNormalOnTop: false,
+ chartRangeMin: undefined,
+ chartRangeMax: undefined,
+ chartRangeMinX: undefined,
+ chartRangeMaxX: undefined,
+ tooltipFormat: new SPFormat('● {{prefix}}{{y}}{{suffix}}')
+ },
+ // Defaults for bar charts
+ bar: {
+ barColor: '#3366cc',
+ negBarColor: '#f44',
+ stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
+ '#dd4477', '#0099c6', '#990099'],
+ zeroColor: undefined,
+ nullColor: undefined,
+ zeroAxis: true,
+ barWidth: 4,
+ barSpacing: 1,
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ chartRangeClip: false,
+ colorMap: undefined,
+ tooltipFormat: new SPFormat('● {{prefix}}{{value}}{{suffix}}')
+ },
+ // Defaults for tristate charts
+ tristate: {
+ barWidth: 4,
+ barSpacing: 1,
+ posBarColor: '#6f6',
+ negBarColor: '#f44',
+ zeroBarColor: '#999',
+ colorMap: {},
+ tooltipFormat: new SPFormat('● {{value:map}}'),
+ tooltipValueLookups: { map: { '-1': 'Loss', '0': 'Draw', '1': 'Win' } }
+ },
+ // Defaults for discrete charts
+ discrete: {
+ lineHeight: 'auto',
+ thresholdColor: undefined,
+ thresholdValue: 0,
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ chartRangeClip: false,
+ tooltipFormat: new SPFormat('{{prefix}}{{value}}{{suffix}}')
+ },
+ // Defaults for bullet charts
+ bullet: {
+ targetColor: '#f33',
+ targetWidth: 3, // width of the target bar in pixels
+ performanceColor: '#33f',
+ rangeColors: ['#d3dafe', '#a8b6ff', '#7f94ff'],
+ base: undefined, // set this to a number to change the base start number
+ tooltipFormat: new SPFormat('{{fieldkey:fields}} - {{value}}'),
+ tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Target'} }
+ },
+ // Defaults for pie charts
+ pie: {
+ offset: 0,
+ sliceColors: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
+ '#dd4477', '#0099c6', '#990099'],
+ borderWidth: 0,
+ borderColor: '#000',
+ tooltipFormat: new SPFormat('● {{value}} ({{percent.1}}%)')
+ },
+ // Defaults for box plots
+ box: {
+ raw: false,
+ boxLineColor: '#000',
+ boxFillColor: '#cdf',
+ whiskerColor: '#000',
+ outlierLineColor: '#333',
+ outlierFillColor: '#fff',
+ medianColor: '#f00',
+ showOutliers: true,
+ outlierIQR: 1.5,
+ spotRadius: 1.5,
+ target: undefined,
+ targetColor: '#4a2',
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ tooltipFormat: new SPFormat('{{field:fields}}: {{value}}'),
+ tooltipFormatFieldlistKey: 'field',
+ tooltipValueLookups: { fields: { lq: 'Lower Quartile', med: 'Median',
+ uq: 'Upper Quartile', lo: 'Left Outlier', ro: 'Right Outlier',
+ lw: 'Left Whisker', rw: 'Right Whisker'} }
+ }
+ };
+ };
+
+ // You can have tooltips use a css class other than jqstooltip by specifying tooltipClassname
+ defaultStyles = '.jqstooltip { ' +
+ 'position: absolute;' +
+ 'left: 0px;' +
+ 'top: 0px;' +
+ 'visibility: hidden;' +
+ 'background: rgb(0, 0, 0) transparent;' +
+ 'background-color: rgba(0,0,0,0.6);' +
+ 'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);' +
+ '-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";' +
+ 'color: white;' +
+ 'font: 10px arial, san serif;' +
+ 'text-align: left;' +
+ 'white-space: nowrap;' +
+ 'padding: 5px;' +
+ 'border: 1px solid white;' +
+ 'z-index: 10000;' +
+ '}' +
+ '.jqsfield { ' +
+ 'color: white;' +
+ 'font: 10px arial, san serif;' +
+ 'text-align: left;' +
+ '}';
+
+ /**
+ * Utilities
+ */
+
+ createClass = function (/* [baseclass, [mixin, ...]], definition */) {
+ var Class, args;
+ Class = function () {
+ this.init.apply(this, arguments);
+ };
+ if (arguments.length > 1) {
+ if (arguments[0]) {
+ Class.prototype = $.extend(new arguments[0](), arguments[arguments.length - 1]);
+ Class._super = arguments[0].prototype;
+ } else {
+ Class.prototype = arguments[arguments.length - 1];
+ }
+ if (arguments.length > 2) {
+ args = Array.prototype.slice.call(arguments, 1, -1);
+ args.unshift(Class.prototype);
+ $.extend.apply($, args);
+ }
+ } else {
+ Class.prototype = arguments[0];
+ }
+ Class.prototype.cls = Class;
+ return Class;
+ };
+
+ /**
+ * Wraps a format string for tooltips
+ * {{x}}
+ * {{x.2}
+ * {{x:months}}
+ */
+ $.SPFormatClass = SPFormat = createClass({
+ fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g,
+ precre: /(\w+)\.(\d+)/,
+
+ init: function (format, fclass) {
+ this.format = format;
+ this.fclass = fclass;
+ },
+
+ render: function (fieldset, lookups, options) {
+ var self = this,
+ fields = fieldset,
+ match, token, lookupkey, fieldvalue, prec;
+ return this.format.replace(this.fre, function () {
+ var lookup;
+ token = arguments[1];
+ lookupkey = arguments[3];
+ match = self.precre.exec(token);
+ if (match) {
+ prec = match[2];
+ token = match[1];
+ } else {
+ prec = false;
+ }
+ fieldvalue = fields[token];
+ if (fieldvalue === undefined) {
+ return '';
+ }
+ if (lookupkey && lookups && lookups[lookupkey]) {
+ lookup = lookups[lookupkey];
+ if (lookup.get) { // RangeMap
+ return lookups[lookupkey].get(fieldvalue) || fieldvalue;
+ } else {
+ return lookups[lookupkey][fieldvalue] || fieldvalue;
+ }
+ }
+ if (isNumber(fieldvalue)) {
+ if (options.get('numberFormatter')) {
+ fieldvalue = options.get('numberFormatter')(fieldvalue);
+ } else {
+ fieldvalue = formatNumber(fieldvalue, prec,
+ options.get('numberDigitGroupCount'),
+ options.get('numberDigitGroupSep'),
+ options.get('numberDecimalMark'));
+ }
+ }
+ return fieldvalue;
+ });
+ }
+ });
+
+ // convience method to avoid needing the new operator
+ $.spformat = function(format, fclass) {
+ return new SPFormat(format, fclass);
+ };
+
+ clipval = function (val, min, max) {
+ if (val < min) {
+ return min;
+ }
+ if (val > max) {
+ return max;
+ }
+ return val;
+ };
+
+ quartile = function (values, q) {
+ var vl;
+ if (q === 2) {
+ vl = Math.floor(values.length / 2);
+ return values.length % 2 ? values[vl] : (values[vl-1] + values[vl]) / 2;
+ } else {
+ if (values.length % 2 ) { // odd
+ vl = (values.length * q + q) / 4;
+ return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1];
+ } else { //even
+ vl = (values.length * q + 2) / 4;
+ return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1];
+
+ }
+ }
+ };
+
+ normalizeValue = function (val) {
+ var nf;
+ switch (val) {
+ case 'undefined':
+ val = undefined;
+ break;
+ case 'null':
+ val = null;
+ break;
+ case 'true':
+ val = true;
+ break;
+ case 'false':
+ val = false;
+ break;
+ default:
+ nf = parseFloat(val);
+ if (val == nf) {
+ val = nf;
+ }
+ }
+ return val;
+ };
+
+ normalizeValues = function (vals) {
+ var i, result = [];
+ for (i = vals.length; i--;) {
+ result[i] = normalizeValue(vals[i]);
+ }
+ return result;
+ };
+
+ remove = function (vals, filter) {
+ var i, vl, result = [];
+ for (i = 0, vl = vals.length; i < vl; i++) {
+ if (vals[i] !== filter) {
+ result.push(vals[i]);
+ }
+ }
+ return result;
+ };
+
+ isNumber = function (num) {
+ return !isNaN(parseFloat(num)) && isFinite(num);
+ };
+
+ formatNumber = function (num, prec, groupsize, groupsep, decsep) {
+ var p, i;
+ num = (prec === false ? parseFloat(num).toString() : num.toFixed(prec)).split('');
+ p = (p = $.inArray('.', num)) < 0 ? num.length : p;
+ if (p < num.length) {
+ num[p] = decsep;
+ }
+ for (i = p - groupsize; i > 0; i -= groupsize) {
+ num.splice(i, 0, groupsep);
+ }
+ return num.join('');
+ };
+
+ // determine if all values of an array match a value
+ // returns true if the array is empty
+ all = function (val, arr, ignoreNull) {
+ var i;
+ for (i = arr.length; i--; ) {
+ if (ignoreNull && arr[i] === null) continue;
+ if (arr[i] !== val) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ // sums the numeric values in an array, ignoring other values
+ sum = function (vals) {
+ var total = 0, i;
+ for (i = vals.length; i--;) {
+ total += typeof vals[i] === 'number' ? vals[i] : 0;
+ }
+ return total;
+ };
+
+ ensureArray = function (val) {
+ return $.isArray(val) ? val : [val];
+ };
+
+ // http://paulirish.com/2008/bookmarklet-inject-new-css-rules/
+ addCSS = function(css) {
+ var tag;
+ //if ('\v' == 'v') /* ie only */ {
+ if (document.createStyleSheet) {
+ document.createStyleSheet().cssText = css;
+ } else {
+ tag = document.createElement('style');
+ tag.type = 'text/css';
+ document.getElementsByTagName('head')[0].appendChild(tag);
+ tag[(typeof document.body.style.WebkitAppearance == 'string') /* webkit only */ ? 'innerText' : 'innerHTML'] = css;
+ }
+ };
+
+ // Provide a cross-browser interface to a few simple drawing primitives
+ $.fn.simpledraw = function (width, height, useExisting, interact) {
+ var target, mhandler;
+ if (useExisting && (target = this.data('_jqs_vcanvas'))) {
+ return target;
+ }
+ if (width === undefined) {
+ width = $(this).innerWidth();
+ }
+ if (height === undefined) {
+ height = $(this).innerHeight();
+ }
+ if ($.fn.sparkline.hasCanvas) {
+ target = new VCanvas_canvas(width, height, this, interact);
+ } else if ($.fn.sparkline.hasVML) {
+ target = new VCanvas_vml(width, height, this);
+ } else {
+ return false;
+ }
+ mhandler = $(this).data('_jqs_mhandler');
+ if (mhandler) {
+ mhandler.registerCanvas(target);
+ }
+ return target;
+ };
+
+ $.fn.cleardraw = function () {
+ var target = this.data('_jqs_vcanvas');
+ if (target) {
+ target.reset();
+ }
+ };
+
+ $.RangeMapClass = RangeMap = createClass({
+ init: function (map) {
+ var key, range, rangelist = [];
+ for (key in map) {
+ if (map.hasOwnProperty(key) && typeof key === 'string' && key.indexOf(':') > -1) {
+ range = key.split(':');
+ range[0] = range[0].length === 0 ? -Infinity : parseFloat(range[0]);
+ range[1] = range[1].length === 0 ? Infinity : parseFloat(range[1]);
+ range[2] = map[key];
+ rangelist.push(range);
+ }
+ }
+ this.map = map;
+ this.rangelist = rangelist || false;
+ },
+
+ get: function (value) {
+ var rangelist = this.rangelist,
+ i, range, result;
+ if ((result = this.map[value]) !== undefined) {
+ return result;
+ }
+ if (rangelist) {
+ for (i = rangelist.length; i--;) {
+ range = rangelist[i];
+ if (range[0] <= value && range[1] >= value) {
+ return range[2];
+ }
+ }
+ }
+ return undefined;
+ }
+ });
+
+ // Convenience function
+ $.range_map = function(map) {
+ return new RangeMap(map);
+ };
+
+ MouseHandler = createClass({
+ init: function (el, options) {
+ var $el = $(el);
+ this.$el = $el;
+ this.options = options;
+ this.currentPageX = 0;
+ this.currentPageY = 0;
+ this.el = el;
+ this.splist = [];
+ this.tooltip = null;
+ this.over = false;
+ this.displayTooltips = !options.get('disableTooltips');
+ this.highlightEnabled = !options.get('disableHighlight');
+ },
+
+ registerSparkline: function (sp) {
+ this.splist.push(sp);
+ if (this.over) {
+ this.updateDisplay();
+ }
+ },
+
+ registerCanvas: function (canvas) {
+ var $canvas = $(canvas.canvas);
+ this.canvas = canvas;
+ this.$canvas = $canvas;
+ $canvas.mouseenter($.proxy(this.mouseenter, this));
+ $canvas.mouseleave($.proxy(this.mouseleave, this));
+ $canvas.click($.proxy(this.mouseclick, this));
+ },
+
+ reset: function (removeTooltip) {
+ this.splist = [];
+ if (this.tooltip && removeTooltip) {
+ this.tooltip.remove();
+ this.tooltip = undefined;
+ }
+ },
+
+ mouseclick: function (e) {
+ var clickEvent = $.Event('sparklineClick');
+ clickEvent.originalEvent = e;
+ clickEvent.sparklines = this.splist;
+ this.$el.trigger(clickEvent);
+ },
+
+ mouseenter: function (e) {
+ $(document.body).unbind('mousemove.jqs');
+ $(document.body).bind('mousemove.jqs', $.proxy(this.mousemove, this));
+ this.over = true;
+ this.currentPageX = e.pageX;
+ this.currentPageY = e.pageY;
+ this.currentEl = e.target;
+ if (!this.tooltip && this.displayTooltips) {
+ this.tooltip = new Tooltip(this.options);
+ this.tooltip.updatePosition(e.pageX, e.pageY);
+ }
+ this.updateDisplay();
+ },
+
+ mouseleave: function () {
+ $(document.body).unbind('mousemove.jqs');
+ var splist = this.splist,
+ spcount = splist.length,
+ needsRefresh = false,
+ sp, i;
+ this.over = false;
+ this.currentEl = null;
+
+ if (this.tooltip) {
+ this.tooltip.remove();
+ this.tooltip = null;
+ }
+
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ if (sp.clearRegionHighlight()) {
+ needsRefresh = true;
+ }
+ }
+
+ if (needsRefresh) {
+ this.canvas.render();
+ }
+ },
+
+ mousemove: function (e) {
+ this.currentPageX = e.pageX;
+ this.currentPageY = e.pageY;
+ this.currentEl = e.target;
+ if (this.tooltip) {
+ this.tooltip.updatePosition(e.pageX, e.pageY);
+ }
+ this.updateDisplay();
+ },
+
+ updateDisplay: function () {
+ var splist = this.splist,
+ spcount = splist.length,
+ needsRefresh = false,
+ offset = this.$canvas.offset(),
+ localX = this.currentPageX - offset.left,
+ localY = this.currentPageY - offset.top,
+ tooltiphtml, sp, i, result, changeEvent;
+ if (!this.over) {
+ return;
+ }
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ result = sp.setRegionHighlight(this.currentEl, localX, localY);
+ if (result) {
+ needsRefresh = true;
+ }
+ }
+ if (needsRefresh) {
+ changeEvent = $.Event('sparklineRegionChange');
+ changeEvent.sparklines = this.splist;
+ this.$el.trigger(changeEvent);
+ if (this.tooltip) {
+ tooltiphtml = '';
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ tooltiphtml += sp.getCurrentRegionTooltip();
+ }
+ this.tooltip.setContent(tooltiphtml);
+ }
+ if (!this.disableHighlight) {
+ this.canvas.render();
+ }
+ }
+ if (result === null) {
+ this.mouseleave();
+ }
+ }
+ });
+
+
+ Tooltip = createClass({
+ sizeStyle: 'position: static !important;' +
+ 'display: block !important;' +
+ 'visibility: hidden !important;' +
+ 'float: left !important;',
+
+ init: function (options) {
+ var tooltipClassname = options.get('tooltipClassname', 'jqstooltip'),
+ sizetipStyle = this.sizeStyle,
+ offset;
+ this.container = options.get('tooltipContainer') || document.body;
+ this.tooltipOffsetX = options.get('tooltipOffsetX', 10);
+ this.tooltipOffsetY = options.get('tooltipOffsetY', 12);
+ // remove any previous lingering tooltip
+ $('#jqssizetip').remove();
+ $('#jqstooltip').remove();
+ this.sizetip = $('', {
+ id: 'jqssizetip',
+ style: sizetipStyle,
+ 'class': tooltipClassname
+ });
+ this.tooltip = $('', {
+ id: 'jqstooltip',
+ 'class': tooltipClassname
+ }).appendTo(this.container);
+ // account for the container's location
+ offset = this.tooltip.offset();
+ this.offsetLeft = offset.left;
+ this.offsetTop = offset.top;
+ this.hidden = true;
+ $(window).unbind('resize.jqs scroll.jqs');
+ $(window).bind('resize.jqs scroll.jqs', $.proxy(this.updateWindowDims, this));
+ this.updateWindowDims();
+ },
+
+ updateWindowDims: function () {
+ this.scrollTop = $(window).scrollTop();
+ this.scrollLeft = $(window).scrollLeft();
+ this.scrollRight = this.scrollLeft + $(window).width();
+ this.updatePosition();
+ },
+
+ getSize: function (content) {
+ this.sizetip.html(content).appendTo(this.container);
+ this.width = this.sizetip.width() + 1;
+ this.height = this.sizetip.height();
+ this.sizetip.remove();
+ },
+
+ setContent: function (content) {
+ if (!content) {
+ this.tooltip.css('visibility', 'hidden');
+ this.hidden = true;
+ return;
+ }
+ this.getSize(content);
+ this.tooltip.html(content)
+ .css({
+ 'width': this.width,
+ 'height': this.height,
+ 'visibility': 'visible'
+ });
+ if (this.hidden) {
+ this.hidden = false;
+ this.updatePosition();
+ }
+ },
+
+ updatePosition: function (x, y) {
+ if (x === undefined) {
+ if (this.mousex === undefined) {
+ return;
+ }
+ x = this.mousex - this.offsetLeft;
+ y = this.mousey - this.offsetTop;
+
+ } else {
+ this.mousex = x = x - this.offsetLeft;
+ this.mousey = y = y - this.offsetTop;
+ }
+ if (!this.height || !this.width || this.hidden) {
+ return;
+ }
+
+ y -= this.height + this.tooltipOffsetY;
+ x += this.tooltipOffsetX;
+
+ if (y < this.scrollTop) {
+ y = this.scrollTop;
+ }
+ if (x < this.scrollLeft) {
+ x = this.scrollLeft;
+ } else if (x + this.width > this.scrollRight) {
+ x = this.scrollRight - this.width;
+ }
+
+ this.tooltip.css({
+ 'left': x,
+ 'top': y
+ });
+ },
+
+ remove: function () {
+ this.tooltip.remove();
+ this.sizetip.remove();
+ this.sizetip = this.tooltip = undefined;
+ $(window).unbind('resize.jqs scroll.jqs');
+ }
+ });
+
+ initStyles = function() {
+ addCSS(defaultStyles);
+ };
+
+ $(initStyles);
+
+ pending = [];
+ $.fn.sparkline = function (userValues, userOptions) {
+ return this.each(function () {
+ var options = new $.fn.sparkline.options(this, userOptions),
+ $this = $(this),
+ render, i;
+ render = function () {
+ var values, width, height, tmp, mhandler, sp, vals;
+ if (userValues === 'html' || userValues === undefined) {
+ vals = this.getAttribute(options.get('tagValuesAttribute'));
+ if (vals === undefined || vals === null) {
+ vals = $this.html();
+ }
+ values = vals.replace(/(^\s*\s*$)|\s+/g, '').split(',');
+ } else {
+ values = userValues;
+ }
+
+ width = options.get('width') === 'auto' ? values.length * options.get('defaultPixelsPerValue') : options.get('width');
+ if (options.get('height') === 'auto') {
+ if (!options.get('composite') || !$.data(this, '_jqs_vcanvas')) {
+ // must be a better way to get the line height
+ tmp = document.createElement('span');
+ tmp.innerHTML = 'a';
+ $this.html(tmp);
+ height = $(tmp).innerHeight() || $(tmp).height();
+ $(tmp).remove();
+ tmp = null;
+ }
+ } else {
+ height = options.get('height');
+ }
+
+ if (!options.get('disableInteraction')) {
+ mhandler = $.data(this, '_jqs_mhandler');
+ if (!mhandler) {
+ mhandler = new MouseHandler(this, options);
+ $.data(this, '_jqs_mhandler', mhandler);
+ } else if (!options.get('composite')) {
+ mhandler.reset();
+ }
+ } else {
+ mhandler = false;
+ }
+
+ if (options.get('composite') && !$.data(this, '_jqs_vcanvas')) {
+ if (!$.data(this, '_jqs_errnotify')) {
+ alert('Attempted to attach a composite sparkline to an element with no existing sparkline');
+ $.data(this, '_jqs_errnotify', true);
+ }
+ return;
+ }
+
+ sp = new $.fn.sparkline[options.get('type')](this, values, options, width, height);
+
+ sp.render();
+
+ if (mhandler) {
+ mhandler.registerSparkline(sp);
+ }
+ };
+ // jQuery 1.3.0 completely changed the meaning of :hidden :-/
+ if (($(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || ($.fn.jquery < '1.3.0' && $(this).parents().is(':hidden')) || !$(this).parents('body').length) {
+ if (!options.get('composite') && $.data(this, '_jqs_pending')) {
+ // remove any existing references to the element
+ for (i = pending.length; i; i--) {
+ if (pending[i - 1][0] == this) {
+ pending.splice(i - 1, 1);
+ }
+ }
+ }
+ pending.push([this, render]);
+ $.data(this, '_jqs_pending', true);
+ } else {
+ render.call(this);
+ }
+ });
+ };
+
+ $.fn.sparkline.defaults = getDefaults();
+
+
+ $.sparkline_display_visible = function () {
+ var el, i, pl;
+ var done = [];
+ for (i = 0, pl = pending.length; i < pl; i++) {
+ el = pending[i][0];
+ if ($(el).is(':visible') && !$(el).parents().is(':hidden')) {
+ pending[i][1].call(el);
+ $.data(pending[i][0], '_jqs_pending', false);
+ done.push(i);
+ } else if (!$(el).closest('html').length && !$.data(el, '_jqs_pending')) {
+ // element has been inserted and removed from the DOM
+ // If it was not yet inserted into the dom then the .data request
+ // will return true.
+ // removing from the dom causes the data to be removed.
+ $.data(pending[i][0], '_jqs_pending', false);
+ done.push(i);
+ }
+ }
+ for (i = done.length; i; i--) {
+ pending.splice(done[i - 1], 1);
+ }
+ };
+
+
+ /**
+ * User option handler
+ */
+ $.fn.sparkline.options = createClass({
+ init: function (tag, userOptions) {
+ var extendedOptions, defaults, base, tagOptionType;
+ this.userOptions = userOptions = userOptions || {};
+ this.tag = tag;
+ this.tagValCache = {};
+ defaults = $.fn.sparkline.defaults;
+ base = defaults.common;
+ this.tagOptionsPrefix = userOptions.enableTagOptions && (userOptions.tagOptionsPrefix || base.tagOptionsPrefix);
+
+ tagOptionType = this.getTagSetting('type');
+ if (tagOptionType === UNSET_OPTION) {
+ extendedOptions = defaults[userOptions.type || base.type];
+ } else {
+ extendedOptions = defaults[tagOptionType];
+ }
+ this.mergedOptions = $.extend({}, base, extendedOptions, userOptions);
+ },
+
+
+ getTagSetting: function (key) {
+ var prefix = this.tagOptionsPrefix,
+ val, i, pairs, keyval;
+ if (prefix === false || prefix === undefined) {
+ return UNSET_OPTION;
+ }
+ if (this.tagValCache.hasOwnProperty(key)) {
+ val = this.tagValCache.key;
+ } else {
+ val = this.tag.getAttribute(prefix + key);
+ if (val === undefined || val === null) {
+ val = UNSET_OPTION;
+ } else if (val.substr(0, 1) === '[') {
+ val = val.substr(1, val.length - 2).split(',');
+ for (i = val.length; i--;) {
+ val[i] = normalizeValue(val[i].replace(/(^\s*)|(\s*$)/g, ''));
+ }
+ } else if (val.substr(0, 1) === '{') {
+ pairs = val.substr(1, val.length - 2).split(',');
+ val = {};
+ for (i = pairs.length; i--;) {
+ keyval = pairs[i].split(':', 2);
+ val[keyval[0].replace(/(^\s*)|(\s*$)/g, '')] = normalizeValue(keyval[1].replace(/(^\s*)|(\s*$)/g, ''));
+ }
+ } else {
+ val = normalizeValue(val);
+ }
+ this.tagValCache.key = val;
+ }
+ return val;
+ },
+
+ get: function (key, defaultval) {
+ var tagOption = this.getTagSetting(key),
+ result;
+ if (tagOption !== UNSET_OPTION) {
+ return tagOption;
+ }
+ return (result = this.mergedOptions[key]) === undefined ? defaultval : result;
+ }
+ });
+
+
+ $.fn.sparkline._base = createClass({
+ disabled: false,
+
+ init: function (el, values, options, width, height) {
+ this.el = el;
+ this.$el = $(el);
+ this.values = values;
+ this.options = options;
+ this.width = width;
+ this.height = height;
+ this.currentRegion = undefined;
+ },
+
+ /**
+ * Setup the canvas
+ */
+ initTarget: function () {
+ var interactive = !this.options.get('disableInteraction');
+ if (!(this.target = this.$el.simpledraw(this.width, this.height, this.options.get('composite'), interactive))) {
+ this.disabled = true;
+ } else {
+ this.canvasWidth = this.target.pixelWidth;
+ this.canvasHeight = this.target.pixelHeight;
+ }
+ },
+
+ /**
+ * Actually render the chart to the canvas
+ */
+ render: function () {
+ if (this.disabled) {
+ this.el.innerHTML = '';
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * Return a region id for a given x/y co-ordinate
+ */
+ getRegion: function (x, y) {
+ },
+
+ /**
+ * Highlight an item based on the moused-over x,y co-ordinate
+ */
+ setRegionHighlight: function (el, x, y) {
+ var currentRegion = this.currentRegion,
+ highlightEnabled = !this.options.get('disableHighlight'),
+ newRegion;
+ if (x > this.canvasWidth || y > this.canvasHeight || x < 0 || y < 0) {
+ return null;
+ }
+ newRegion = this.getRegion(el, x, y);
+ if (currentRegion !== newRegion) {
+ if (currentRegion !== undefined && highlightEnabled) {
+ this.removeHighlight();
+ }
+ this.currentRegion = newRegion;
+ if (newRegion !== undefined && highlightEnabled) {
+ this.renderHighlight();
+ }
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * Reset any currently highlighted item
+ */
+ clearRegionHighlight: function () {
+ if (this.currentRegion !== undefined) {
+ this.removeHighlight();
+ this.currentRegion = undefined;
+ return true;
+ }
+ return false;
+ },
+
+ renderHighlight: function () {
+ this.changeHighlight(true);
+ },
+
+ removeHighlight: function () {
+ this.changeHighlight(false);
+ },
+
+ changeHighlight: function (highlight) {},
+
+ /**
+ * Fetch the HTML to display as a tooltip
+ */
+ getCurrentRegionTooltip: function () {
+ var options = this.options,
+ header = '',
+ entries = [],
+ fields, formats, formatlen, fclass, text, i,
+ showFields, showFieldsKey, newFields, fv,
+ formatter, format, fieldlen, j;
+ if (this.currentRegion === undefined) {
+ return '';
+ }
+ fields = this.getCurrentRegionFields();
+ formatter = options.get('tooltipFormatter');
+ if (formatter) {
+ return formatter(this, options, fields);
+ }
+ if (options.get('tooltipChartTitle')) {
+ header += '
' + options.get('tooltipChartTitle') + '
\n';
+ }
+ formats = this.options.get('tooltipFormat');
+ if (!formats) {
+ return '';
+ }
+ if (!$.isArray(formats)) {
+ formats = [formats];
+ }
+ if (!$.isArray(fields)) {
+ fields = [fields];
+ }
+ showFields = this.options.get('tooltipFormatFieldlist');
+ showFieldsKey = this.options.get('tooltipFormatFieldlistKey');
+ if (showFields && showFieldsKey) {
+ // user-selected ordering of fields
+ newFields = [];
+ for (i = fields.length; i--;) {
+ fv = fields[i][showFieldsKey];
+ if ((j = $.inArray(fv, showFields)) != -1) {
+ newFields[j] = fields[i];
+ }
+ }
+ fields = newFields;
+ }
+ formatlen = formats.length;
+ fieldlen = fields.length;
+ for (i = 0; i < formatlen; i++) {
+ format = formats[i];
+ if (typeof format === 'string') {
+ format = new SPFormat(format);
+ }
+ fclass = format.fclass || 'jqsfield';
+ for (j = 0; j < fieldlen; j++) {
+ if (!fields[j].isNull || !options.get('tooltipSkipNull')) {
+ $.extend(fields[j], {
+ prefix: options.get('tooltipPrefix'),
+ suffix: options.get('tooltipSuffix')
+ });
+ text = format.render(fields[j], options.get('tooltipValueLookups'), options);
+ entries.push('
' + text + '
');
+ }
+ }
+ }
+ if (entries.length) {
+ return header + entries.join('\n');
+ }
+ return '';
+ },
+
+ getCurrentRegionFields: function () {},
+
+ calcHighlightColor: function (color, options) {
+ var highlightColor = options.get('highlightColor'),
+ lighten = options.get('highlightLighten'),
+ parse, mult, rgbnew, i;
+ if (highlightColor) {
+ return highlightColor;
+ }
+ if (lighten) {
+ // extract RGB values
+ parse = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(color) || /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);
+ if (parse) {
+ rgbnew = [];
+ mult = color.length === 4 ? 16 : 1;
+ for (i = 0; i < 3; i++) {
+ rgbnew[i] = clipval(Math.round(parseInt(parse[i + 1], 16) * mult * lighten), 0, 255);
+ }
+ return 'rgb(' + rgbnew.join(',') + ')';
+ }
+
+ }
+ return color;
+ }
+
+ });
+
+ barHighlightMixin = {
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ target = this.target,
+ shapeids = this.regionShapes[currentRegion],
+ newShapes;
+ // will be null if the region value was null
+ if (shapeids) {
+ newShapes = this.renderRegion(currentRegion, highlight);
+ if ($.isArray(newShapes) || $.isArray(shapeids)) {
+ target.replaceWithShapes(shapeids, newShapes);
+ this.regionShapes[currentRegion] = $.map(newShapes, function (newShape) {
+ return newShape.id;
+ });
+ } else {
+ target.replaceWithShape(shapeids, newShapes);
+ this.regionShapes[currentRegion] = newShapes.id;
+ }
+ }
+ },
+
+ render: function () {
+ var values = this.values,
+ target = this.target,
+ regionShapes = this.regionShapes,
+ shapes, ids, i, j;
+
+ if (!this.cls._super.render.call(this)) {
+ return;
+ }
+ for (i = values.length; i--;) {
+ shapes = this.renderRegion(i);
+ if (shapes) {
+ if ($.isArray(shapes)) {
+ ids = [];
+ for (j = shapes.length; j--;) {
+ shapes[j].append();
+ ids.push(shapes[j].id);
+ }
+ regionShapes[i] = ids;
+ } else {
+ shapes.append();
+ regionShapes[i] = shapes.id; // store just the shapeid
+ }
+ } else {
+ // null value
+ regionShapes[i] = null;
+ }
+ }
+ target.render();
+ }
+ };
+
+ /**
+ * Line charts
+ */
+ $.fn.sparkline.line = line = createClass($.fn.sparkline._base, {
+ type: 'line',
+
+ init: function (el, values, options, width, height) {
+ line._super.init.call(this, el, values, options, width, height);
+ this.vertices = [];
+ this.regionMap = [];
+ this.xvalues = [];
+ this.yvalues = [];
+ this.yminmax = [];
+ this.hightlightSpotId = null;
+ this.lastShapeId = null;
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ var i,
+ regionMap = this.regionMap; // maps regions to value positions
+ for (i = regionMap.length; i--;) {
+ if (regionMap[i] !== null && x >= regionMap[i][0] && x <= regionMap[i][1]) {
+ return regionMap[i][2];
+ }
+ }
+ return undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.yvalues[currentRegion] === null,
+ x: this.xvalues[currentRegion],
+ y: this.yvalues[currentRegion],
+ color: this.options.get('lineColor'),
+ fillColor: this.options.get('fillColor'),
+ offset: currentRegion
+ };
+ },
+
+ renderHighlight: function () {
+ var currentRegion = this.currentRegion,
+ target = this.target,
+ vertex = this.vertices[currentRegion],
+ options = this.options,
+ spotRadius = options.get('spotRadius'),
+ highlightSpotColor = options.get('highlightSpotColor'),
+ highlightLineColor = options.get('highlightLineColor'),
+ highlightSpot, highlightLine;
+
+ if (!vertex) {
+ return;
+ }
+ if (spotRadius && highlightSpotColor) {
+ highlightSpot = target.drawCircle(vertex[0], vertex[1],
+ spotRadius, undefined, highlightSpotColor);
+ this.highlightSpotId = highlightSpot.id;
+ target.insertAfterShape(this.lastShapeId, highlightSpot);
+ }
+ if (highlightLineColor) {
+ highlightLine = target.drawLine(vertex[0], this.canvasTop, vertex[0],
+ this.canvasTop + this.canvasHeight, highlightLineColor);
+ this.highlightLineId = highlightLine.id;
+ target.insertAfterShape(this.lastShapeId, highlightLine);
+ }
+ },
+
+ removeHighlight: function () {
+ var target = this.target;
+ if (this.highlightSpotId) {
+ target.removeShapeId(this.highlightSpotId);
+ this.highlightSpotId = null;
+ }
+ if (this.highlightLineId) {
+ target.removeShapeId(this.highlightLineId);
+ this.highlightLineId = null;
+ }
+ },
+
+ scanValues: function () {
+ var values = this.values,
+ valcount = values.length,
+ xvalues = this.xvalues,
+ yvalues = this.yvalues,
+ yminmax = this.yminmax,
+ i, val, isStr, isArray, sp;
+ for (i = 0; i < valcount; i++) {
+ val = values[i];
+ isStr = typeof(values[i]) === 'string';
+ isArray = typeof(values[i]) === 'object' && values[i] instanceof Array;
+ sp = isStr && values[i].split(':');
+ if (isStr && sp.length === 2) { // x:y
+ xvalues.push(Number(sp[0]));
+ yvalues.push(Number(sp[1]));
+ yminmax.push(Number(sp[1]));
+ } else if (isArray) {
+ xvalues.push(val[0]);
+ yvalues.push(val[1]);
+ yminmax.push(val[1]);
+ } else {
+ xvalues.push(i);
+ if (values[i] === null || values[i] === 'null') {
+ yvalues.push(null);
+ } else {
+ yvalues.push(Number(val));
+ yminmax.push(Number(val));
+ }
+ }
+ }
+ if (this.options.get('xvalues')) {
+ xvalues = this.options.get('xvalues');
+ }
+
+ this.maxy = this.maxyorg = Math.max.apply(Math, yminmax);
+ this.miny = this.minyorg = Math.min.apply(Math, yminmax);
+
+ this.maxx = Math.max.apply(Math, xvalues);
+ this.minx = Math.min.apply(Math, xvalues);
+
+ this.xvalues = xvalues;
+ this.yvalues = yvalues;
+ this.yminmax = yminmax;
+
+ },
+
+ processRangeOptions: function () {
+ var options = this.options,
+ normalRangeMin = options.get('normalRangeMin'),
+ normalRangeMax = options.get('normalRangeMax');
+
+ if (normalRangeMin !== undefined) {
+ if (normalRangeMin < this.miny) {
+ this.miny = normalRangeMin;
+ }
+ if (normalRangeMax > this.maxy) {
+ this.maxy = normalRangeMax;
+ }
+ }
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) {
+ this.miny = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) {
+ this.maxy = options.get('chartRangeMax');
+ }
+ if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) {
+ this.minx = options.get('chartRangeMinX');
+ }
+ if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) {
+ this.maxx = options.get('chartRangeMaxX');
+ }
+
+ },
+
+ drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) {
+ var normalRangeMin = this.options.get('normalRangeMin'),
+ normalRangeMax = this.options.get('normalRangeMax'),
+ ytop = canvasTop + Math.round(canvasHeight - (canvasHeight * ((normalRangeMax - this.miny) / rangey))),
+ height = Math.round((canvasHeight * (normalRangeMax - normalRangeMin)) / rangey);
+ this.target.drawRect(canvasLeft, ytop, canvasWidth, height, undefined, this.options.get('normalRangeColor')).append();
+ },
+
+ render: function () {
+ var options = this.options,
+ target = this.target,
+ canvasWidth = this.canvasWidth,
+ canvasHeight = this.canvasHeight,
+ vertices = this.vertices,
+ spotRadius = options.get('spotRadius'),
+ regionMap = this.regionMap,
+ rangex, rangey, yvallast,
+ canvasTop, canvasLeft,
+ vertex, path, paths, x, y, xnext, xpos, xposnext,
+ last, next, yvalcount, lineShapes, fillShapes, plen,
+ valueSpots, hlSpotsEnabled, color, xvalues, yvalues, i;
+
+ if (!line._super.render.call(this)) {
+ return;
+ }
+
+ this.scanValues();
+ this.processRangeOptions();
+
+ xvalues = this.xvalues;
+ yvalues = this.yvalues;
+
+ if (!this.yminmax.length || this.yvalues.length < 2) {
+ // empty or all null valuess
+ return;
+ }
+
+ canvasTop = canvasLeft = 0;
+
+ rangex = this.maxx - this.minx === 0 ? 1 : this.maxx - this.minx;
+ rangey = this.maxy - this.miny === 0 ? 1 : this.maxy - this.miny;
+ yvallast = this.yvalues.length - 1;
+
+ if (spotRadius && (canvasWidth < (spotRadius * 4) || canvasHeight < (spotRadius * 4))) {
+ spotRadius = 0;
+ }
+ if (spotRadius) {
+ // adjust the canvas size as required so that spots will fit
+ hlSpotsEnabled = options.get('highlightSpotColor') && !options.get('disableInteraction');
+ if (hlSpotsEnabled || options.get('minSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.miny)) {
+ canvasHeight -= Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled || options.get('maxSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.maxy)) {
+ canvasHeight -= Math.ceil(spotRadius);
+ canvasTop += Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled ||
+ ((options.get('minSpotColor') || options.get('maxSpotColor')) && (yvalues[0] === this.miny || yvalues[0] === this.maxy))) {
+ canvasLeft += Math.ceil(spotRadius);
+ canvasWidth -= Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled || options.get('spotColor') ||
+ (options.get('minSpotColor') || options.get('maxSpotColor') &&
+ (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) {
+ canvasWidth -= Math.ceil(spotRadius);
+ }
+ }
+
+
+ canvasHeight--;
+
+ if (options.get('normalRangeMin') !== undefined && !options.get('drawNormalOnTop')) {
+ this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey);
+ }
+
+ path = [];
+ paths = [path];
+ last = next = null;
+ yvalcount = yvalues.length;
+ for (i = 0; i < yvalcount; i++) {
+ x = xvalues[i];
+ xnext = xvalues[i + 1];
+ y = yvalues[i];
+ xpos = canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex));
+ xposnext = i < yvalcount - 1 ? canvasLeft + Math.round((xnext - this.minx) * (canvasWidth / rangex)) : canvasWidth;
+ next = xpos + ((xposnext - xpos) / 2);
+ regionMap[i] = [last || 0, next, i];
+ last = next;
+ if (y === null) {
+ if (i) {
+ if (yvalues[i - 1] !== null) {
+ path = [];
+ paths.push(path);
+ }
+ vertices.push(null);
+ }
+ } else {
+ if (y < this.miny) {
+ y = this.miny;
+ }
+ if (y > this.maxy) {
+ y = this.maxy;
+ }
+ if (!path.length) {
+ // previous value was null
+ path.push([xpos, canvasTop + canvasHeight]);
+ }
+ vertex = [xpos, canvasTop + Math.round(canvasHeight - (canvasHeight * ((y - this.miny) / rangey)))];
+ path.push(vertex);
+ vertices.push(vertex);
+ }
+ }
+
+ lineShapes = [];
+ fillShapes = [];
+ plen = paths.length;
+ for (i = 0; i < plen; i++) {
+ path = paths[i];
+ if (path.length) {
+ if (options.get('fillColor')) {
+ path.push([path[path.length - 1][0], (canvasTop + canvasHeight)]);
+ fillShapes.push(path.slice(0));
+ path.pop();
+ }
+ // if there's only a single point in this path, then we want to display it
+ // as a vertical line which means we keep path[0] as is
+ if (path.length > 2) {
+ // else we want the first value
+ path[0] = [path[0][0], path[1][1]];
+ }
+ lineShapes.push(path);
+ }
+ }
+
+ // draw the fill first, then optionally the normal range, then the line on top of that
+ plen = fillShapes.length;
+ for (i = 0; i < plen; i++) {
+ target.drawShape(fillShapes[i],
+ options.get('fillColor'), options.get('fillColor')).append();
+ }
+
+ if (options.get('normalRangeMin') !== undefined && options.get('drawNormalOnTop')) {
+ this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey);
+ }
+
+ plen = lineShapes.length;
+ for (i = 0; i < plen; i++) {
+ target.drawShape(lineShapes[i], options.get('lineColor'), undefined,
+ options.get('lineWidth')).append();
+ }
+
+ if (spotRadius && options.get('valueSpots')) {
+ valueSpots = options.get('valueSpots');
+ if (valueSpots.get === undefined) {
+ valueSpots = new RangeMap(valueSpots);
+ }
+ for (i = 0; i < yvalcount; i++) {
+ color = valueSpots.get(yvalues[i]);
+ if (color) {
+ target.drawCircle(canvasLeft + Math.round((xvalues[i] - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[i] - this.miny) / rangey))),
+ spotRadius, undefined,
+ color).append();
+ }
+ }
+
+ }
+ if (spotRadius && options.get('spotColor') && yvalues[yvallast] !== null) {
+ target.drawCircle(canvasLeft + Math.round((xvalues[xvalues.length - 1] - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[yvallast] - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('spotColor')).append();
+ }
+ if (this.maxy !== this.minyorg) {
+ if (spotRadius && options.get('minSpotColor')) {
+ x = xvalues[$.inArray(this.minyorg, yvalues)];
+ target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('minSpotColor')).append();
+ }
+ if (spotRadius && options.get('maxSpotColor')) {
+ x = xvalues[$.inArray(this.maxyorg, yvalues)];
+ target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('maxSpotColor')).append();
+ }
+ }
+
+ this.lastShapeId = target.getLastShapeId();
+ this.canvasTop = canvasTop;
+ target.render();
+ }
+ });
+
+ /**
+ * Bar charts
+ */
+ $.fn.sparkline.bar = bar = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'bar',
+
+ init: function (el, values, options, width, height) {
+ var barWidth = parseInt(options.get('barWidth'), 10),
+ barSpacing = parseInt(options.get('barSpacing'), 10),
+ chartRangeMin = options.get('chartRangeMin'),
+ chartRangeMax = options.get('chartRangeMax'),
+ chartRangeClip = options.get('chartRangeClip'),
+ stackMin = Infinity,
+ stackMax = -Infinity,
+ isStackString, groupMin, groupMax, stackRanges,
+ numValues, i, vlen, range, zeroAxis, xaxisOffset, min, max, clipMin, clipMax,
+ stacked, vlist, j, slen, svals, val, yoffset, yMaxCalc, canvasHeightEf;
+ bar._super.init.call(this, el, values, options, width, height);
+
+ // scan values to determine whether to stack bars
+ for (i = 0, vlen = values.length; i < vlen; i++) {
+ val = values[i];
+ isStackString = typeof(val) === 'string' && val.indexOf(':') > -1;
+ if (isStackString || $.isArray(val)) {
+ stacked = true;
+ if (isStackString) {
+ val = values[i] = normalizeValues(val.split(':'));
+ }
+ val = remove(val, null); // min/max will treat null as zero
+ groupMin = Math.min.apply(Math, val);
+ groupMax = Math.max.apply(Math, val);
+ if (groupMin < stackMin) {
+ stackMin = groupMin;
+ }
+ if (groupMax > stackMax) {
+ stackMax = groupMax;
+ }
+ }
+ }
+
+ this.stacked = stacked;
+ this.regionShapes = {};
+ this.barWidth = barWidth;
+ this.barSpacing = barSpacing;
+ this.totalBarWidth = barWidth + barSpacing;
+ this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing);
+
+ this.initTarget();
+
+ if (chartRangeClip) {
+ clipMin = chartRangeMin === undefined ? -Infinity : chartRangeMin;
+ clipMax = chartRangeMax === undefined ? Infinity : chartRangeMax;
+ }
+
+ numValues = [];
+ stackRanges = stacked ? [] : numValues;
+ var stackTotals = [];
+ var stackRangesNeg = [];
+ for (i = 0, vlen = values.length; i < vlen; i++) {
+ if (stacked) {
+ vlist = values[i];
+ values[i] = svals = [];
+ stackTotals[i] = 0;
+ stackRanges[i] = stackRangesNeg[i] = 0;
+ for (j = 0, slen = vlist.length; j < slen; j++) {
+ val = svals[j] = chartRangeClip ? clipval(vlist[j], clipMin, clipMax) : vlist[j];
+ if (val !== null) {
+ if (val > 0) {
+ stackTotals[i] += val;
+ }
+ if (stackMin < 0 && stackMax > 0) {
+ if (val < 0) {
+ stackRangesNeg[i] += Math.abs(val);
+ } else {
+ stackRanges[i] += val;
+ }
+ } else {
+ stackRanges[i] += Math.abs(val - (val < 0 ? stackMax : stackMin));
+ }
+ numValues.push(val);
+ }
+ }
+ } else {
+ val = chartRangeClip ? clipval(values[i], clipMin, clipMax) : values[i];
+ val = values[i] = normalizeValue(val);
+ if (val !== null) {
+ numValues.push(val);
+ }
+ }
+ }
+ this.max = max = Math.max.apply(Math, numValues);
+ this.min = min = Math.min.apply(Math, numValues);
+ this.stackMax = stackMax = stacked ? Math.max.apply(Math, stackTotals) : max;
+ this.stackMin = stackMin = stacked ? Math.min.apply(Math, numValues) : min;
+
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) {
+ min = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) {
+ max = options.get('chartRangeMax');
+ }
+
+ this.zeroAxis = zeroAxis = options.get('zeroAxis', true);
+ if (min <= 0 && max >= 0 && zeroAxis) {
+ xaxisOffset = 0;
+ } else if (zeroAxis == false) {
+ xaxisOffset = min;
+ } else if (min > 0) {
+ xaxisOffset = min;
+ } else {
+ xaxisOffset = max;
+ }
+ this.xaxisOffset = xaxisOffset;
+
+ range = stacked ? (Math.max.apply(Math, stackRanges) + Math.max.apply(Math, stackRangesNeg)) : max - min;
+
+ // as we plot zero/min values a single pixel line, we add a pixel to all other
+ // values - Reduce the effective canvas size to suit
+ this.canvasHeightEf = (zeroAxis && min < 0) ? this.canvasHeight - 2 : this.canvasHeight - 1;
+
+ if (min < xaxisOffset) {
+ yMaxCalc = (stacked && max >= 0) ? stackMax : max;
+ yoffset = (yMaxCalc - xaxisOffset) / range * this.canvasHeight;
+ if (yoffset !== Math.ceil(yoffset)) {
+ this.canvasHeightEf -= 2;
+ yoffset = Math.ceil(yoffset);
+ }
+ } else {
+ yoffset = this.canvasHeight;
+ }
+ this.yoffset = yoffset;
+
+ if ($.isArray(options.get('colorMap'))) {
+ this.colorMapByIndex = options.get('colorMap');
+ this.colorMapByValue = null;
+ } else {
+ this.colorMapByIndex = null;
+ this.colorMapByValue = options.get('colorMap');
+ if (this.colorMapByValue && this.colorMapByValue.get === undefined) {
+ this.colorMapByValue = new RangeMap(this.colorMapByValue);
+ }
+ }
+
+ this.range = range;
+ },
+
+ getRegion: function (el, x, y) {
+ var result = Math.floor(x / this.totalBarWidth);
+ return (result < 0 || result >= this.values.length) ? undefined : result;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion,
+ values = ensureArray(this.values[currentRegion]),
+ result = [],
+ value, i;
+ for (i = values.length; i--;) {
+ value = values[i];
+ result.push({
+ isNull: value === null,
+ value: value,
+ color: this.calcColor(i, value, currentRegion),
+ offset: currentRegion
+ });
+ }
+ return result;
+ },
+
+ calcColor: function (stacknum, value, valuenum) {
+ var colorMapByIndex = this.colorMapByIndex,
+ colorMapByValue = this.colorMapByValue,
+ options = this.options,
+ color, newColor;
+ if (this.stacked) {
+ color = options.get('stackedBarColor');
+ } else {
+ color = (value < 0) ? options.get('negBarColor') : options.get('barColor');
+ }
+ if (value === 0 && options.get('zeroColor') !== undefined) {
+ color = options.get('zeroColor');
+ }
+ if (colorMapByValue && (newColor = colorMapByValue.get(value))) {
+ color = newColor;
+ } else if (colorMapByIndex && colorMapByIndex.length > valuenum) {
+ color = colorMapByIndex[valuenum];
+ }
+ return $.isArray(color) ? color[stacknum % color.length] : color;
+ },
+
+ /**
+ * Render bar(s) for a region
+ */
+ renderRegion: function (valuenum, highlight) {
+ var vals = this.values[valuenum],
+ options = this.options,
+ xaxisOffset = this.xaxisOffset,
+ result = [],
+ range = this.range,
+ stacked = this.stacked,
+ target = this.target,
+ x = valuenum * this.totalBarWidth,
+ canvasHeightEf = this.canvasHeightEf,
+ yoffset = this.yoffset,
+ y, height, color, isNull, yoffsetNeg, i, valcount, val, minPlotted, allMin;
+
+ vals = $.isArray(vals) ? vals : [vals];
+ valcount = vals.length;
+ val = vals[0];
+ isNull = all(null, vals);
+ allMin = all(xaxisOffset, vals, true);
+
+ if (isNull) {
+ if (options.get('nullColor')) {
+ color = highlight ? options.get('nullColor') : this.calcHighlightColor(options.get('nullColor'), options);
+ y = (yoffset > 0) ? yoffset - 1 : yoffset;
+ return target.drawRect(x, y, this.barWidth - 1, 0, color, color);
+ } else {
+ return undefined;
+ }
+ }
+ yoffsetNeg = yoffset;
+ for (i = 0; i < valcount; i++) {
+ val = vals[i];
+
+ if (stacked && val === xaxisOffset) {
+ if (!allMin || minPlotted) {
+ continue;
+ }
+ minPlotted = true;
+ }
+
+ if (range > 0) {
+ height = Math.floor(canvasHeightEf * ((Math.abs(val - xaxisOffset) / range))) + 1;
+ } else {
+ height = 1;
+ }
+ if (val < xaxisOffset || (val === xaxisOffset && yoffset === 0)) {
+ y = yoffsetNeg;
+ yoffsetNeg += height;
+ } else {
+ y = yoffset - height;
+ yoffset -= height;
+ }
+ color = this.calcColor(i, val, valuenum);
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ result.push(target.drawRect(x, y, this.barWidth - 1, height - 1, color, color));
+ }
+ if (result.length === 1) {
+ return result[0];
+ }
+ return result;
+ }
+ });
+
+ /**
+ * Tristate charts
+ */
+ $.fn.sparkline.tristate = tristate = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'tristate',
+
+ init: function (el, values, options, width, height) {
+ var barWidth = parseInt(options.get('barWidth'), 10),
+ barSpacing = parseInt(options.get('barSpacing'), 10);
+ tristate._super.init.call(this, el, values, options, width, height);
+
+ this.regionShapes = {};
+ this.barWidth = barWidth;
+ this.barSpacing = barSpacing;
+ this.totalBarWidth = barWidth + barSpacing;
+ this.values = $.map(values, Number);
+ this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing);
+
+ if ($.isArray(options.get('colorMap'))) {
+ this.colorMapByIndex = options.get('colorMap');
+ this.colorMapByValue = null;
+ } else {
+ this.colorMapByIndex = null;
+ this.colorMapByValue = options.get('colorMap');
+ if (this.colorMapByValue && this.colorMapByValue.get === undefined) {
+ this.colorMapByValue = new RangeMap(this.colorMapByValue);
+ }
+ }
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ return Math.floor(x / this.totalBarWidth);
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ color: this.calcColor(this.values[currentRegion], currentRegion),
+ offset: currentRegion
+ };
+ },
+
+ calcColor: function (value, valuenum) {
+ var values = this.values,
+ options = this.options,
+ colorMapByIndex = this.colorMapByIndex,
+ colorMapByValue = this.colorMapByValue,
+ color, newColor;
+
+ if (colorMapByValue && (newColor = colorMapByValue.get(value))) {
+ color = newColor;
+ } else if (colorMapByIndex && colorMapByIndex.length > valuenum) {
+ color = colorMapByIndex[valuenum];
+ } else if (values[valuenum] < 0) {
+ color = options.get('negBarColor');
+ } else if (values[valuenum] > 0) {
+ color = options.get('posBarColor');
+ } else {
+ color = options.get('zeroBarColor');
+ }
+ return color;
+ },
+
+ renderRegion: function (valuenum, highlight) {
+ var values = this.values,
+ options = this.options,
+ target = this.target,
+ canvasHeight, height, halfHeight,
+ x, y, color;
+
+ canvasHeight = target.pixelHeight;
+ halfHeight = Math.round(canvasHeight / 2);
+
+ x = valuenum * this.totalBarWidth;
+ if (values[valuenum] < 0) {
+ y = halfHeight;
+ height = halfHeight - 1;
+ } else if (values[valuenum] > 0) {
+ y = 0;
+ height = halfHeight - 1;
+ } else {
+ y = halfHeight - 1;
+ height = 2;
+ }
+ color = this.calcColor(values[valuenum], valuenum);
+ if (color === null) {
+ return;
+ }
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ return target.drawRect(x, y, this.barWidth - 1, height - 1, color, color);
+ }
+ });
+
+ /**
+ * Discrete charts
+ */
+ $.fn.sparkline.discrete = discrete = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'discrete',
+
+ init: function (el, values, options, width, height) {
+ discrete._super.init.call(this, el, values, options, width, height);
+
+ this.regionShapes = {};
+ this.values = values = $.map(values, Number);
+ this.min = Math.min.apply(Math, values);
+ this.max = Math.max.apply(Math, values);
+ this.range = this.max - this.min;
+ this.width = width = options.get('width') === 'auto' ? values.length * 2 : this.width;
+ this.interval = Math.floor(width / values.length);
+ this.itemWidth = width / values.length;
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) {
+ this.min = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) {
+ this.max = options.get('chartRangeMax');
+ }
+ this.initTarget();
+ if (this.target) {
+ this.lineHeight = options.get('lineHeight') === 'auto' ? Math.round(this.canvasHeight * 0.3) : options.get('lineHeight');
+ }
+ },
+
+ getRegion: function (el, x, y) {
+ return Math.floor(x / this.itemWidth);
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ offset: currentRegion
+ };
+ },
+
+ renderRegion: function (valuenum, highlight) {
+ var values = this.values,
+ options = this.options,
+ min = this.min,
+ max = this.max,
+ range = this.range,
+ interval = this.interval,
+ target = this.target,
+ canvasHeight = this.canvasHeight,
+ lineHeight = this.lineHeight,
+ pheight = canvasHeight - lineHeight,
+ ytop, val, color, x;
+
+ val = clipval(values[valuenum], min, max);
+ x = valuenum * interval;
+ ytop = Math.round(pheight - pheight * ((val - min) / range));
+ color = (options.get('thresholdColor') && val < options.get('thresholdValue')) ? options.get('thresholdColor') : options.get('lineColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ return target.drawLine(x, ytop, x, ytop + lineHeight, color);
+ }
+ });
+
+ /**
+ * Bullet charts
+ */
+ $.fn.sparkline.bullet = bullet = createClass($.fn.sparkline._base, {
+ type: 'bullet',
+
+ init: function (el, values, options, width, height) {
+ var min, max, vals;
+ bullet._super.init.call(this, el, values, options, width, height);
+
+ // values: target, performance, range1, range2, range3
+ this.values = values = normalizeValues(values);
+ // target or performance could be null
+ vals = values.slice();
+ vals[0] = vals[0] === null ? vals[2] : vals[0];
+ vals[1] = values[1] === null ? vals[2] : vals[1];
+ min = Math.min.apply(Math, values);
+ max = Math.max.apply(Math, values);
+ if (options.get('base') === undefined) {
+ min = min < 0 ? min : 0;
+ } else {
+ min = options.get('base');
+ }
+ this.min = min;
+ this.max = max;
+ this.range = max - min;
+ this.shapes = {};
+ this.valueShapes = {};
+ this.regiondata = {};
+ this.width = width = options.get('width') === 'auto' ? '4.0em' : width;
+ this.target = this.$el.simpledraw(width, height, options.get('composite'));
+ if (!values.length) {
+ this.disabled = true;
+ }
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ var shapeid = this.target.getShapeAt(el, x, y);
+ return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ fieldkey: currentRegion.substr(0, 1),
+ value: this.values[currentRegion.substr(1)],
+ region: currentRegion
+ };
+ },
+
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ shapeid = this.valueShapes[currentRegion],
+ shape;
+ delete this.shapes[shapeid];
+ switch (currentRegion.substr(0, 1)) {
+ case 'r':
+ shape = this.renderRange(currentRegion.substr(1), highlight);
+ break;
+ case 'p':
+ shape = this.renderPerformance(highlight);
+ break;
+ case 't':
+ shape = this.renderTarget(highlight);
+ break;
+ }
+ this.valueShapes[currentRegion] = shape.id;
+ this.shapes[shape.id] = currentRegion;
+ this.target.replaceWithShape(shapeid, shape);
+ },
+
+ renderRange: function (rn, highlight) {
+ var rangeval = this.values[rn],
+ rangewidth = Math.round(this.canvasWidth * ((rangeval - this.min) / this.range)),
+ color = this.options.get('rangeColors')[rn - 2];
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(0, 0, rangewidth - 1, this.canvasHeight - 1, color, color);
+ },
+
+ renderPerformance: function (highlight) {
+ var perfval = this.values[1],
+ perfwidth = Math.round(this.canvasWidth * ((perfval - this.min) / this.range)),
+ color = this.options.get('performanceColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(0, Math.round(this.canvasHeight * 0.3), perfwidth - 1,
+ Math.round(this.canvasHeight * 0.4) - 1, color, color);
+ },
+
+ renderTarget: function (highlight) {
+ var targetval = this.values[0],
+ x = Math.round(this.canvasWidth * ((targetval - this.min) / this.range) - (this.options.get('targetWidth') / 2)),
+ targettop = Math.round(this.canvasHeight * 0.10),
+ targetheight = this.canvasHeight - (targettop * 2),
+ color = this.options.get('targetColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(x, targettop, this.options.get('targetWidth') - 1, targetheight - 1, color, color);
+ },
+
+ render: function () {
+ var vlen = this.values.length,
+ target = this.target,
+ i, shape;
+ if (!bullet._super.render.call(this)) {
+ return;
+ }
+ for (i = 2; i < vlen; i++) {
+ shape = this.renderRange(i).append();
+ this.shapes[shape.id] = 'r' + i;
+ this.valueShapes['r' + i] = shape.id;
+ }
+ if (this.values[1] !== null) {
+ shape = this.renderPerformance().append();
+ this.shapes[shape.id] = 'p1';
+ this.valueShapes.p1 = shape.id;
+ }
+ if (this.values[0] !== null) {
+ shape = this.renderTarget().append();
+ this.shapes[shape.id] = 't0';
+ this.valueShapes.t0 = shape.id;
+ }
+ target.render();
+ }
+ });
+
+ /**
+ * Pie charts
+ */
+ $.fn.sparkline.pie = pie = createClass($.fn.sparkline._base, {
+ type: 'pie',
+
+ init: function (el, values, options, width, height) {
+ var total = 0, i;
+
+ pie._super.init.call(this, el, values, options, width, height);
+
+ this.shapes = {}; // map shape ids to value offsets
+ this.valueShapes = {}; // maps value offsets to shape ids
+ this.values = values = $.map(values, Number);
+
+ if (options.get('width') === 'auto') {
+ this.width = this.height;
+ }
+
+ if (values.length > 0) {
+ for (i = values.length; i--;) {
+ total += values[i];
+ }
+ }
+ this.total = total;
+ this.initTarget();
+ this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2);
+ },
+
+ getRegion: function (el, x, y) {
+ var shapeid = this.target.getShapeAt(el, x, y);
+ return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ percent: this.values[currentRegion] / this.total * 100,
+ color: this.options.get('sliceColors')[currentRegion % this.options.get('sliceColors').length],
+ offset: currentRegion
+ };
+ },
+
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ newslice = this.renderSlice(currentRegion, highlight),
+ shapeid = this.valueShapes[currentRegion];
+ delete this.shapes[shapeid];
+ this.target.replaceWithShape(shapeid, newslice);
+ this.valueShapes[currentRegion] = newslice.id;
+ this.shapes[newslice.id] = currentRegion;
+ },
+
+ renderSlice: function (valuenum, highlight) {
+ var target = this.target,
+ options = this.options,
+ radius = this.radius,
+ borderWidth = options.get('borderWidth'),
+ offset = options.get('offset'),
+ circle = 2 * Math.PI,
+ values = this.values,
+ total = this.total,
+ next = offset ? (2*Math.PI)*(offset/360) : 0,
+ start, end, i, vlen, color;
+
+ vlen = values.length;
+ for (i = 0; i < vlen; i++) {
+ start = next;
+ end = next;
+ if (total > 0) { // avoid divide by zero
+ end = next + (circle * (values[i] / total));
+ }
+ if (valuenum === i) {
+ color = options.get('sliceColors')[i % options.get('sliceColors').length];
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+
+ return target.drawPieSlice(radius, radius, radius - borderWidth, start, end, undefined, color);
+ }
+ next = end;
+ }
+ },
+
+ render: function () {
+ var target = this.target,
+ values = this.values,
+ options = this.options,
+ radius = this.radius,
+ borderWidth = options.get('borderWidth'),
+ shape, i;
+
+ if (!pie._super.render.call(this)) {
+ return;
+ }
+ if (borderWidth) {
+ target.drawCircle(radius, radius, Math.floor(radius - (borderWidth / 2)),
+ options.get('borderColor'), undefined, borderWidth).append();
+ }
+ for (i = values.length; i--;) {
+ if (values[i]) { // don't render zero values
+ shape = this.renderSlice(i).append();
+ this.valueShapes[i] = shape.id; // store just the shapeid
+ this.shapes[shape.id] = i;
+ }
+ }
+ target.render();
+ }
+ });
+
+ /**
+ * Box plots
+ */
+ $.fn.sparkline.box = box = createClass($.fn.sparkline._base, {
+ type: 'box',
+
+ init: function (el, values, options, width, height) {
+ box._super.init.call(this, el, values, options, width, height);
+ this.values = $.map(values, Number);
+ this.width = options.get('width') === 'auto' ? '4.0em' : width;
+ this.initTarget();
+ if (!this.values.length) {
+ this.disabled = 1;
+ }
+ },
+
+ /**
+ * Simulate a single region
+ */
+ getRegion: function () {
+ return 1;
+ },
+
+ getCurrentRegionFields: function () {
+ var result = [
+ { field: 'lq', value: this.quartiles[0] },
+ { field: 'med', value: this.quartiles[1] },
+ { field: 'uq', value: this.quartiles[2] }
+ ];
+ if (this.loutlier !== undefined) {
+ result.push({ field: 'lo', value: this.loutlier});
+ }
+ if (this.routlier !== undefined) {
+ result.push({ field: 'ro', value: this.routlier});
+ }
+ if (this.lwhisker !== undefined) {
+ result.push({ field: 'lw', value: this.lwhisker});
+ }
+ if (this.rwhisker !== undefined) {
+ result.push({ field: 'rw', value: this.rwhisker});
+ }
+ return result;
+ },
+
+ render: function () {
+ var target = this.target,
+ values = this.values,
+ vlen = values.length,
+ options = this.options,
+ canvasWidth = this.canvasWidth,
+ canvasHeight = this.canvasHeight,
+ minValue = options.get('chartRangeMin') === undefined ? Math.min.apply(Math, values) : options.get('chartRangeMin'),
+ maxValue = options.get('chartRangeMax') === undefined ? Math.max.apply(Math, values) : options.get('chartRangeMax'),
+ canvasLeft = 0,
+ lwhisker, loutlier, iqr, q1, q2, q3, rwhisker, routlier, i,
+ size, unitSize;
+
+ if (!box._super.render.call(this)) {
+ return;
+ }
+
+ if (options.get('raw')) {
+ if (options.get('showOutliers') && values.length > 5) {
+ loutlier = values[0];
+ lwhisker = values[1];
+ q1 = values[2];
+ q2 = values[3];
+ q3 = values[4];
+ rwhisker = values[5];
+ routlier = values[6];
+ } else {
+ lwhisker = values[0];
+ q1 = values[1];
+ q2 = values[2];
+ q3 = values[3];
+ rwhisker = values[4];
+ }
+ } else {
+ values.sort(function (a, b) { return a - b; });
+ q1 = quartile(values, 1);
+ q2 = quartile(values, 2);
+ q3 = quartile(values, 3);
+ iqr = q3 - q1;
+ if (options.get('showOutliers')) {
+ lwhisker = rwhisker = undefined;
+ for (i = 0; i < vlen; i++) {
+ if (lwhisker === undefined && values[i] > q1 - (iqr * options.get('outlierIQR'))) {
+ lwhisker = values[i];
+ }
+ if (values[i] < q3 + (iqr * options.get('outlierIQR'))) {
+ rwhisker = values[i];
+ }
+ }
+ loutlier = values[0];
+ routlier = values[vlen - 1];
+ } else {
+ lwhisker = values[0];
+ rwhisker = values[vlen - 1];
+ }
+ }
+ this.quartiles = [q1, q2, q3];
+ this.lwhisker = lwhisker;
+ this.rwhisker = rwhisker;
+ this.loutlier = loutlier;
+ this.routlier = routlier;
+
+ unitSize = canvasWidth / (maxValue - minValue + 1);
+ if (options.get('showOutliers')) {
+ canvasLeft = Math.ceil(options.get('spotRadius'));
+ canvasWidth -= 2 * Math.ceil(options.get('spotRadius'));
+ unitSize = canvasWidth / (maxValue - minValue + 1);
+ if (loutlier < lwhisker) {
+ target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
+ canvasHeight / 2,
+ options.get('spotRadius'),
+ options.get('outlierLineColor'),
+ options.get('outlierFillColor')).append();
+ }
+ if (routlier > rwhisker) {
+ target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
+ canvasHeight / 2,
+ options.get('spotRadius'),
+ options.get('outlierLineColor'),
+ options.get('outlierFillColor')).append();
+ }
+ }
+
+ // box
+ target.drawRect(
+ Math.round((q1 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.1),
+ Math.round((q3 - q1) * unitSize),
+ Math.round(canvasHeight * 0.8),
+ options.get('boxLineColor'),
+ options.get('boxFillColor')).append();
+ // left whisker
+ target.drawLine(
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ Math.round((q1 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ options.get('lineColor')).append();
+ target.drawLine(
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 4),
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight - canvasHeight / 4),
+ options.get('whiskerColor')).append();
+ // right whisker
+ target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ Math.round((q3 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ options.get('lineColor')).append();
+ target.drawLine(
+ Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 4),
+ Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight - canvasHeight / 4),
+ options.get('whiskerColor')).append();
+ // median line
+ target.drawLine(
+ Math.round((q2 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.1),
+ Math.round((q2 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.9),
+ options.get('medianColor')).append();
+ if (options.get('target')) {
+ size = Math.ceil(options.get('spotRadius'));
+ target.drawLine(
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft),
+ Math.round((canvasHeight / 2) - size),
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft),
+ Math.round((canvasHeight / 2) + size),
+ options.get('targetColor')).append();
+ target.drawLine(
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft - size),
+ Math.round(canvasHeight / 2),
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft + size),
+ Math.round(canvasHeight / 2),
+ options.get('targetColor')).append();
+ }
+ target.render();
+ }
+ });
+
+ // Setup a very simple "virtual canvas" to make drawing the few shapes we need easier
+ // This is accessible as $(foo).simpledraw()
+
+ // Detect browser renderer support
+ (function() {
+ if (document.namespaces && !document.namespaces.v) {
+ $.fn.sparkline.hasVML = true;
+ document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML');
+ } else {
+ $.fn.sparkline.hasVML = false;
+ }
+
+ var el = document.createElement('canvas');
+ $.fn.sparkline.hasCanvas = !!(el.getContext && el.getContext('2d'));
+
+ })()
+
+ VShape = createClass({
+ init: function (target, id, type, args) {
+ this.target = target;
+ this.id = id;
+ this.type = type;
+ this.args = args;
+ },
+ append: function () {
+ this.target.appendShape(this);
+ return this;
+ }
+ });
+
+ VCanvas_base = createClass({
+ _pxregex: /(\d+)(px)?\s*$/i,
+
+ init: function (width, height, target) {
+ if (!width) {
+ return;
+ }
+ this.width = width;
+ this.height = height;
+ this.target = target;
+ this.lastShapeId = null;
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ },
+
+ drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) {
+ return this.drawShape([[x1, y1], [x2, y2]], lineColor, lineWidth);
+ },
+
+ drawShape: function (path, lineColor, fillColor, lineWidth) {
+ return this._genShape('Shape', [path, lineColor, fillColor, lineWidth]);
+ },
+
+ drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) {
+ return this._genShape('Circle', [x, y, radius, lineColor, fillColor, lineWidth]);
+ },
+
+ drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ return this._genShape('PieSlice', [x, y, radius, startAngle, endAngle, lineColor, fillColor]);
+ },
+
+ drawRect: function (x, y, width, height, lineColor, fillColor) {
+ return this._genShape('Rect', [x, y, width, height, lineColor, fillColor]);
+ },
+
+ getElement: function () {
+ return this.canvas;
+ },
+
+ /**
+ * Return the most recently inserted shape id
+ */
+ getLastShapeId: function () {
+ return this.lastShapeId;
+ },
+
+ /**
+ * Clear and reset the canvas
+ */
+ reset: function () {
+ alert('reset not implemented');
+ },
+
+ _insert: function (el, target) {
+ $(target).html(el);
+ },
+
+ /**
+ * Calculate the pixel dimensions of the canvas
+ */
+ _calculatePixelDims: function (width, height, canvas) {
+ // XXX This should probably be a configurable option
+ var match;
+ match = this._pxregex.exec(height);
+ if (match) {
+ this.pixelHeight = match[1];
+ } else {
+ this.pixelHeight = $(canvas).height();
+ }
+ match = this._pxregex.exec(width);
+ if (match) {
+ this.pixelWidth = match[1];
+ } else {
+ this.pixelWidth = $(canvas).width();
+ }
+ },
+
+ /**
+ * Generate a shape object and id for later rendering
+ */
+ _genShape: function (shapetype, shapeargs) {
+ var id = shapeCount++;
+ shapeargs.unshift(id);
+ return new VShape(this, id, shapetype, shapeargs);
+ },
+
+ /**
+ * Add a shape to the end of the render queue
+ */
+ appendShape: function (shape) {
+ alert('appendShape not implemented');
+ },
+
+ /**
+ * Replace one shape with another
+ */
+ replaceWithShape: function (shapeid, shape) {
+ alert('replaceWithShape not implemented');
+ },
+
+ /**
+ * Insert one shape after another in the render queue
+ */
+ insertAfterShape: function (shapeid, shape) {
+ alert('insertAfterShape not implemented');
+ },
+
+ /**
+ * Remove a shape from the queue
+ */
+ removeShapeId: function (shapeid) {
+ alert('removeShapeId not implemented');
+ },
+
+ /**
+ * Find a shape at the specified x/y co-ordinates
+ */
+ getShapeAt: function (el, x, y) {
+ alert('getShapeAt not implemented');
+ },
+
+ /**
+ * Render all queued shapes onto the canvas
+ */
+ render: function () {
+ alert('render not implemented');
+ }
+ });
+
+ VCanvas_canvas = createClass(VCanvas_base, {
+ init: function (width, height, target, interact) {
+ VCanvas_canvas._super.init.call(this, width, height, target);
+ this.canvas = document.createElement('canvas');
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ $(this.canvas).css({ display: 'inline-block', width: width, height: height, verticalAlign: 'top' });
+ this._insert(this.canvas, target);
+ this._calculatePixelDims(width, height, this.canvas);
+ this.canvas.width = this.pixelWidth;
+ this.canvas.height = this.pixelHeight;
+ this.interact = interact;
+ this.shapes = {};
+ this.shapeseq = [];
+ this.currentTargetShapeId = undefined;
+ $(this.canvas).css({width: this.pixelWidth, height: this.pixelHeight});
+ },
+
+ _getContext: function (lineColor, fillColor, lineWidth) {
+ var context = this.canvas.getContext('2d');
+ if (lineColor !== undefined) {
+ context.strokeStyle = lineColor;
+ }
+ context.lineWidth = lineWidth === undefined ? 1 : lineWidth;
+ if (fillColor !== undefined) {
+ context.fillStyle = fillColor;
+ }
+ return context;
+ },
+
+ reset: function () {
+ var context = this._getContext();
+ context.clearRect(0, 0, this.pixelWidth, this.pixelHeight);
+ this.shapes = {};
+ this.shapeseq = [];
+ this.currentTargetShapeId = undefined;
+ },
+
+ _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
+ var context = this._getContext(lineColor, fillColor, lineWidth),
+ i, plen;
+ context.beginPath();
+ context.moveTo(path[0][0] + 0.5, path[0][1] + 0.5);
+ for (i = 1, plen = path.length; i < plen; i++) {
+ context.lineTo(path[i][0] + 0.5, path[i][1] + 0.5); // the 0.5 offset gives us crisp pixel-width lines
+ }
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor !== undefined) {
+ context.fill();
+ }
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ },
+
+ _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
+ var context = this._getContext(lineColor, fillColor, lineWidth);
+ context.beginPath();
+ context.arc(x, y, radius, 0, 2 * Math.PI, false);
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor !== undefined) {
+ context.fill();
+ }
+ },
+
+ _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ var context = this._getContext(lineColor, fillColor);
+ context.beginPath();
+ context.moveTo(x, y);
+ context.arc(x, y, radius, startAngle, endAngle, false);
+ context.lineTo(x, y);
+ context.closePath();
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor) {
+ context.fill();
+ }
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ },
+
+ _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
+ return this._drawShape(shapeid, [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]], lineColor, fillColor);
+ },
+
+ appendShape: function (shape) {
+ this.shapes[shape.id] = shape;
+ this.shapeseq.push(shape.id);
+ this.lastShapeId = shape.id;
+ return shape.id;
+ },
+
+ replaceWithShape: function (shapeid, shape) {
+ var shapeseq = this.shapeseq,
+ i;
+ this.shapes[shape.id] = shape;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] == shapeid) {
+ shapeseq[i] = shape.id;
+ }
+ }
+ delete this.shapes[shapeid];
+ },
+
+ replaceWithShapes: function (shapeids, shapes) {
+ var shapeseq = this.shapeseq,
+ shapemap = {},
+ sid, i, first;
+
+ for (i = shapeids.length; i--;) {
+ shapemap[shapeids[i]] = true;
+ }
+ for (i = shapeseq.length; i--;) {
+ sid = shapeseq[i];
+ if (shapemap[sid]) {
+ shapeseq.splice(i, 1);
+ delete this.shapes[sid];
+ first = i;
+ }
+ }
+ for (i = shapes.length; i--;) {
+ shapeseq.splice(first, 0, shapes[i].id);
+ this.shapes[shapes[i].id] = shapes[i];
+ }
+
+ },
+
+ insertAfterShape: function (shapeid, shape) {
+ var shapeseq = this.shapeseq,
+ i;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] === shapeid) {
+ shapeseq.splice(i + 1, 0, shape.id);
+ this.shapes[shape.id] = shape;
+ return;
+ }
+ }
+ },
+
+ removeShapeId: function (shapeid) {
+ var shapeseq = this.shapeseq,
+ i;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] === shapeid) {
+ shapeseq.splice(i, 1);
+ break;
+ }
+ }
+ delete this.shapes[shapeid];
+ },
+
+ getShapeAt: function (el, x, y) {
+ this.targetX = x;
+ this.targetY = y;
+ this.render();
+ return this.currentTargetShapeId;
+ },
+
+ render: function () {
+ var shapeseq = this.shapeseq,
+ shapes = this.shapes,
+ shapeCount = shapeseq.length,
+ context = this._getContext(),
+ shapeid, shape, i;
+ context.clearRect(0, 0, this.pixelWidth, this.pixelHeight);
+ for (i = 0; i < shapeCount; i++) {
+ shapeid = shapeseq[i];
+ shape = shapes[shapeid];
+ this['_draw' + shape.type].apply(this, shape.args);
+ }
+ if (!this.interact) {
+ // not interactive so no need to keep the shapes array
+ this.shapes = {};
+ this.shapeseq = [];
+ }
+ }
+
+ });
+
+ VCanvas_vml = createClass(VCanvas_base, {
+ init: function (width, height, target) {
+ var groupel;
+ VCanvas_vml._super.init.call(this, width, height, target);
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ this.canvas = document.createElement('span');
+ $(this.canvas).css({ display: 'inline-block', position: 'relative', overflow: 'hidden', width: width, height: height, margin: '0px', padding: '0px', verticalAlign: 'top'});
+ this._insert(this.canvas, target);
+ this._calculatePixelDims(width, height, this.canvas);
+ this.canvas.width = this.pixelWidth;
+ this.canvas.height = this.pixelHeight;
+ groupel = '';
+ this.canvas.insertAdjacentHTML('beforeEnd', groupel);
+ this.group = $(this.canvas).children()[0];
+ this.rendered = false;
+ this.prerender = '';
+ },
+
+ _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
+ var vpath = [],
+ initial, stroke, fill, closed, vel, plen, i;
+ for (i = 0, plen = path.length; i < plen; i++) {
+ vpath[i] = '' + (path[i][0]) + ',' + (path[i][1]);
+ }
+ initial = vpath.splice(0, 1);
+ lineWidth = lineWidth === undefined ? 1 : lineWidth;
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ closed = vpath[0] === vpath[vpath.length - 1] ? 'x ' : '';
+ vel = '' +
+ ' ';
+ return vel;
+ },
+
+ _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
+ var stroke, fill, vel;
+ x -= radius;
+ y -= radius;
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ vel = '';
+ return vel;
+
+ },
+
+ _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ var vpath, startx, starty, endx, endy, stroke, fill, vel;
+ if (startAngle === endAngle) {
+ return ''; // VML seems to have problem when start angle equals end angle.
+ }
+ if ((endAngle - startAngle) === (2 * Math.PI)) {
+ startAngle = 0.0; // VML seems to have a problem when drawing a full circle that doesn't start 0
+ endAngle = (2 * Math.PI);
+ }
+
+ startx = x + Math.round(Math.cos(startAngle) * radius);
+ starty = y + Math.round(Math.sin(startAngle) * radius);
+ endx = x + Math.round(Math.cos(endAngle) * radius);
+ endy = y + Math.round(Math.sin(endAngle) * radius);
+
+ if (startx === endx && starty === endy) {
+ if ((endAngle - startAngle) < Math.PI) {
+ // Prevent very small slices from being mistaken as a whole pie
+ return '';
+ }
+ // essentially going to be the entire circle, so ignore startAngle
+ startx = endx = x + radius;
+ starty = endy = y;
+ }
+
+ if (startx === endx && starty === endy && (endAngle - startAngle) < Math.PI) {
+ return '';
+ }
+
+ vpath = [x - radius, y - radius, x + radius, y + radius, startx, starty, endx, endy];
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ vel = '' +
+ ' ';
+ return vel;
+ },
+
+ _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
+ return this._drawShape(shapeid, [[x, y], [x, y + height], [x + width, y + height], [x + width, y], [x, y]], lineColor, fillColor);
+ },
+
+ reset: function () {
+ this.group.innerHTML = '';
+ },
+
+ appendShape: function (shape) {
+ var vel = this['_draw' + shape.type].apply(this, shape.args);
+ if (this.rendered) {
+ this.group.insertAdjacentHTML('beforeEnd', vel);
+ } else {
+ this.prerender += vel;
+ }
+ this.lastShapeId = shape.id;
+ return shape.id;
+ },
+
+ replaceWithShape: function (shapeid, shape) {
+ var existing = $('#jqsshape' + shapeid),
+ vel = this['_draw' + shape.type].apply(this, shape.args);
+ existing[0].outerHTML = vel;
+ },
+
+ replaceWithShapes: function (shapeids, shapes) {
+ // replace the first shapeid with all the new shapes then toast the remaining old shapes
+ var existing = $('#jqsshape' + shapeids[0]),
+ replace = '',
+ slen = shapes.length,
+ i;
+ for (i = 0; i < slen; i++) {
+ replace += this['_draw' + shapes[i].type].apply(this, shapes[i].args);
+ }
+ existing[0].outerHTML = replace;
+ for (i = 1; i < shapeids.length; i++) {
+ $('#jqsshape' + shapeids[i]).remove();
+ }
+ },
+
+ insertAfterShape: function (shapeid, shape) {
+ var existing = $('#jqsshape' + shapeid),
+ vel = this['_draw' + shape.type].apply(this, shape.args);
+ existing[0].insertAdjacentHTML('afterEnd', vel);
+ },
+
+ removeShapeId: function (shapeid) {
+ var existing = $('#jqsshape' + shapeid);
+ this.group.removeChild(existing[0]);
+ },
+
+ getShapeAt: function (el, x, y) {
+ var shapeid = el.id.substr(8);
+ return shapeid;
+ },
+
+ render: function () {
+ if (!this.rendered) {
+ // batch the intial render into a single repaint
+ this.group.innerHTML = this.prerender;
+ this.rendered = true;
+ }
+ }
+ });
+
+}));
diff --git a/addons/crm/static/src/css/crm.css b/addons/crm/static/src/css/crm.css
index 3ad3840a4e1..ba4473edc26 100644
--- a/addons/crm/static/src/css/crm.css
+++ b/addons/crm/static/src/css/crm.css
@@ -20,15 +20,27 @@
}
.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list {
- margin: 10px 0;
+ position: relative;
+ margin: 10px;
}
-.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list a {
- width: 110px;
+.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div {
+ width: 160px;
+ height: 22px;
+ margin: 0 !important;
+ position: relative;
display: inline-block;
}
.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list a:hover {
text-decoration: underline !important;
}
+.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div a:nth-child(2n) {
+ position: absolute;
+ left: 90px;
+ top: 0;
+}
+.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list div:nth-child(2n) a:nth-child(2n) {
+ left: 110px;
+}
.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_center {
text-align: center;
margin: 3px 0;
@@ -40,3 +52,13 @@
.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_center .oe_subsum {
font-size: 10px;
}
+
+.openerp .oe_kanban_view .oe_justgage {
+ color: black;
+ display: inline-block;
+}
+
+.openerp .oe_kanban_view .oe_sparkline_bar {
+ height: 20px;
+ width: 36px;
+}
\ No newline at end of file
diff --git a/addons/crm/static/src/js/crm.js b/addons/crm/static/src/js/crm.js
deleted file mode 100644
index e027313d6dc..00000000000
--- a/addons/crm/static/src/js/crm.js
+++ /dev/null
@@ -1,11 +0,0 @@
-openerp.crm = function(openerp) {
- openerp.web_kanban.KanbanRecord.include({
- on_card_clicked: function() {
- if (this.view.dataset.model === 'crm.case.section') {
- this.$('.oe_kanban_crm_salesteams_list a').first().click();
- } else {
- this._super.apply(this, arguments);
- }
- },
- });
-};
diff --git a/addons/crm/static/src/js/crm_case_section.js b/addons/crm/static/src/js/crm_case_section.js
new file mode 100644
index 00000000000..2b4ca741d75
--- /dev/null
+++ b/addons/crm/static/src/js/crm_case_section.js
@@ -0,0 +1,34 @@
+openerp.crm = function(openerp) {
+ openerp.web_kanban.KanbanRecord.include({
+ on_card_clicked: function() {
+ if (this.view.dataset.model === 'crm.case.section') {
+ this.$('.oe_kanban_crm_salesteams_list a').first().click();
+ } else {
+ this._super.apply(this, arguments);
+ }
+ },
+ });
+
+ openerp.crm.SparklineBarWidget = openerp.web_kanban.AbstractField.extend({
+ className: "oe_sparkline_bar",
+ start: function() {
+ var self = this;
+ var title = this.$node.html();
+ setTimeout(function () {
+ var value = _.pluck(self.field.value, 'value');
+ var tooltips = _.pluck(self.field.value, 'tooltip');
+ self.$el.sparkline(value, {
+ type: 'bar',
+ barWidth: 5,
+ tooltipFormat: '{{offset:offset}} {{value}}',
+ tooltipValueLookups: {
+ 'offset': tooltips
+ },
+ });
+ self.$el.tipsy({'delayIn': 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'});
+ }, 0);
+ },
+ });
+ openerp.web_kanban.fields_registry.add("sparkline_bar", "openerp.crm.SparklineBarWidget");
+
+};
diff --git a/addons/crm/test/crm_lead_cancel.yml b/addons/crm/test/crm_lead_cancel.yml
index edaf844952a..8749675bf23 100644
--- a/addons/crm/test/crm_lead_cancel.yml
+++ b/addons/crm/test/crm_lead_cancel.yml
@@ -1,7 +1,9 @@
-
- I cancel unqualified lead.
+ I set a new sale team (with Marketing at parent) and I cancel unqualified lead .
-
!python {model: crm.lead}: |
+ section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})
+ self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})
self.case_cancel(cr, uid, [ref("crm_case_1")])
-
I check cancelled lead.
@@ -42,4 +44,4 @@
I check the lead is correctly escalated to the parent team.
-
!assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}:
- - section_id.name == "Support Department"
+ - section_id.name == "Marketing"
diff --git a/addons/crm_claim/i18n/ru.po b/addons/crm_claim/i18n/ru.po
index afcf4702a67..4579b6d8557 100644
--- a/addons/crm_claim/i18n/ru.po
+++ b/addons/crm_claim/i18n/ru.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-10-24 05:01+0000\n"
+"PO-Revision-Date: 2013-05-30 14:03+0000\n"
"Last-Translator: Chertykov Denis \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-03-16 05:44+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-31 05:38+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: crm_claim
#: help:crm.claim.stage,fold:0
@@ -23,6 +23,8 @@ msgid ""
"This stage is not visible, for example in status bar or kanban view, when "
"there are no records in that stage to display."
msgstr ""
+"Эта стадия не видима, например в статус-баре или виде канбан, когда нет "
+"записей этой стадии для отображения."
#. module: crm_claim
#: field:crm.claim.report,nbr:0
@@ -46,11 +48,13 @@ msgid ""
"Allows you to configure your incoming mail server, and create claims from "
"incoming emails."
msgstr ""
+"Позволяет настроить сервер входящей почты и создавать претензии из входящих "
+"эл. писем."
#. module: crm_claim
#: model:ir.model,name:crm_claim.model_crm_claim_stage
msgid "Claim stages"
-msgstr ""
+msgstr "Этапы претензии"
#. module: crm_claim
#: selection:crm.claim.report,month:0
@@ -65,7 +69,7 @@ msgstr "Задержка закрытия"
#. module: crm_claim
#: field:crm.claim,message_unread:0
msgid "Unread Messages"
-msgstr ""
+msgstr "Непрочитанные"
#. module: crm_claim
#: field:crm.claim,resolution:0
@@ -100,12 +104,12 @@ msgstr "# претензий"
#. module: crm_claim
#: field:crm.claim.stage,name:0
msgid "Stage Name"
-msgstr ""
+msgstr "Название этапа"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "Salesperson"
-msgstr ""
+msgstr "Продавец"
#. module: crm_claim
#: selection:crm.claim,priority:0
@@ -149,7 +153,7 @@ msgstr "Предупредительная мера"
#. module: crm_claim
#: help:crm.claim,message_unread:0
msgid "If checked new messages require your attention."
-msgstr ""
+msgstr "Если отмечено, новые сообщения требуют вашего внимания."
#. module: crm_claim
#: field:crm.claim.report,date_closed:0
@@ -182,6 +186,8 @@ msgid ""
"Holds the Chatter summary (number of messages, ...). This summary is "
"directly in html format in order to be inserted in kanban views."
msgstr ""
+"Содержит сводку по Чаттеру (количество сообщений,...). Эта сводка в формате "
+"html для возможности использования в канбан виде"
#. module: crm_claim
#: view:crm.claim:0
@@ -235,12 +241,12 @@ msgstr "Важность"
#. module: crm_claim
#: field:crm.claim.stage,fold:0
msgid "Hide in Views when Empty"
-msgstr ""
+msgstr "Скрыть вид, если пусто"
#. module: crm_claim
#: field:crm.claim,message_follower_ids:0
msgid "Followers"
-msgstr ""
+msgstr "Подписчики"
#. module: crm_claim
#: view:crm.claim:0
@@ -254,7 +260,7 @@ msgstr "Новый"
#. module: crm_claim
#: field:crm.claim.stage,section_ids:0
msgid "Sections"
-msgstr ""
+msgstr "Секции"
#. module: crm_claim
#: field:crm.claim,email_from:0
@@ -290,7 +296,7 @@ msgstr "Предмет претензии"
#. module: crm_claim
#: model:crm.claim.stage,name:crm_claim.stage_claim3
msgid "Rejected"
-msgstr ""
+msgstr "Отклонено"
#. module: crm_claim
#: field:crm.claim,date_action_next:0
@@ -344,7 +350,7 @@ msgstr ""
#: code:addons/crm_claim/crm_claim.py:194
#, python-format
msgid "No Subject"
-msgstr ""
+msgstr "Без темы"
#. module: crm_claim
#: help:crm.claim.stage,state:0
@@ -358,7 +364,7 @@ msgstr ""
#. module: crm_claim
#: view:crm.claim:0
msgid "Settle"
-msgstr ""
+msgstr "Решать"
#. module: crm_claim
#: model:ir.ui.menu,name:crm_claim.menu_claim_stage_view
@@ -384,7 +390,7 @@ msgstr "Отчет о претензиях"
#. module: crm_claim
#: view:sale.config.settings:0
msgid "Configure"
-msgstr ""
+msgstr "Настроить"
#. module: crm_claim
#: model:crm.case.resource.type,name:crm_claim.type_claim1
@@ -430,6 +436,8 @@ msgid ""
"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."
msgstr ""
+"Если вы отметите это поле, этот этап будет предложен по умолчанию каждому "
+"отделу продаж. Этот этап не будет назначен существующим отделам."
#. module: crm_claim
#: field:crm.claim,categ_id:0
@@ -485,7 +493,7 @@ msgstr "Закрыто"
#. module: crm_claim
#: view:crm.claim:0
msgid "Reject"
-msgstr ""
+msgstr "Отклонить"
#. module: crm_claim
#: view:res.partner:0
@@ -495,7 +503,7 @@ msgstr "Претензии партнера"
#. module: crm_claim
#: view:crm.claim.stage:0
msgid "Claim Stage"
-msgstr ""
+msgstr "Этап претензии"
#. module: crm_claim
#: view:crm.claim:0
@@ -513,7 +521,7 @@ msgstr "Отложено"
#: field:crm.claim.report,state:0
#: field:crm.claim.stage,state:0
msgid "Status"
-msgstr ""
+msgstr "Статус"
#. module: crm_claim
#: selection:crm.claim.report,month:0
@@ -529,7 +537,7 @@ msgstr "Обычный"
#. module: crm_claim
#: help:crm.claim.stage,sequence:0
msgid "Used to order stages. Lower is better."
-msgstr ""
+msgstr "Используется для упорядочивания этапов. Меньше - лучше."
#. module: crm_claim
#: selection:crm.claim.report,month:0
@@ -549,7 +557,7 @@ msgstr "Телефон"
#. module: crm_claim
#: field:crm.claim,message_is_follower:0
msgid "Is a Follower"
-msgstr ""
+msgstr "Подписан"
#. module: crm_claim
#: field:crm.claim.report,user_id:0
@@ -581,6 +589,10 @@ msgid ""
"the case needs to be reviewed then the status is set "
"to 'Pending'."
msgstr ""
+"Статус устанавливается в \"Черновик\", при создании дела. Если дело в "
+"процессе, то статус - «Открыт». Когда дело закончено, устанавливается статус "
+"\"Готово\". Если дело должно быть пересмотрено то статус установлен в "
+"'Ожидание'."
#. module: crm_claim
#: field:crm.claim,active:0
@@ -628,7 +640,7 @@ msgstr "Дата претензии"
#. module: crm_claim
#: field:crm.claim,message_summary:0
msgid "Summary"
-msgstr ""
+msgstr "Итог"
#. module: crm_claim
#: model:ir.actions.act_window,name:crm_claim.crm_claim_categ_action
@@ -638,7 +650,7 @@ msgstr "Категории претензий"
#. module: crm_claim
#: field:crm.claim.stage,case_default:0
msgid "Common to All Teams"
-msgstr ""
+msgstr "Общее для всех отделов"
#. module: crm_claim
#: view:crm.claim:0
@@ -677,7 +689,7 @@ msgstr "Претензия"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "My Company"
-msgstr ""
+msgstr "Моя компания"
#. module: crm_claim
#: view:crm.claim.report:0
@@ -807,7 +819,7 @@ msgstr "Февраль"
#. module: crm_claim
#: model:ir.model,name:crm_claim.model_sale_config_settings
msgid "sale.config.settings"
-msgstr ""
+msgstr "sale.config.settings"
#. module: crm_claim
#: view:crm.claim.report:0
@@ -833,22 +845,22 @@ msgstr "Мои дела"
#. module: crm_claim
#: model:crm.claim.stage,name:crm_claim.stage_claim2
msgid "Settled"
-msgstr ""
+msgstr "Решено"
#. module: crm_claim
#: help:crm.claim,message_ids:0
msgid "Messages and communication history"
-msgstr ""
+msgstr "Сообщения и история общения"
#. module: crm_claim
#: field:sale.config.settings,fetchmail_claim:0
msgid "Create claims from incoming mails"
-msgstr ""
+msgstr "Создать претензии из входящей почты"
#. module: crm_claim
#: field:crm.claim.stage,sequence:0
msgid "Sequence"
-msgstr ""
+msgstr "Нумерация"
#. module: crm_claim
#: view:crm.claim:0
@@ -883,6 +895,8 @@ msgid ""
"Link between stages and sales teams. When set, this limitate the current "
"stage to the selected sales teams."
msgstr ""
+"Связь между этапами и отделами продаж. При установке, ограничивает этап для "
+"выбранного отдела продаж."
#. module: crm_claim
#: help:crm.claim.stage,case_refused:0
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index 530eb6061a3..bae02ef8c0c 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -55,7 +55,7 @@
-
+
@@ -78,7 +78,7 @@
-
+
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index 6e3521be6f2..f97fe654166 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -151,14 +151,14 @@
+ help="Helpdesk requests that are assigned to me or to one of the sale teams I manage" groups="base.group_multi_salesteams"/>
-
+
diff --git a/addons/crm_helpdesk/i18n/ru.po b/addons/crm_helpdesk/i18n/ru.po
index e8eb90af9d7..bb53c03294f 100644
--- a/addons/crm_helpdesk/i18n/ru.po
+++ b/addons/crm_helpdesk/i18n/ru.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-10-24 05:08+0000\n"
+"PO-Revision-Date: 2013-05-30 14:09+0000\n"
"Last-Translator: Chertykov Denis \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-03-16 05:46+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-31 05:38+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: crm_helpdesk
#: field:crm.helpdesk.report,delay_close:0
@@ -46,7 +46,7 @@ msgstr "Март"
#. module: crm_helpdesk
#: field:crm.helpdesk,message_unread:0
msgid "Unread Messages"
-msgstr ""
+msgstr "Непрочитанные"
#. module: crm_helpdesk
#: field:crm.helpdesk,company_id:0
@@ -63,7 +63,7 @@ msgstr "Адреса наблюдателей"
#. module: crm_helpdesk
#: view:crm.helpdesk.report:0
msgid "Salesperson"
-msgstr ""
+msgstr "Продавец"
#. module: crm_helpdesk
#: selection:crm.helpdesk,priority:0
@@ -106,7 +106,7 @@ msgstr "Отменено"
#. module: crm_helpdesk
#: help:crm.helpdesk,message_unread:0
msgid "If checked new messages require your attention."
-msgstr ""
+msgstr "Если отмечено, новые сообщения требуют вашего внимания."
#. module: crm_helpdesk
#: model:ir.actions.act_window,name:crm_helpdesk.action_report_crm_helpdesk
@@ -136,6 +136,8 @@ msgid ""
"Holds the Chatter summary (number of messages, ...). This summary is "
"directly in html format in order to be inserted in kanban views."
msgstr ""
+"Содержит сводку по Чаттеру (количество сообщений,...). Эта сводка в формате "
+"html для возможности использования в канбан виде"
#. module: crm_helpdesk
#: view:crm.helpdesk:0
@@ -176,7 +178,7 @@ msgstr "Приоритет"
#. module: crm_helpdesk
#: field:crm.helpdesk,message_follower_ids:0
msgid "Followers"
-msgstr ""
+msgstr "Подписчики"
#. module: crm_helpdesk
#: view:crm.helpdesk:0
@@ -400,7 +402,7 @@ msgstr "В ожидании"
#: view:crm.helpdesk.report:0
#: field:crm.helpdesk.report,state:0
msgid "Status"
-msgstr ""
+msgstr "Статус"
#. module: crm_helpdesk
#: selection:crm.helpdesk.report,month:0
@@ -454,7 +456,7 @@ msgstr "Планируемая выручка"
#. module: crm_helpdesk
#: field:crm.helpdesk,message_is_follower:0
msgid "Is a Follower"
-msgstr ""
+msgstr "Подписан"
#. module: crm_helpdesk
#: field:crm.helpdesk.report,user_id:0
@@ -501,7 +503,7 @@ msgstr "Январь"
#. module: crm_helpdesk
#: field:crm.helpdesk,message_summary:0
msgid "Summary"
-msgstr ""
+msgstr "Итог"
#. module: crm_helpdesk
#: view:crm.helpdesk:0
@@ -517,7 +519,7 @@ msgstr "Прочее"
#. module: crm_helpdesk
#: view:crm.helpdesk.report:0
msgid "My Company"
-msgstr ""
+msgstr "Моя компания"
#. module: crm_helpdesk
#: view:crm.helpdesk:0
@@ -666,7 +668,7 @@ msgstr ""
#. module: crm_helpdesk
#: help:crm.helpdesk,message_ids:0
msgid "Messages and communication history"
-msgstr ""
+msgstr "Сообщения и история общения"
#. module: crm_helpdesk
#: model:ir.actions.act_window,help:crm_helpdesk.crm_helpdesk_categ_action
diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
index 6ce2c60093f..c1ffc00303d 100644
--- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
+++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
@@ -56,7 +56,7 @@
-
+
@@ -71,7 +71,7 @@
-
+
diff --git a/addons/crm_helpdesk/test/customer_question.eml b/addons/crm_helpdesk/test/customer_question.eml
index 38a4c95fb0c..9bc7c91cb41 100644
--- a/addons/crm_helpdesk/test/customer_question.eml
+++ b/addons/crm_helpdesk/test/customer_question.eml
@@ -3,7 +3,7 @@ Date: Tue, 25 Oct 2011 13:41:17 +0530
From: Mr. John Right
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8
MIME-Version: 1.0
-To: info@my.com
+To: _helpdesk@my.com
Subject: Where is download link of user manual of your product ?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
diff --git a/addons/crm_partner_assign/i18n/ru.po b/addons/crm_partner_assign/i18n/ru.po
index f0a7ff509c9..53a2929be4e 100644
--- a/addons/crm_partner_assign/i18n/ru.po
+++ b/addons/crm_partner_assign/i18n/ru.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: 2011-03-23 13:46+0000\n"
+"PO-Revision-Date: 2013-05-30 14:10+0000\n"
"Last-Translator: Chertykov Denis \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-03-16 05:47+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-31 05:38+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,delay_close:0
@@ -25,7 +25,7 @@ msgstr "Задержка закрытия"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,author_id:0
msgid "Author"
-msgstr ""
+msgstr "Автор"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,planned_revenue:0
@@ -38,6 +38,9 @@ msgid ""
"Message type: email for email message, notification for system message, "
"comment for other messages such as user replies"
msgstr ""
+"Тип сообщения: эл. почта - для эл. почты, уведомление - для системных "
+"сообщений, комментарий - для остальных сообщений таких как сообщения "
+"пользователя"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,nbr:0
@@ -53,7 +56,7 @@ msgstr "Группировать по ..."
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,body:0
msgid "Automatically sanitized HTML contents"
-msgstr ""
+msgstr "Автоматически обработанное HTML содержимое"
#. module: crm_partner_assign
#: view:crm.lead:0
@@ -68,7 +71,7 @@ msgstr "Геолоцировать"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,starred:0
msgid "Starred"
-msgstr ""
+msgstr "Отмеченные"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
@@ -81,6 +84,8 @@ msgid ""
"Email address of the sender. This field is set when no matching partner is "
"found for incoming emails."
msgstr ""
+"Адрес эл. почты отправителя. Это поле устанавливается когда партнер не "
+"определен для входящих писем."
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
@@ -111,7 +116,7 @@ msgstr "Компания"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,notification_ids:0
msgid "Notifications"
-msgstr ""
+msgstr "Уведомления"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,date_assign:0
@@ -123,7 +128,7 @@ msgstr "Дата партнера"
#: view:crm.partner.report.assign:0
#: view:res.partner:0
msgid "Salesperson"
-msgstr ""
+msgstr "Продавец"
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,priority:0
@@ -170,12 +175,12 @@ msgstr "Географическое назначение"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_crm_lead_forward_to_partner
msgid "Email composition wizard"
-msgstr ""
+msgstr "Мастер составления эл. почты"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,turnover:0
msgid "Turnover"
-msgstr ""
+msgstr "Оборот"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,date_closed:0
@@ -199,7 +204,7 @@ msgstr ""
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,type:0
msgid "System notification"
-msgstr ""
+msgstr "Системное уведомление"
#. module: crm_partner_assign
#: code:addons/crm_partner_assign/wizard/crm_forward_to_partner.py:74
@@ -271,7 +276,7 @@ msgstr "Тип"
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,type:0
msgid "Email"
-msgstr ""
+msgstr "Эл. почта"
#. module: crm_partner_assign
#: help:crm.lead,partner_assigned_id:0
@@ -286,7 +291,7 @@ msgstr "Низший"
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
msgid "Date Invoice"
-msgstr ""
+msgstr "Дата счета"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,template_id:0
@@ -311,12 +316,12 @@ msgstr "Дата создания"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_res_partner_activation
msgid "res.partner.activation"
-msgstr ""
+msgstr "res.partner.activation"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,parent_id:0
msgid "Parent Message"
-msgstr ""
+msgstr "Родительское сообщение"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,res_id:0
@@ -358,12 +363,12 @@ msgstr "Этап"
#: view:crm.lead.report.assign:0
#: field:crm.lead.report.assign,state:0
msgid "Status"
-msgstr ""
+msgstr "Статус"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,to_read:0
msgid "To read"
-msgstr ""
+msgstr "Прочитать"
#. module: crm_partner_assign
#: code:addons/crm_partner_assign/wizard/crm_forward_to_partner.py:74
@@ -418,12 +423,12 @@ msgstr "Количество дней, для закрытия вопроса"
#: help:crm.lead.forward.to.partner,notified_partner_ids:0
msgid ""
"Partners that have a notification pushing this message in their mailboxes"
-msgstr ""
+msgstr "Партнеры которые имеют уведомление доставляемое в их почтовые ящики"
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,type:0
msgid "Comment"
-msgstr ""
+msgstr "Комментарий"
#. module: crm_partner_assign
#: field:res.partner,partner_weight:0
@@ -451,7 +456,7 @@ msgstr "Декабрь"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,vote_user_ids:0
msgid "Users that voted for this message"
-msgstr ""
+msgstr "Пользователи, которые проголосовали за это сообщение"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@@ -467,7 +472,7 @@ msgstr "Дата открытия"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,child_ids:0
msgid "Child Messages"
-msgstr ""
+msgstr "Связанные сообщения"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,date_review:0
@@ -483,17 +488,17 @@ msgstr "Тема"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
msgid "or"
-msgstr ""
+msgstr "или"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,body:0
msgid "Contents"
-msgstr ""
+msgstr "Содержимое"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,vote_user_ids:0
msgid "Votes"
-msgstr ""
+msgstr "Голоса"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@@ -504,6 +509,8 @@ msgstr "# Предложений"
#: help:crm.lead.forward.to.partner,starred:0
msgid "Current user has a starred notification linked to this message"
msgstr ""
+"Текущий пользователь имеет отмеченное уведомление, связанное с этим "
+"сообщением"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,date_partnership:0
@@ -561,7 +568,7 @@ msgstr "Август"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,record_name:0
msgid "Name get of the related document."
-msgstr ""
+msgstr "Название связанного документа."
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,priority:0
@@ -684,7 +691,7 @@ msgstr "Вложения"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,record_name:0
msgid "Message Record Name"
-msgstr ""
+msgstr "Название записи сообщения"
#. module: crm_partner_assign
#: field:res.partner.activation,sequence:0
@@ -724,7 +731,7 @@ msgstr "Открыто"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,subtype_id:0
msgid "Subtype"
-msgstr ""
+msgstr "Подтип"
#. module: crm_partner_assign
#: field:res.partner,date_localization:0
@@ -739,12 +746,12 @@ msgstr "Текущий"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_crm_lead
msgid "Lead/Opportunity"
-msgstr ""
+msgstr "Кандидат/Предложение"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,notified_partner_ids:0
msgid "Notified partners"
-msgstr ""
+msgstr "Уведомленные партнеры"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
@@ -775,7 +782,7 @@ msgstr "Вероятная выручка"
#: field:res.partner,activation:0
#: view:res.partner.activation:0
msgid "Activation"
-msgstr ""
+msgstr "Активация"
#. module: crm_partner_assign
#: view:crm.lead:0
@@ -792,6 +799,8 @@ msgstr ""
#: help:crm.lead.forward.to.partner,to_read:0
msgid "Current user has an unread notification linked to this message"
msgstr ""
+"Текущий пользователь имеет непрочитанные уведомления, связанные с этим "
+"сообщением"
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,type:0
@@ -860,6 +869,8 @@ msgid ""
"Technical field holding the message notifications. Use notified_partner_ids "
"to access notified partners."
msgstr ""
+"Техническое поле, содержащее уведомления. Используйте notified_partner_ids "
+"для доступа к оповещаемым партнерам."
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
@@ -874,12 +885,12 @@ msgstr "CRM - отчет по кандидатам"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,composition_mode:0
msgid "Composition mode"
-msgstr ""
+msgstr "Режим составления"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,model:0
msgid "Related Document Model"
-msgstr ""
+msgstr "Модель связанного документа"
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,history_mode:0
@@ -892,6 +903,8 @@ msgid ""
"Author of the message. If not set, email_from may hold an email address that "
"did not match any partner."
msgstr ""
+"Автор сообщения. Если не установлен, email_from может содержать адрес почты, "
+"который не соответствует ни одному партнеру."
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_crm_partner_report_assign
@@ -906,12 +919,12 @@ msgstr "Высокий"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,partner_ids:0
msgid "Additional contacts"
-msgstr ""
+msgstr "Дополнительные контакты"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,parent_id:0
msgid "Initial thread message."
-msgstr ""
+msgstr "Первое сообщение цепочки."
#. module: crm_partner_assign
#: field:crm.lead.report.assign,create_date:0
diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
index 91d462de015..924f96180cc 100644
--- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
+++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
@@ -105,10 +105,17 @@ class crm_lead_forward_to_partner(osv.TransientModel):
""" Forward the lead to a partner """
if context is None:
context = {}
+ # TDE FIX in 7.0: force mass_mailing mode; this way, the message will be
+ # send only to partners; default subtype of mass_mailing is indeed False
+ # Chatter will show 'logged a note', but partner_ids (aka, the assigned partner)
+ # will effectively receive the message if present in the composition window
+ self.write(cr, uid, ids, {'composition_mode': 'mass_mail'}, context=context)
res = {'type': 'ir.actions.act_window_close'}
wizard = self.browse(cr, uid, ids[0], context=context)
if wizard.model not in ('crm.lead'):
return res
+ if context.get('active_ids') is None:
+ context['active_ids'] = [wizard.res_id]
lead = self.pool[wizard.model]
lead_ids = wizard.res_id and [wizard.res_id] or []
@@ -116,6 +123,7 @@ class crm_lead_forward_to_partner(osv.TransientModel):
if wizard.composition_mode == 'mass_mail':
lead_ids = context and context.get('active_ids', []) or []
value = self.default_get(cr, uid, ['body', 'email_to', 'email_cc', 'subject', 'history_mode'], context=context)
+ value.pop('composition_mode')
self.write(cr, uid, ids, value, context=context)
return self.send_mail(cr, uid, ids, context=context)
diff --git a/addons/crm_profiling/i18n/ru.po b/addons/crm_profiling/i18n/ru.po
index 8cbe1695e82..a7325d894c5 100644
--- a/addons/crm_profiling/i18n/ru.po
+++ b/addons/crm_profiling/i18n/ru.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-12-21 17:05+0000\n"
-"PO-Revision-Date: 2012-05-10 17:51+0000\n"
+"PO-Revision-Date: 2013-05-30 14:05+0000\n"
"Last-Translator: Chertykov Denis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-16 05:32+0000\n"
-"X-Generator: Launchpad (build 16532)\n"
+"X-Launchpad-Export-Date: 2013-05-31 05:38+0000\n"
+"X-Generator: Launchpad (build 16660)\n"
#. module: crm_profiling
#: view:crm_profiling.questionnaire:0
@@ -151,7 +151,7 @@ msgstr "Используйте правила профилирования"
#. module: crm_profiling
#: constraint:crm.segmentation:0
msgid "Error ! You cannot create recursive profiles."
-msgstr ""
+msgstr "Ошибка ! Нельзя создать рекурсивный профиль."
#. module: crm_profiling
#: field:crm.segmentation,answer_yes:0
@@ -200,7 +200,7 @@ msgstr "Сохранить данные"
#. module: crm_profiling
#: view:open.questionnaire:0
msgid "or"
-msgstr ""
+msgstr "или"
#~ msgid ""
#~ "The Object name must start with x_ and not contain any special character !"
diff --git a/addons/document/odt2txt.py b/addons/document/odt2txt.py
old mode 100644
new mode 100755
diff --git a/addons/document_webdav/__openerp__.py b/addons/document_webdav/__openerp__.py
index ec112ec7c38..befb87829ed 100644
--- a/addons/document_webdav/__openerp__.py
+++ b/addons/document_webdav/__openerp__.py
@@ -24,7 +24,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
##############################################################################
diff --git a/addons/document_webdav/test_davclient.py b/addons/document_webdav/test_davclient.py
index 058dc1c748d..f3a8b35b582 100644
--- a/addons/document_webdav/test_davclient.py
+++ b/addons/document_webdav/test_davclient.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright P. Christeas 2008,2009
@@ -24,7 +23,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
###############################################################################
""" A trivial HTTP/WebDAV client, used for testing the server
diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py
index f67de272e29..e495f5c9f2f 100644
--- a/addons/document_webdav/webdav_server.py
+++ b/addons/document_webdav/webdav_server.py
@@ -30,7 +30,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
###############################################################################
diff --git a/addons/document_webdav/webdav_setup.xml b/addons/document_webdav/webdav_setup.xml
index d75c416a93e..dbf6bc8fbcc 100644
--- a/addons/document_webdav/webdav_setup.xml
+++ b/addons/document_webdav/webdav_setup.xml
@@ -1,4 +1,3 @@
-
+ on_change="onchange_template_id(template_id, composition_mode, model, res_id, context)" domain="[('model_id.model','=',model)]"/>
+
@@ -100,19 +101,13 @@
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
+
diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py
index ec583a58cbf..8bacd37fc15 100644
--- a/addons/event_sale/event_sale.py
+++ b/addons/event_sale/event_sale.py
@@ -70,6 +70,8 @@ class sale_order_line(osv.osv):
'''
create registration with sales order
'''
+ if context is None:
+ context = {}
registration_obj = self.pool.get('event.registration')
sale_obj = self.pool.get('sale.order')
for order_line in self.browse(cr, uid, ids, context=context):
@@ -83,7 +85,8 @@ class sale_order_line(osv.osv):
'origin': order_line.order_id.name,
'event_id': order_line.event_id.id,
}
+ message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name)
+ context.update({'mail_create_nolog': True})
registration_id = registration_obj.create(cr, uid, dic, context=context)
- message = _("The registration %s has been created from the Sales Order %s.") % (registration_id, order_line.order_id.name)
registration_obj.message_post(cr, uid, [registration_id], body=message, context=context)
return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context)
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index 4e653adce28..5ee17c61b6f 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -97,15 +97,17 @@
General Settingsbase.config.settings
-
-
-
+Connect with experts, follow what interests you, share documents and promote
+best practices. Get work done with effective collaboration across departments,
+geographies, documents and business applications. All of this while decreasing
+email overload.
+
+
+Next time you have a question for the marketing, sales, R&D or any other
+department, don't send an email blast-post the question to OpenERP and get
+answers from the right persons.
+
+
+
+
+
+
+
+
+
+
+
+
+
Follow what interests you
+
Make the information flow across your company
+
+
+
+
+
+
+
+Want to get informed about new product features, hot deals, bottlenecks in projects or any other event? Just follow what interests you to get the information you need what you need; no more, no less.
+
+
+
+
+
+
+
+
+
Get Things Done
+
Your inbox is a todo list
+
+
+You can process (not only read) the inbox and easily mark messages for future actions. Start feeling the pleasure of having an empty inbox every day; no more overload of information.
+
+
+
+
+
+
+
+
+
+
+
+
+
Promote best practices
+
Discussion groups at your fingertips
+
+
+
+
+
+
+
+Cut back on meetings and email chains by working together in groups of interests. Create a group to let people share files, discuss ideas, and vote to promote best practices.
+
+
+
+
+
+
+
+
Improve Access to Information and Expertise
+
Easily find the information you need
+
+
+Break down information silos. Search across your existing systems to find the answers and expertise you need to complete projects quickly.
+
+
+
+
+
+
+
+
+
+
+
+
+
Collaborate securely
+
+
+
+
+
+
+
+Set the right security policy; public, private or on invitation only -- according to the information sensitivity.
+
+
+
+
+
+
+
+
+
A Twitter-like Network For Your Company
+
+
+Make every employee feel more connected and engaged with twitter-like features
+for your own company. Follow people, share best practices, 'like' top ideas, etc.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Trusted by millions worldwide
+
+
+
+
+ Emails make me waste my time. But I need them. Reading my inbox
+ is the most unproductive task I do on a daily basis. I have to
+ spend one or two full hours a day to process my emails. All the
+ junk flows in the same inbox; spams, information that doesn't
+ matter, quoted answers of quoted answers, etc. At the end of
+ the hour, only 10 emails actually requested an answer from me.
+ Since I use OpenERP, I can do the same job in only 10 minutes!
+
+
+
+
Luc de Keyser
+
+
+
+
+
+
+
diff --git a/addons/mail/html/mail_illustration.png b/addons/mail/html/mail_illustration.png
new file mode 100644
index 00000000000..4fff4837faa
Binary files /dev/null and b/addons/mail/html/mail_illustration.png differ
diff --git a/addons/mail/html/mail_sc_00.png b/addons/mail/html/mail_sc_00.png
new file mode 100644
index 00000000000..3011ef129b5
Binary files /dev/null and b/addons/mail/html/mail_sc_00.png differ
diff --git a/addons/mail/html/mail_sc_01.png b/addons/mail/html/mail_sc_01.png
new file mode 100644
index 00000000000..1b1099f6536
Binary files /dev/null and b/addons/mail/html/mail_sc_01.png differ
diff --git a/addons/mail/html/mail_sc_02.png b/addons/mail/html/mail_sc_02.png
new file mode 100644
index 00000000000..4e59c9d1e0f
Binary files /dev/null and b/addons/mail/html/mail_sc_02.png differ
diff --git a/addons/mail/html/mail_sc_03.png b/addons/mail/html/mail_sc_03.png
new file mode 100644
index 00000000000..dbb14b4da36
Binary files /dev/null and b/addons/mail/html/mail_sc_03.png differ
diff --git a/addons/mail/html/mail_sc_04.png b/addons/mail/html/mail_sc_04.png
new file mode 100644
index 00000000000..b8f47ba2935
Binary files /dev/null and b/addons/mail/html/mail_sc_04.png differ
diff --git a/addons/mail/html/mail_sc_05.png b/addons/mail/html/mail_sc_05.png
new file mode 100644
index 00000000000..251b4ebc676
Binary files /dev/null and b/addons/mail/html/mail_sc_05.png differ
diff --git a/addons/mail/html/mail_sc_06.png b/addons/mail/html/mail_sc_06.png
new file mode 100644
index 00000000000..251b4ebc676
Binary files /dev/null and b/addons/mail/html/mail_sc_06.png differ
diff --git a/addons/mail/html/mail_sc_07.png b/addons/mail/html/mail_sc_07.png
new file mode 100644
index 00000000000..9a33332817e
Binary files /dev/null and b/addons/mail/html/mail_sc_07.png differ
diff --git a/addons/mail/html/photo.png b/addons/mail/html/photo.png
new file mode 100644
index 00000000000..e605e5c6f8e
Binary files /dev/null and b/addons/mail/html/photo.png differ
diff --git a/addons/mail/mail_alias.py b/addons/mail/mail_alias.py
index 8730599ad72..870695e074e 100644
--- a/addons/mail/mail_alias.py
+++ b/addons/mail/mail_alias.py
@@ -139,7 +139,7 @@ class mail_alias(osv.Model):
return new_name
def migrate_to_alias(self, cr, child_model_name, child_table_name, child_model_auto_init_fct,
- alias_id_column, alias_key, alias_prefix = '', alias_force_key = '', alias_defaults = {}, context=None):
+ alias_id_column, alias_key, alias_prefix='', alias_force_key='', alias_defaults={}, context=None):
""" Installation hook to create aliases for all users and avoid constraint errors.
:param child_model_name: model name of the child class (i.e. res.users)
@@ -154,8 +154,10 @@ class mail_alias(osv.Model):
:param alias_defaults: dict, keys = mail.alias columns, values = child
model column name used for default values (i.e. {'job_id': 'id'})
"""
+ if context is None:
+ context = {}
- # disable the unique alias_id not null constraint, to avoid spurious warning during
+ # disable the unique alias_id not null constraint, to avoid spurious warning during
# super.auto_init. We'll reinstall it afterwards.
alias_id_column.required = False
@@ -165,14 +167,14 @@ class mail_alias(osv.Model):
registry = RegistryManager.get(cr.dbname)
mail_alias = registry.get('mail.alias')
child_class_model = registry[child_model_name]
- no_alias_ids = child_class_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)], context={'active_test':False})
+ no_alias_ids = child_class_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)], context={'active_test': False})
# Use read() not browse(), to avoid prefetching uninitialized inherited fields
for obj_data in child_class_model.read(cr, SUPERUSER_ID, no_alias_ids, [alias_key]):
- alias_vals = {'alias_name': '%s%s' % (alias_prefix, obj_data[alias_key]) }
+ alias_vals = {'alias_name': '%s%s' % (alias_prefix, obj_data[alias_key])}
if alias_force_key:
alias_vals['alias_force_thread_id'] = obj_data[alias_force_key]
- alias_vals['alias_defaults'] = dict( (k, obj_data[v]) for k, v in alias_defaults.iteritems())
- alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID, alias_vals, model_name=child_model_name)
+ alias_vals['alias_defaults'] = dict((k, obj_data[v]) for k, v in alias_defaults.iteritems())
+ alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID, alias_vals, model_name=context.get('alias_model_name', child_model_name))
child_class_model.write(cr, SUPERUSER_ID, obj_data['id'], {'alias_id': alias_id})
_logger.info('Mail alias created for %s %s (uid %s)', child_model_name, obj_data[alias_key], obj_data['id'])
diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py
index 152b9704fd7..98e88b664e6 100644
--- a/addons/mail/mail_followers.py
+++ b/addons/mail/mail_followers.py
@@ -90,7 +90,7 @@ class mail_notification(osv.Model):
continue
partner = notification.partner_id
# If partners_to_notify specified: restrict to them
- if partners_to_notify and partner.id not in partners_to_notify:
+ if partners_to_notify is not None and partner.id not in partners_to_notify:
continue
# Do not send to partners without email address defined
if not partner.email:
@@ -135,14 +135,17 @@ class mail_notification(osv.Model):
footer = tools.append_content_to_html(footer, signature, plaintext=False, container_tag='p')
# add company signature
- if user.company_id:
- company = user.company_id.website and "%s" % (user.company_id.website, user.company_id.name) or user.company_id.name
+ if user.company_id.website:
+ website_url = ('http://%s' % user.company_id.website) if not user.company_id.website.lower().startswith(('http:', 'https:')) \
+ else user.company_id.website
+ company = "%s" % (website_url, user.company_id.name)
else:
- company = user.name
- signature_company = _('Sent by %(company)s using %(openerp)s.') % {
+ company = user.company_id.name
+ sent_by = _('Sent by %(company)s using %(openerp)s.')
+ signature_company = '%s' % (sent_by % {
'company': company,
'openerp': "OpenERP"
- }
+ })
footer = tools.append_content_to_html(footer, signature_company, plaintext=False, container_tag='div')
return footer
diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py
index 3c30a950230..8fab4347d0d 100644
--- a/addons/mail/mail_mail.py
+++ b/addons/mail/mail_mail.py
@@ -27,8 +27,8 @@ from urlparse import urljoin
from openerp import tools
from openerp import SUPERUSER_ID
+from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
from openerp.osv import fields, osv
-from openerp.osv.orm import except_orm
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
@@ -93,31 +93,41 @@ class mail_mail(osv.Model):
""" Return a specific reply_to: alias of the document through message_get_reply_to
or take the email_from
"""
+ # if value specified: directly return it
if values.get('reply_to'):
return values.get('reply_to')
- email_reply_to = False
- # model, res_id: comes from values OR related message
- model = values.get('model')
- res_id = values.get('res_id')
- if values.get('mail_message_id') and (not model or not res_id):
+ mailgateway = True # tells whether the answer will go through the mailgateway, leading to the formatting of reply_to
+ ir_config_parameter = self.pool.get("ir.config_parameter")
+ catchall_domain = ir_config_parameter.get_param(cr, uid, "mail.catchall.domain", context=context)
+
+ # model, res_id, email_from, reply_to: comes from values OR related message
+ message = None
+ if values.get('mail_message_id'):
message = self.pool.get('mail.message').browse(cr, uid, values.get('mail_message_id'), context=context)
- if not model:
- model = message.model
- if not res_id:
- res_id = message.res_id
+ model = values.get('model', message and message.model or False)
+ res_id = values.get('res_id', message and message.res_id or False)
+ email_from = values.get('email_from', message and message.email_from or False)
+ email_reply_to = message and message.reply_to or False
# if model and res_id: try to use ``message_get_reply_to`` that returns the document alias
- if model and res_id and hasattr(self.pool[model], 'message_get_reply_to'):
+ if not email_reply_to and model and res_id and hasattr(self.pool[model], 'message_get_reply_to'):
email_reply_to = self.pool[model].message_get_reply_to(cr, uid, [res_id], context=context)[0]
+ # no alias reply_to -> catchall alias
+ if not email_reply_to:
+ catchall_alias = ir_config_parameter.get_param(cr, uid, "mail.catchall.alias", context=context)
+ if catchall_domain and catchall_alias:
+ email_reply_to = '%s@%s' % (catchall_alias, catchall_domain)
# no alias reply_to -> reply_to will be the email_from, only the email part
- if not email_reply_to and values.get('email_from'):
- emails = tools.email_split(values.get('email_from'))
+ if not email_reply_to and email_from:
+ emails = tools.email_split(email_from)
if emails:
email_reply_to = emails[0]
+ if emails[0].split('@')[1] != catchall_domain:
+ mailgateway = False
# format 'Document name '
- if email_reply_to and model and res_id:
+ if email_reply_to and model and res_id and mailgateway:
document_name = self.pool[model].name_get(cr, SUPERUSER_ID, [res_id], context=context)[0]
if document_name:
# sanitize document name
@@ -195,6 +205,36 @@ class mail_mail(osv.Model):
self.unlink(cr, SUPERUSER_ID, [mail.id], context=context)
return True
+ #------------------------------------------------------
+ # mail_mail formatting, tools and send mechanism
+ #------------------------------------------------------
+
+ # TODO in 8.0(+): maybe factorize this to enable in modules link generation
+ # independently of mail_mail model
+ # TODO in 8.0(+): factorize doc name sanitized and 'Followers of ...' formatting
+ # because it begins to appear everywhere
+
+ def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None):
+ """ Generate URLs for links in mails:
+ - partner is an user and has read access to the document: direct link to document with model, res_id
+ """
+ if partner and partner.user_ids:
+ base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
+ # the parameters to encode for the query and fragment part of url
+ query = {'db': cr.dbname}
+ fragment = {
+ 'login': partner.user_ids[0].login,
+ 'action': 'mail.action_mail_redirect',
+ }
+ if mail.notification:
+ fragment.update({
+ 'message_id': mail.mail_message_id.id,
+ })
+ url = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment)))
+ return _("""Access your messages and documents in OpenERP""") % url
+ else:
+ return None
+
def send_get_mail_subject(self, cr, uid, mail, force=False, partner=None, context=None):
""" If subject is void and record_name defined: ' posted on '
@@ -202,36 +242,12 @@ class mail_mail(osv.Model):
:param browse_record mail: mail.mail browse_record
:param browse_record partner: specific recipient partner
"""
- if force or (not mail.subject and mail.model and mail.res_id):
+ if (force or not mail.subject) and mail.record_name:
return 'Re: %s' % (mail.record_name)
+ elif (force or not mail.subject) and mail.parent_id and mail.parent_id.subject:
+ return 'Re: %s' % (mail.parent_id.subject)
return mail.subject
- def send_get_mail_body_footer(self, cr, uid, mail, partner=None, context=None):
- """ Return a specific footer for the ir_email body. The main purpose of this method
- is to be inherited by Portal, to add modify the link for signing in, in
- each notification email a partner receives.
- """
- body_footer = ""
- # partner is a user, link to a related document (incentive to install portal)
- if partner and partner.user_ids and mail.model and mail.res_id \
- and self.check_access_rights(cr, partner.user_ids[0].id, 'read', raise_exception=False):
- related_user = partner.user_ids[0]
- try:
- self.pool[mail.model].check_access_rule(cr, related_user.id, [mail.res_id], 'read', context=context)
- base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
- # the parameters to encode for the query and fragment part of url
- query = {'db': cr.dbname}
- fragment = {
- 'login': related_user.login,
- 'model': mail.model,
- 'id': mail.res_id,
- }
- url = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment)))
- body_footer = _("""Access this document directly in OpenERP""") % url
- except except_orm, e:
- pass
- return body_footer
-
def send_get_mail_body(self, cr, uid, mail, partner=None, context=None):
""" Return a specific ir_email body. The main purpose of this method
is to be inherited to add custom content depending on some module.
@@ -241,9 +257,10 @@ class mail_mail(osv.Model):
"""
body = mail.body_html
- # add footer
- body_footer = self.send_get_mail_body_footer(cr, uid, mail, partner=partner, context=context)
- body = tools.append_content_to_html(body, body_footer, plaintext=False, container_tag='div')
+ # generate footer
+ link = self._get_partner_access_link(cr, uid, mail, partner, context=context)
+ if link:
+ body = tools.append_content_to_html(body, link, plaintext=False, container_tag='div')
return body
def send_get_email_dict(self, cr, uid, mail, partner=None, context=None):
@@ -276,7 +293,7 @@ class mail_mail(osv.Model):
'email_to': email_to,
}
- def send(self, cr, uid, ids, auto_commit=False, context=None):
+ def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None):
""" Sends the selected emails immediately, ignoring their current
state (mails that have already been sent should not be passed
unless they should actually be re-sent).
@@ -287,6 +304,8 @@ class mail_mail(osv.Model):
:param bool auto_commit: whether to force a commit of the mail status
after sending each mail (meant only for scheduler processing);
should never be True during normal transactions (default: False)
+ :param bool raise_exception: whether to raise an exception if the
+ email sending process has failed
:return: True
"""
ir_mail_server = self.pool.get('ir.mail_server')
@@ -332,9 +351,16 @@ class mail_mail(osv.Model):
# see revid:odo@openerp.com-20120622152536-42b2s28lvdv3odyr in 6.1
if mail_sent:
self._postprocess_sent_message(cr, uid, mail, context=context)
- except Exception:
+ except Exception as e:
_logger.exception('failed sending mail.mail %s', mail.id)
mail.write({'state': 'exception'})
+ if raise_exception:
+ if isinstance(e, AssertionError):
+ # get the args of the original error, wrap into a value and throw a MailDeliveryException
+ # that is an except_orm, with name and value as arguments
+ value = '. '.join(e.args)
+ raise MailDeliveryException(_("Mail Delivery Failed"), value)
+ raise
if auto_commit == True:
cr.commit()
diff --git a/addons/mail/mail_mail_view.xml b/addons/mail/mail_mail_view.xml
index 1ff9a2a292e..7384cc24a75 100644
--- a/addons/mail/mail_mail_view.xml
+++ b/addons/mail/mail_mail_view.xml
@@ -6,6 +6,11 @@
mail.mail
+
diff --git a/addons/mail/res_config.py b/addons/mail/res_config.py
index 91606e1c720..c19eb4a38ee 100644
--- a/addons/mail/res_config.py
+++ b/addons/mail/res_config.py
@@ -23,11 +23,12 @@ import urlparse
from openerp.osv import osv, fields
+
class project_configuration(osv.TransientModel):
_inherit = 'base.config.settings'
_columns = {
- 'alias_domain' : fields.char('Alias Domain',
+ 'alias_domain': fields.char('Alias Domain',
help="If you have setup a catch-all email domain redirected to "
"the OpenERP server, enter the domain name here."),
}
diff --git a/addons/mail/res_users_view.xml b/addons/mail/res_users_view.xml
index f49ff72194a..1cacadfc898 100644
--- a/addons/mail/res_users_view.xml
+++ b/addons/mail/res_users_view.xml
@@ -26,7 +26,7 @@
-
+
diff --git a/addons/mail/static/scripts/openerp_mailgate.py b/addons/mail/static/scripts/openerp_mailgate.py
old mode 100644
new mode 100755
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 6bc086a5b58..958c2bccd5f 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -564,13 +564,6 @@
text-align: center;
width:100%;
}
-.openerp .oe_followers button.oe_invite{
- margin: 5px 0;
- padding: 2px 8px;
- font-size: 12px;
- text-shadow: none;
- width: 100%;
-}
.openerp .oe_followers button.oe_follower.oe_following{
color: white;
background-color: #3465A4;
@@ -624,8 +617,12 @@
margin-top: 12px;
margin-bottom: 4px;
}
+.openerp .oe_followers .oe_invite{
+ float: right;
+}
.openerp .oe_followers .oe_partner {
height: 32px;
+ margin-right: 8px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
diff --git a/addons/mail/static/src/img/email_icon.png b/addons/mail/static/src/img/email_icon.png
old mode 100755
new mode 100644
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index b1a579ba057..8631bc70baa 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -1056,9 +1056,7 @@ openerp.mail = function (session) {
msg.renderElement();
msg.start();
}
- if( self.options.root_thread.__parentedParent.__parentedParent.do_reload_menu_emails ) {
- self.options.root_thread.__parentedParent.__parentedParent.do_reload_menu_emails();
- }
+ self.options.root_thread.MailWidget.do_reload_menu_emails();
});
});
@@ -1198,6 +1196,7 @@ openerp.mail = function (session) {
init: function (parent, datasets, options) {
var self = this;
this._super(parent, options);
+ this.MailWidget = parent.__proto__ == mail.Widget.prototype ? parent : false;
this.domain = options.domain || [];
this.context = _.extend(options.context || {});
@@ -1431,11 +1430,16 @@ openerp.mail = function (session) {
message_fetch_set_read: function (message_list) {
if (! this.context.mail_read_set_read) return;
- this.render_mutex.exec(_.bind(function() {
+ var self = this;
+ this.render_mutex.exec(function() {
msg_ids = _.pluck(message_list, 'id');
- return this.ds_message.call('set_message_read', [
- msg_ids, true, false, this.context]);
- }, this));
+ return self.ds_message.call('set_message_read', [msg_ids, true, false, self.context])
+ .then(function (nb_read) {
+ if (nb_read) {
+ self.options.root_thread.MailWidget.do_reload_menu_emails();
+ }
+ });
+ });
},
/**
@@ -1700,6 +1704,22 @@ openerp.mail = function (session) {
this.bind_events();
},
+ /**
+ * create an object "related_menu"
+ * contains the menu widget and the sub menu related of this wall
+ */
+ do_reload_menu_emails: function () {
+ var menu = session.webclient.menu;
+ if (!menu || !menu.current_menu) {
+ return $.when();
+ }
+ return menu.rpc("/web/menu/load_needaction", {'menu_ids': [menu.current_menu]}).done(function(r) {
+ menu.on_needaction_loaded(r);
+ }).then(function () {
+ menu.trigger("need_action_reloaded");
+ });
+ },
+
/**
*Create the root thread and display this object in the DOM.
* Call the no_message method then c all the message_fetch method
@@ -1749,6 +1769,7 @@ openerp.mail = function (session) {
init: function (parent, node) {
this._super.apply(this, arguments);
+ this.ParentViewManager = parent;
this.node = _.clone(node);
this.node.params = _.extend({
'display_indented_thread': -1,
@@ -1768,7 +1789,7 @@ openerp.mail = function (session) {
this.domain = this.node.params && this.node.params.domain || [];
- if (!this.__parentedParent.is_action_enabled('edit')) {
+ if (!this.ParentViewManager.is_action_enabled('edit')) {
this.node.params.show_link = false;
}
},
@@ -1839,12 +1860,20 @@ openerp.mail = function (session) {
*/
init: function (parent, action) {
this._super(parent, action);
+ this.ActionManager = parent;
this.action = _.clone(action);
this.domain = this.action.params.domain || this.action.domain || [];
this.context = _.extend(this.action.params.context || {}, this.action.context || {});
+ // filter some parameters that we will propagate as search_default
this.defaults = {};
+ for (var key in this.action.context.params) {
+ if (_.indexOf(['model', 'res_id'], key) == -1) {
+ continue;
+ }
+ this.context['search_default_' + key] = this.action.context.params[key];
+ }
for (var key in this.context) {
if (key.match(/^search_default_/)) {
this.defaults[key.replace(/^search_default_/, '')] = this.context[key];
@@ -1871,23 +1900,6 @@ openerp.mail = function (session) {
}
},
- /**
- * crete an object "related_menu"
- * contain the menu widget and the the sub menu related of this wall
- */
- do_reload_menu_emails: function () {
- var menu = this.__parentedParent.__parentedParent.menu;
- // return this.rpc("/web/menu/load", {'menu_id': 100}).done(function(r) {
- // _.each(menu.data.data.children, function (val) {
- // if (val.id == 100) {
- // val.children = _.find(r.data.children, function (r_val) {return r_val.id == 100;}).children;
- // }
- // });
- // var r = menu.data;
- // window.setTimeout(function(){menu.do_reload();}, 0);
- // });
- },
-
/**
* Load the mail.message search view
* @param {Object} defaults ??
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 7e7d772397a..ab82d650f30 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -144,7 +144,9 @@
diff --git a/addons/mail/tests/test_mail_features.py b/addons/mail/tests/test_mail_features.py
index 7eea66b3b90..46f4555349d 100644
--- a/addons/mail/tests/test_mail_features.py
+++ b/addons/mail/tests/test_mail_features.py
@@ -19,12 +19,15 @@
#
##############################################################################
+from openerp.addons.mail.mail_mail import mail_mail
+from openerp.addons.mail.mail_thread import mail_thread
from openerp.addons.mail.tests.test_mail_base import TestMailBase
+from openerp.tools import mute_logger
from openerp.tools.mail import html_sanitize
class test_mail(TestMailBase):
-
+
def test_000_alias_setup(self):
""" Test basic mail.alias setup works, before trying to use them for routing """
cr, uid = self.cr, self.uid
@@ -43,7 +46,6 @@ class test_mail(TestMailBase):
self.user_barty = self.res_users.browse(cr, uid, self.user_barty_id)
self.assertEquals(self.user_barty.alias_name, 'b4r+_-_r3wl-', 'Disallowed chars should be replaced by hyphens')
-
def test_00_followers_function_field(self):
""" Tests designed for the many2many function field 'follower_ids'.
We will test to perform writes using the many2many commands 0, 3, 4,
@@ -116,18 +118,66 @@ class test_mail(TestMailBase):
# CASE1: test subscriptions with subtypes
# ----------------------------------------
- # Do: Subscribe Raoul three times (niak niak) through message_subscribe_users
+ # Do: subscribe Raoul, should have default subtypes
+ group_pigs.message_subscribe_users([user_raoul.id])
+ group_pigs.refresh()
+ # Test: 2 followers (Admin and Raoul)
+ follower_ids = [follower.id for follower in group_pigs.message_follower_ids]
+ self.assertEqual(set(follower_ids), set([user_raoul.partner_id.id, user_admin.partner_id.id]),
+ 'message_subscribe: Admin and Raoul should be the only 2 Pigs fans')
+ # Raoul follows default subtypes
+ fol_ids = self.mail_followers.search(cr, uid, [
+ ('res_model', '=', 'mail.group'),
+ ('res_id', '=', self.group_pigs_id),
+ ('partner_id', '=', user_raoul.partner_id.id)
+ ])
+ fol_obj = self.mail_followers.browse(cr, uid, fol_ids)[0]
+ fol_subtype_ids = set([subtype.id for subtype in fol_obj.subtype_ids])
+ self.assertEqual(set(fol_subtype_ids), set(default_group_subtypes),
+ 'message_subscribe: Raoul subscription subtypes are incorrect, should be all default ones')
+
+ # Do: subscribe Raoul with specified new subtypes
+ group_pigs.message_subscribe_users([user_raoul.id], subtype_ids=[mt_mg_nodef])
+ # Test: 2 followers (Admin and Raoul)
+ follower_ids = [follower.id for follower in group_pigs.message_follower_ids]
+ self.assertEqual(set(follower_ids), set([user_raoul.partner_id.id, user_admin.partner_id.id]),
+ 'message_subscribe: Admin and Raoul should be the only 2 Pigs fans')
+ # Test: 2 lines in mail.followers (no duplicate for Raoul)
+ fol_ids = self.mail_followers.search(cr, uid, [
+ ('res_model', '=', 'mail.group'),
+ ('res_id', '=', self.group_pigs_id),
+ ])
+ self.assertEqual(len(fol_ids), 2,
+ 'message_subscribe: subscribing an already-existing follower should not create new entries in mail.followers')
+ # Test: Raoul follows only specified subtypes
+ fol_ids = self.mail_followers.search(cr, uid, [
+ ('res_model', '=', 'mail.group'),
+ ('res_id', '=', self.group_pigs_id),
+ ('partner_id', '=', user_raoul.partner_id.id)
+ ])
+ fol_obj = self.mail_followers.browse(cr, uid, fol_ids)[0]
+ fol_subtype_ids = set([subtype.id for subtype in fol_obj.subtype_ids])
+ self.assertEqual(set(fol_subtype_ids), set([mt_mg_nodef]),
+ 'message_subscribe: Raoul subscription subtypes are incorrect, should be only specified')
+
+ # Do: Subscribe Raoul without specified subtypes: should not erase existing subscription subtypes
group_pigs.message_subscribe_users([user_raoul.id, user_raoul.id])
group_pigs.message_subscribe_users([user_raoul.id])
group_pigs.refresh()
# Test: 2 followers (Admin and Raoul)
follower_ids = [follower.id for follower in group_pigs.message_follower_ids]
- self.assertEqual(set(follower_ids), set([user_raoul.partner_id.id, user_admin.partner_id.id]), 'Admin and Raoul should be the only 2 Pigs fans')
+ self.assertEqual(set(follower_ids), set([user_raoul.partner_id.id, user_admin.partner_id.id]),
+ 'message_subscribe: Admin and Raoul should be the only 2 Pigs fans')
# Test: Raoul follows default subtypes
- fol_ids = self.mail_followers.search(cr, uid, [('res_model', '=', 'mail.group'), ('res_id', '=', self.group_pigs_id), ('partner_id', '=', user_raoul.partner_id.id)])
+ fol_ids = self.mail_followers.search(cr, uid, [
+ ('res_model', '=', 'mail.group'),
+ ('res_id', '=', self.group_pigs_id),
+ ('partner_id', '=', user_raoul.partner_id.id)
+ ])
fol_obj = self.mail_followers.browse(cr, uid, fol_ids)[0]
fol_subtype_ids = set([subtype.id for subtype in fol_obj.subtype_ids])
- self.assertEqual(set(fol_subtype_ids), set(default_group_subtypes), 'subscription subtypes are incorrect')
+ self.assertEqual(set(fol_subtype_ids), set([mt_mg_nodef]),
+ 'message_subscribe: Raoul subscription subtypes are incorrect, should be only specified')
# Do: Unsubscribe Raoul twice through message_unsubscribe_users
group_pigs.message_unsubscribe_users([user_raoul.id, user_raoul.id])
@@ -135,6 +185,13 @@ class test_mail(TestMailBase):
# Test: 1 follower (Admin)
follower_ids = [follower.id for follower in group_pigs.message_follower_ids]
self.assertEqual(follower_ids, [user_admin.partner_id.id], 'Admin must be the only Pigs fan')
+ # Test: 1 lines in mail.followers (no duplicate for Raoul)
+ fol_ids = self.mail_followers.search(cr, uid, [
+ ('res_model', '=', 'mail.group'),
+ ('res_id', '=', self.group_pigs_id)
+ ])
+ self.assertEqual(len(fol_ids), 1,
+ 'message_subscribe: group should have only 1 entry in mail.follower for 1 follower')
# Do: subscribe Admin with subtype_ids
group_pigs.message_subscribe_users([uid], [mt_mg_nodef, mt_all_nodef])
@@ -171,6 +228,64 @@ class test_mail(TestMailBase):
self.assertNotIn('First answer, should not be displayed', result, 'Old answer should not be in quote.')
self.assertNotIn('My answer I am propagating', result, 'Thread header content should be in quote.')
+ def test_11_notification_url(self):
+ """ Tests designed to test the URL added in notification emails. """
+ cr, uid, group_pigs = self.cr, self.uid, self.group_pigs
+
+ # Partner data
+ partner_raoul = self.res_partner.browse(cr, uid, self.partner_raoul_id)
+ partner_bert_id = self.res_partner.create(cr, uid, {'name': 'bert'})
+ partner_bert = self.res_partner.browse(cr, uid, partner_bert_id)
+ # Mail data
+ mail_mail_id = self.mail_mail.create(cr, uid, {'state': 'exception'})
+ mail = self.mail_mail.browse(cr, uid, mail_mail_id)
+
+ # Test: link for nobody -> None
+ url = mail_mail._get_partner_access_link(self.mail_mail, cr, uid, mail)
+ self.assertEqual(url, None,
+ 'notification email: mails not send to a specific partner should not have any URL')
+
+ # Test: link for partner -> None
+ url = mail_mail._get_partner_access_link(self.mail_mail, cr, uid, mail, partner=partner_bert)
+ self.assertEqual(url, None,
+ 'notification email: mails send to a not-user partner should not have any URL')
+
+ # Test: link for user -> signin
+ url = mail_mail._get_partner_access_link(self.mail_mail, cr, uid, mail, partner=partner_raoul)
+ self.assertIn('action=mail.action_mail_redirect', url,
+ 'notification email: link should contain the redirect action')
+ self.assertIn('login=%s' % partner_raoul.user_ids[0].login, url,
+ 'notification email: link should contain the user login')
+
+ @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm')
+ def test_12_inbox_redirection(self):
+ """ Tests designed to test the inbox redirection of emails notification URLs. """
+ cr, uid, user_admin, group_pigs = self.cr, self.uid, self.user_admin, self.group_pigs
+ model, act_id = self.ir_model_data.get_object_reference(cr, uid, 'mail', 'action_mail_inbox_feeds')
+ # Data: post a message on pigs
+ msg_id = self.group_pigs.message_post(body='My body', partner_ids=[self.partner_bert_id], type='comment', subtype='mail.mt_comment')
+
+ # No specific parameters -> should redirect to Inbox
+ action = mail_thread.message_redirect_action(self.mail_thread, cr, self.user_raoul_id, {'params': {}})
+ self.assertEqual(action.get('type'), 'ir.actions.client',
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+ self.assertEqual(action.get('id'), act_id,
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+
+ # Bert has read access to Pigs -> should redirect to form view of Pigs
+ action = mail_thread.message_redirect_action(self.mail_thread, cr, self.user_raoul_id, {'params': {'message_id': msg_id}})
+ self.assertEqual(action.get('type'), 'ir.actions.act_window',
+ 'URL redirection: action with message_id for read-accredited user should redirect to Pigs')
+ self.assertEqual(action.get('res_id'), group_pigs.id,
+ 'URL redirection: action with message_id for read-accredited user should redirect to Pigs')
+
+ # Bert has no read access to Pigs -> should redirect to Inbox
+ action = mail_thread.message_redirect_action(self.mail_thread, cr, self.user_bert_id, {'params': {'message_id': msg_id}})
+ self.assertEqual(action.get('type'), 'ir.actions.client',
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+ self.assertEqual(action.get('id'), act_id,
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+
def test_20_message_post(self):
""" Tests designed for message_post. """
cr, uid, user_raoul, group_pigs = self.cr, self.uid, self.user_raoul, self.group_pigs
@@ -364,8 +479,8 @@ class test_mail(TestMailBase):
'message_post: notification email sent to more than one email address instead of a precise partner')
self.assertIn(sent_email['email_to'][0], test_emailto,
'message_post: notification email email_to incorrect')
- self.assertEqual(sent_email['reply_to'], '"Followers of Pigs" ',
- 'message_post: notification email reply_to incorrect: should name Followers of Pigs, and have raoul email')
+ self.assertEqual(sent_email['reply_to'], 'r@r', # was '"Followers of Pigs" ', but makes no sense
+ 'message_post: notification email reply_to incorrect: should have raoul email')
self.assertEqual(_mail_subject, sent_email['subject'],
'message_post: notification email subject incorrect')
self.assertIn(html_sanitize(_body2), sent_email['body'],
diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py
index e4269d59d8b..ee166b82dde 100644
--- a/addons/mail/tests/test_mail_gateway.py
+++ b/addons/mail/tests/test_mail_gateway.py
@@ -20,6 +20,7 @@
##############################################################################
from openerp.addons.mail.tests.test_mail_base import TestMailBase
+from openerp.tools import mute_logger
MAIL_TEMPLATE = """Return-Path:
To: {to}
@@ -123,6 +124,107 @@ class TestMailgateway(TestMailBase):
self.assertEqual(partner_info['partner_id'], p_b_id,
'mail_thread: message_find_partner_from_emails wrong partner found')
+ def test_05_mail_message_mail_mail(self):
+ """ Tests designed for testing email values based on mail.message, aliases, ... """
+ cr, uid = self.cr, self.uid
+
+ # Data: clean catchall domain
+ param_ids = self.registry('ir.config_parameter').search(cr, uid, [('key', '=', 'mail.catchall.domain')])
+ self.registry('ir.config_parameter').unlink(cr, uid, param_ids)
+
+ # Do: create a mail_message with a reply_to, without message-id
+ msg_id = self.mail_message.create(cr, uid, {'subject': 'Subject', 'body': 'Body', 'reply_to': 'custom@example.com'})
+ msg = self.mail_message.browse(cr, uid, msg_id)
+ # Test: message content
+ self.assertIn('reply_to', msg.message_id,
+ 'mail_message: message_id should be specific to a mail_message with a given reply_to')
+ self.assertEqual('custom@example.com', msg.reply_to,
+ 'mail_message: incorrect reply_to')
+ # Do: create a mail_mail with the previous mail_message and specified reply_to
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'reply_to': 'other@example.com', 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, 'other@example.com',
+ 'mail_mail: reply_to should be equal to the one coming from creation values')
+ # Do: create a mail_mail with the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, msg.reply_to,
+ 'mail_mail: reply_to should be equal to the one coming from the mail_message')
+
+ # Do: create a mail_message without a reply_to
+ msg_id = self.mail_message.create(cr, uid, {'subject': 'Subject', 'body': 'Body', 'model': 'mail.group', 'res_id': self.group_pigs_id, 'email_from': False})
+ msg = self.mail_message.browse(cr, uid, msg_id)
+ # Test: message content
+ self.assertIn('mail.group', msg.message_id,
+ 'mail_message: message_id should contain model')
+ self.assertIn('%s' % self.group_pigs_id, msg.message_id,
+ 'mail_message: message_id should contain res_id')
+ self.assertFalse(msg.reply_to,
+ 'mail_message: should not generate a reply_to address when not specified')
+ # Do: create a mail_mail based on the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertFalse(mail.reply_to,
+ 'mail_mail: reply_to should not have been guessed')
+ # Update message
+ self.mail_message.write(cr, uid, [msg_id], {'email_from': 'someone@example.com'})
+ msg.refresh()
+ # Do: create a mail_mail based on the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, msg.email_from,
+ 'mail_mail: reply_to should equal to mail_message.email_from when having no document or default alias')
+
+ # Data: set catchall domain
+ self.registry('ir.config_parameter').set_param(cr, uid, 'mail.catchall.domain', 'schlouby.fr')
+ self.registry('ir.config_parameter').unlink(cr, uid, self.registry('ir.config_parameter').search(cr, uid, [('key', '=', 'mail.catchall.alias')]))
+
+ # Do: create a mail_mail based on the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, '"Followers of Pigs" ',
+ 'mail_mail: reply_to should equal the mail.group alias')
+
+ # Update message
+ self.mail_message.write(cr, uid, [msg_id], {'res_id': False, 'email_from': 'someone@schlouby.fr'})
+ msg.refresh()
+ # Do: create a mail_mail based on the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, msg.email_from,
+ 'mail_mail: reply_to should equal the mail_message email_from')
+
+ # Data: set catchall alias
+ self.registry('ir.config_parameter').set_param(self.cr, self.uid, 'mail.catchall.alias', 'gateway')
+
+ # Do: create a mail_mail based on the previous mail_message
+ mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, 'gateway@schlouby.fr',
+ 'mail_mail: reply_to should equal the catchall email alias')
+
+ # Do: create a mail_mail
+ mail_id = self.mail_mail.create(cr, uid, {'state': 'cancel'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, 'gateway@schlouby.fr',
+ 'mail_mail: reply_to should equal the catchall email alias')
+
+ # Do: create a mail_mail
+ mail_id = self.mail_mail.create(cr, uid, {'state': 'cancel', 'reply_to': 'someone@example.com'})
+ mail = self.mail_mail.browse(cr, uid, mail_id)
+ # Test: mail_mail content
+ self.assertEqual(mail.reply_to, 'someone@example.com',
+ 'mail_mail: reply_to should equal the rpely_to given to create')
+
+ @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm')
def test_10_message_process(self):
""" Testing incoming emails processing. """
cr, uid, user_raoul = self.cr, self.uid, self.user_raoul
@@ -365,6 +467,7 @@ class TestMailgateway(TestMailBase):
self.assertEqual(msg.body, '
\nPlease call me as soon as possible this afternoon!\n\n--\nSylvie\n
',
'message_process: plaintext incoming email incorrectly parsed')
+ @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm')
def test_20_thread_parent_resolution(self):
""" Testing parent/child relationships are correctly established when processing incoming mails """
cr, uid = self.cr, self.uid
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py
index 4ff6584d789..a6bfc34c213 100644
--- a/addons/mail/wizard/invite.py
+++ b/addons/mail/wizard/invite.py
@@ -75,7 +75,7 @@ class invite_wizard(osv.osv_memory):
model_name = ir_model.name_get(cr, uid, model_ids, context=context)[0][1]
# send an email if option checked and if a message exists (do not send void emails)
- if wizard.send_mail and wizard.message:
+ if wizard.send_mail and wizard.message and not wizard.message == ' ': # when deleting the message, cleditor keeps a
# add signature
# FIXME 8.0: use notification_email_send, send a wall message and let mail handle email notification + message box
signature_company = self.pool.get('mail.notification').get_signature_footer(cr, uid, user_id=uid, res_model=wizard.res_model, res_id=wizard.res_id, context=context)
diff --git a/addons/marketing_campaign/marketing_campaign_demo.xml b/addons/marketing_campaign/marketing_campaign_demo.xml
index 92443fe987d..89a299e3a85 100644
--- a/addons/marketing_campaign/marketing_campaign_demo.xml
+++ b/addons/marketing_campaign/marketing_campaign_demo.xml
@@ -1,4 +1,3 @@
-
@@ -66,13 +65,13 @@
-
-
+
+
-
-
+
+
@@ -85,9 +84,9 @@
OpenERP Partnercreate_date
-
+
-
+
\ No newline at end of file
diff --git a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml
index 141981a21d6..f6eb8a1d905 100644
--- a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml
+++ b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml
@@ -1,11 +1,10 @@
-
Dummy Actiondummy
-
+
@@ -40,10 +39,10 @@
- Hello,
-
Thanks for the genuine interest you have shown in OpenERP.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>Thanks for the genuine interest you have shown in OpenERP.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>For OpenERP OnDemand Free Trial 2010
@@ -53,11 +52,11 @@
- Hello,
-
We have very good offer that might suit you.
- We suggest you subscribe to the OpenERP Discovery Day on May 2010.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>We have very good offer that might suit you.
+ We suggest you subscribe to the OpenERP Discovery Day on May 2010.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>For OpenERP Discovery Day on May 2010
@@ -68,10 +67,10 @@
- Hello,
-
Thanks for showing interest and for subscribing to the OpenERP Discovery Day.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>Thanks for showing interest and for subscribing to the OpenERP Discovery Day.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>For OpenERP Discovery Day
@@ -82,10 +81,10 @@
- Hello,
-
Thanks for showing interest and buying the OpenERP book.
+ <p>Hello,</p>
+ <p>Thanks for showing interest and buying the OpenERP book.</p>
If any further information required kindly revert back.
-
We have very good offer that might suit you.
- For our gold partners,We are arranging free technical training on june,2010.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>We have very good offer that might suit you.
+ For our gold partners,We are arranging free technical training on june,2010.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>technical training to gold partners
@@ -110,11 +109,11 @@
- Hello,
-
We have very good offer that might suit you.
- For our silver partners,We are paid technical training on june,2010.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>We have very good offer that might suit you.
+ For our silver partners,We are paid technical training on june,2010.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>training to silver partners
@@ -125,11 +124,11 @@
- Hello,
-
We have very good offer that might suit you.
- For our silver partners, we are offering Gold partnership.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>We have very good offer that might suit you.
+ For our silver partners, we are offering Gold partnership.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>gold partnership to silver partners
@@ -140,11 +139,11 @@
- Hello,
-
Thanks for showing interest and for subscribing to technical training.
- If any further information required kindly revert back.I really appreciate your co-operation on this.
-
If any further information is required, do not hesitate to reply to this message.
-
Regards,OpenERP Team,
]]>
+ <p>Hello,</p>
+ <p>Thanks for showing interest and for subscribing to technical training.</p>
+ If any further information required kindly revert back.I really appreciate your co-operation on this.</p>
+ <p>If any further information is required, do not hesitate to reply to this message.</p>
+ <p>Regards,OpenERP Team,</p>subscribing to technical training
@@ -171,7 +170,7 @@
Propose a 1 month free trial for an OnDemand offer
-
+ report
@@ -180,27 +179,27 @@
Thanks for showing interest
-
+ Propose to subscribe to the OpenERP Discovery Day on May 2010
-
+ Thanks for subscribing to the OpenERP Discovery Day
-
+ Propose to buy the OpenERP Book
-
+ report
@@ -209,81 +208,81 @@
Thanks for buying the OpenERP book
-
+ Propose a free technical training to Gold partners
-
+ Propose paid training to Silver partners
-
+ Propose gold partnership to silver partners
-
+ Thanks for subscribing to technical training
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -296,4 +295,4 @@
-
+
\ No newline at end of file
diff --git a/addons/membership/process/membership_process.xml b/addons/membership/process/membership_process.xml
index d67ee864b34..b3ba426ff4a 100644
--- a/addons/membership/process/membership_process.xml
+++ b/addons/membership/process/membership_process.xml
@@ -87,16 +87,16 @@
-
-
+
+
-
-
+
+
@@ -110,25 +110,25 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
\ No newline at end of file
+
diff --git a/addons/mrp/html/coppernic.png b/addons/mrp/html/coppernic.png
new file mode 100644
index 00000000000..692230a5198
Binary files /dev/null and b/addons/mrp/html/coppernic.png differ
diff --git a/addons/mrp/html/index.html b/addons/mrp/html/index.html
new file mode 100644
index 00000000000..5777eb5f147
--- /dev/null
+++ b/addons/mrp/html/index.html
@@ -0,0 +1,193 @@
+
+
+
+
Manufacturing Resource Planning
+
Manage Bill of Materials, Plan Manufacturing Orders, Track Work Orders
+Get all your assembly or manufacturing operations managed by OpenERP. Schedule
+manufacturing orders and work orders automatically. Review the proposed
+planning with the smart kanban and gantt views. Use the advanced analytics
+features to detect bottleneck in resources capacities and inventory locations.
+
+Get manufacturing orders and work orders scheduled automatically based on your
+procurement rules, quantities forecasted and dependent demand (demand for this
+part based on another part consuming it).
+
+
+
+
+
+
+
+
+
+
+
+
Define Flexible Master Data
+
Products, Bill of Materials and Routings
+
+
+
+
+
+Get the flexibility to create multi-level bill of materials, optional routing,
+version changes and phantom bill of materials. You can use BoM for kits or for
+manufacturing orders.
+
+
+
+
+
+
+
+
Get Flexibility In All Opertions
+
+
+ Edit manually all proposed operations at any level of the progress.
+ With OpenERP, you will not be frustrated by a rigid system.
+
+
+
+
+
+
+
+
+
+
+
+
Schedule Work Orders
+
Check resources capacities and fix bottlenecks
+
+
+
+
+
+
+
+Define routings and plan the working time and capacity of your resources.
+Quickly identify resource requirements and bottlenecks to ensure your production
+meets your delivery schedule dates.
+
+Organize manufacturing orders and work orders the way you like it. Process next
+orders from the list view, control inthe calendar view and edit the proposed
+schedule in the Gantt view.
+
+
+
+
Lists
+
+
+
+
+
+
Gantt Charts
+
+
+
+
+
Calendar
+
+
+
+
+
+
+
+
Inventory & Manufacturing Analytics
+
+
+
+
+
+
+
+Track the evolution of the stock value, according to the level of manufacturing
+activities as they progress in the transformation process.
+
+
+
+
+
+
+
+
Fully Integrated with Operations
+
Sales, Purchases and Accounting integration
+
+
+Get your manufacturing resource planning accurate with it's full integration
+with sales and purchases apps. The accounting integration allows real time
+accounting valuation and deeper reporting on costs and revenues on your
+manufacturing operations.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Many companies already enjoy it
+
Hear what they have to say !
+
+
+
+
+ OpenERP allowed our company to efficiently manage a growth from a turnover of 2.4m€ to 15m€ in 4 years.
+
+
+
+
+Organize yourself with efficient todo lists and notes. From personnal tasks to collaborative meeting minutes, increase your user's productivity by giving them the tools to prioritize their work, share their ideas and collaborate on documents.
+
+Quickly create to-dos, organize horizontally for the mid-term (today, this week, this month, ...), prioritize vertically for the short term and group by assigning colors. The kanban approach allows a simple visual organization of your to-dos.
+
+
+
+
+
+
+
Beat Work Overload
+
+ Feel how good it is to rely on a structured way to organize your work instead of keeping everything in memory. Use notes to Get Things Done.
+
+
+
+
Prioritize Efficiently
+
+ Most people are lost in the flow of urgent daily tasks and have difficulties to work on important, long-term tasks. Notes gives you a simple way to allocate time very day to do important, but less urgent tasks.
+
+
+
+
Find Motivation to Close Tasks
+
+ People used to work on tasks they like and not on important tasks. Start feeling good by checking tasks as done.
+
+
+
+
+
+
+
Adapts to Your Creative Process
+
Customize to your own workflow
+
+Everyone has their own way to organize activities. OpenERP Notes' smart kanban approach allows every user to customize their own steps to process it's to-dos and notes.
+
+
+
+
+
A Creative Person
+
+A creative person will organize notes based on idea's maturity level: Draft Ideas Mature Ideas Specified To Do
+
+
+
A Frequent Traveler
+
+ An employee travelling a lot can organize their tasks based on the context to perform the task: U.S. Office | London's Office | To Review during Flights | At Home
+
+
+
+
A Manager
+
+ A manager will organize their high number of tasks based on prioritizations: Todo Today | This Week | This Month | Later
+
+
+
+
+
+
+
+
Personnal Notes
+
Notes are private but can be shared
+
+
+
+
+
+
+
+Write down your ideas in pads, keep your notes at your finger tips, attach related documents and use tags and colors to organize the information. Once your ideas are mature, you can share them to others users, start discussing it and collaborate by improving the specification in the pad.
+
+
+
+
+
+
+
+
Collaborative Meeting Minutes
+
Real-time sharing and edition of notes
+
+
+The real time collaborative writings on notes makes it the perfect tool to collaborate on meeting minutes. Attendees will be able to contribute to the minutes, attach important documents or discuss on the related thread.
+
+
+
+
+
+
+
+
+
diff --git a/addons/note/html/notes_illu_01.png b/addons/note/html/notes_illu_01.png
new file mode 100644
index 00000000000..a7d4197561d
Binary files /dev/null and b/addons/note/html/notes_illu_01.png differ
diff --git a/addons/note/html/notes_sc_00.png b/addons/note/html/notes_sc_00.png
new file mode 100644
index 00000000000..7bb4f95a640
Binary files /dev/null and b/addons/note/html/notes_sc_00.png differ
diff --git a/addons/note/html/notes_sc_01.png b/addons/note/html/notes_sc_01.png
new file mode 100644
index 00000000000..ce9367abf9b
Binary files /dev/null and b/addons/note/html/notes_sc_01.png differ
diff --git a/addons/note/html/notes_sc_02.png b/addons/note/html/notes_sc_02.png
new file mode 100644
index 00000000000..e47889b33fc
Binary files /dev/null and b/addons/note/html/notes_sc_02.png differ
diff --git a/addons/note/html/notes_sc_03.png b/addons/note/html/notes_sc_03.png
new file mode 100644
index 00000000000..6d59d7e5df8
Binary files /dev/null and b/addons/note/html/notes_sc_03.png differ
diff --git a/addons/note/note.py b/addons/note/note.py
index 2d95b15107a..eb9a6397d18 100644
--- a/addons/note/note.py
+++ b/addons/note/note.py
@@ -141,12 +141,19 @@ class note_note(osv.osv):
#note without user's stage
nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True)
if nb_notes_ws:
- result += [{ #notes for unknown stage and if stage_ids is not empty
- '__context': {'group_by': groupby[1:]},
- '__domain': domain + [('stage_ids', 'not in', current_stage_ids)],
- 'stage_id': (0, 'Unknown'),
- 'stage_id_count':nb_notes_ws
- }]
+ # add note to the first column if it's the first stage
+ dom_not_in = ('stage_ids', 'not in', current_stage_ids)
+ if result and result[0]['stage_id'][0] == current_stage_ids[0]:
+ dom_in = result[0]['__domain'].pop()
+ result[0]['__domain'] = domain + ['|', dom_in, dom_not_in]
+ else:
+ # add the first stage column
+ result = [{
+ '__context': {'group_by': groupby[1:]},
+ '__domain': domain + [dom_not_in],
+ 'stage_id': (current_stage_ids[0], stage_name[current_stage_ids[0]]),
+ 'stage_id_count':nb_notes_ws
+ }] + result
else: # if stage_ids is empty
@@ -156,7 +163,7 @@ class note_note(osv.osv):
result = [{ #notes for unknown stage
'__context': {'group_by': groupby[1:]},
'__domain': domain,
- 'stage_id': (0, 'Unknown'),
+ 'stage_id': False,
'stage_id_count':nb_notes_ws
}]
else:
@@ -187,9 +194,12 @@ class res_users(osv.Model):
model_id = data_obj.get_object_reference(cr, uid, 'base', 'group_user') #Employee Group
group_id = model_id and model_id[1] or False
if group_id in [x.id for x in user.groups_id]:
- for note_xml_id in ['note_stage_01','note_stage_02','note_stage_03','note_stage_04']:
- data_id = data_obj._get_id(cr, uid, 'note', note_xml_id)
+ for note_xml_id in ['note_stage_00','note_stage_01','note_stage_02','note_stage_03','note_stage_04']:
+ try:
+ data_id = data_obj._get_id(cr, uid, 'note', note_xml_id)
+ except ValueError:
+ continue
stage_id = data_obj.browse(cr, uid, data_id, context=context).res_id
note_obj.copy(cr, uid, stage_id, default = {
'user_id': user_id}, context=context)
- return user_id
\ No newline at end of file
+ return user_id
diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml
index 592292788b3..376b8e9053f 100644
--- a/addons/note/note_data.xml
+++ b/addons/note/note_data.xml
@@ -2,6 +2,12 @@
+
+ New
+
+
+
+
Today1
diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml
index 49a154d10cc..f3b9e4669c7 100644
--- a/addons/note/note_view.xml
+++ b/addons/note/note_view.xml
@@ -175,7 +175,7 @@
formkanban,tree,form
- {'search_default_open_true':True}
+ {}
+ OpenERP's Point of Sale introduces a super clean interface with no installation required
+ that runs online and offline on modern hardwares.
+
+
+ It's full integration with the company inventory and accounting, gives you real time statistics and
+ consolidations amongst all shops without the hassle of integrating several applications.
+
+ OpenERP's POS is a web application that can run on any device that can
+ display websites with little to no setup required.
+
+
+
+
Touchscreen or Keyboard ?
+
+ The Point of Sale works perfectly on any kind of touch enabled device, whether it's
+ multi-touch tablets like an iPad or keyboardless resistive touchscreen terminals.
+
+
+
+
Scales and Printers
+
+ Barcode scanners and printers are supported out of the box with no setup required.
+ Scales, cashboxes, and other peripherals can be used with the
+ proxy API.
+
+
+
+
+
+
+
+
+
Online and Offline
+
OpenERP's POS stays reliable even if your connection isn't
+
+
+
+
+
+
+
+
+ Deploy new stores with just an internet connection:
+ no installation, no specific hardware required. It works with any
+ iPad, Tablet PC, laptop or industrial POS machine.
+
+ While an internet connection is required to start the Point of Sale,
+ it will stay operational even after a complete disconnection.
+
+ Say goodbye to ugly, outdated POS software and enjoy the OpenERP
+ web interface designed for modern retailer.
+
+
+
+
+
Designed for Productivity
+
+ Whether it's for a restaurant or a shop, you can activate the multiple
+ tickets in parallel to not make your customers wait.
+
+
+
+
+
Blasting fast search
+
+ Scan products, browse through hyerarchical categories, or get quick
+ information about products with the blasting fast filter accross
+ all your products.
+
+
+
+
+
+
+
+
Integrated Inventory Management
+
+
+
+
+
+ Consolidate all your sales channel in real time: stores, ecommerce, sales teams.
+ Get real time control of the inventory and accurate forecasts to manage procurements.
+
+
+ A full warehouse management system at your fingertips: get information
+ about products availabilities, trigger procurement requests, etc.
+
+
+
+
+
+
+
+
Deliver in-store customer services
+
Repairs, warantees, deliveries, etc.
+
+
+ Give your shopper a strong experience by integrating in-store
+ customer services. Handle reparations, track warantees, follow
+ customer claims, plan delivery orders, etc.
+
+
+
+
+
+
+
+
+
+
+
Invoicing & Accounting Integration
+
+
+
+
+
+ Produce customer invoices in just a few clicks. Control sales and
+ cash in real time and use OpenERP's powerful reporting to make
+ smarter decisions to improve your store's efficiency.
+
+ No more hassle of having to integrate softwares: get all your sales
+ and inventory operations automatically posted in your G/L.
+
+
+
+
+
+
+
+
Self-checkout Interface
+
+
+ Reduce costs by limitting the number of required cashiers.
+ The self-checkout mode allows customers to scan products and pay by
+ themselves with a dedicated and super easy user interface.
+
+
+ Use lights and sounds to control the checkout distantly.
+
+
+
+
+
+
+
+
+
+
+
+
Unified Data Amongst All Shops
+
Sync products, prices, customers with no effort
+
+
+
+
+
+ Get new products, pricing strategies and promotions applied automatically to
+ selected stores. Work on a unified customer base. No complex interface is
+ required to pilot a global strategy amongst all your stores.
+
+
+ With OpenERP as a backend, you have a system proven to be perfectly
+ suitable for small stores or large multinationals.
+
+
+
+
+
+
+
+
Know your customers - in store and out
+
+
+ Successful brands integrates all their customer relationship accross all their
+ channels to develop accurate customer profile and communicate with shoppers
+ as they make buying decisions, in store or online.
+
+
+ With OpenERP, you get a 360° customer view, including cross-channel sales,
+ interaction history, profiles, and more.
+
+
+
+
+
+
+
diff --git a/addons/point_of_sale/html/pos_checkout.jpg b/addons/point_of_sale/html/pos_checkout.jpg
new file mode 100644
index 00000000000..d87e5b8499d
Binary files /dev/null and b/addons/point_of_sale/html/pos_checkout.jpg differ
diff --git a/addons/point_of_sale/html/pos_customer_form.png b/addons/point_of_sale/html/pos_customer_form.png
new file mode 100644
index 00000000000..4e89d43c4c3
Binary files /dev/null and b/addons/point_of_sale/html/pos_customer_form.png differ
diff --git a/addons/point_of_sale/html/pos_customers.png b/addons/point_of_sale/html/pos_customers.png
new file mode 100644
index 00000000000..6448074c3d9
Binary files /dev/null and b/addons/point_of_sale/html/pos_customers.png differ
diff --git a/addons/point_of_sale/html/pos_devices.png b/addons/point_of_sale/html/pos_devices.png
new file mode 100644
index 00000000000..a021a87bfac
Binary files /dev/null and b/addons/point_of_sale/html/pos_devices.png differ
diff --git a/addons/point_of_sale/html/pos_invoice.png b/addons/point_of_sale/html/pos_invoice.png
new file mode 100644
index 00000000000..aae4f6d38a5
Binary files /dev/null and b/addons/point_of_sale/html/pos_invoice.png differ
diff --git a/addons/point_of_sale/html/pos_offline.png b/addons/point_of_sale/html/pos_offline.png
new file mode 100644
index 00000000000..764cda88e87
Binary files /dev/null and b/addons/point_of_sale/html/pos_offline.png differ
diff --git a/addons/point_of_sale/html/pos_product_form.png b/addons/point_of_sale/html/pos_product_form.png
new file mode 100644
index 00000000000..a25c85b6496
Binary files /dev/null and b/addons/point_of_sale/html/pos_product_form.png differ
diff --git a/addons/point_of_sale/html/pos_products.png b/addons/point_of_sale/html/pos_products.png
new file mode 100644
index 00000000000..cbfd054d72e
Binary files /dev/null and b/addons/point_of_sale/html/pos_products.png differ
diff --git a/addons/point_of_sale/html/pos_sc_01.jpg b/addons/point_of_sale/html/pos_sc_01.jpg
new file mode 100644
index 00000000000..8fc97e00672
Binary files /dev/null and b/addons/point_of_sale/html/pos_sc_01.jpg differ
diff --git a/addons/point_of_sale/html/pos_sc_02.jpg b/addons/point_of_sale/html/pos_sc_02.jpg
new file mode 100644
index 00000000000..d26e0504933
Binary files /dev/null and b/addons/point_of_sale/html/pos_sc_02.jpg differ
diff --git a/addons/point_of_sale/html/pos_sc_03.jpg b/addons/point_of_sale/html/pos_sc_03.jpg
new file mode 100644
index 00000000000..8eb7e312791
Binary files /dev/null and b/addons/point_of_sale/html/pos_sc_03.jpg differ
diff --git a/addons/point_of_sale/html/pos_ui_01.png b/addons/point_of_sale/html/pos_ui_01.png
new file mode 100644
index 00000000000..1725f91d6f2
Binary files /dev/null and b/addons/point_of_sale/html/pos_ui_01.png differ
diff --git a/addons/point_of_sale/html/pos_ui_02.png b/addons/point_of_sale/html/pos_ui_02.png
new file mode 100644
index 00000000000..aa0eb51c0f1
Binary files /dev/null and b/addons/point_of_sale/html/pos_ui_02.png differ
diff --git a/addons/point_of_sale/html/pos_ui_03.png b/addons/point_of_sale/html/pos_ui_03.png
new file mode 100644
index 00000000000..f25f2a49c00
Binary files /dev/null and b/addons/point_of_sale/html/pos_ui_03.png differ
diff --git a/addons/point_of_sale/res_partner.py b/addons/point_of_sale/res_partner.py
index 81a0f6083be..d7969b0e21a 100644
--- a/addons/point_of_sale/res_partner.py
+++ b/addons/point_of_sale/res_partner.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
import math
diff --git a/addons/point_of_sale/res_users.py b/addons/point_of_sale/res_users.py
index 05e49a5545d..ed2c6fae598 100644
--- a/addons/point_of_sale/res_users.py
+++ b/addons/point_of_sale/res_users.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
import math
diff --git a/addons/point_of_sale/static/lib/mousewheel/jquery.mousewheel-3.0.6.js b/addons/point_of_sale/static/lib/mousewheel/jquery.mousewheel-3.0.6.js
old mode 100755
new mode 100644
diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js
index a79b111b5c5..e47ce66f648 100644
--- a/addons/point_of_sale/static/src/js/db.js
+++ b/addons/point_of_sale/static/src/js/db.js
@@ -204,8 +204,8 @@ function openerp_pos_db(instance, module){
this.packagings_by_product_id[pack.product_id[0]] = [];
}
this.packagings_by_product_id[pack.product_id[0]].push(pack);
- if(pack.ean13){
- this.packagings_by_ean13[pack.ean13] = pack;
+ if(pack.ean){
+ this.packagings_by_ean13[pack.ean] = pack;
}
}
},
diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js
index e4bf004c00f..a533f0a8ee6 100644
--- a/addons/point_of_sale/static/src/js/widgets.js
+++ b/addons/point_of_sale/static/src/js/widgets.js
@@ -319,6 +319,14 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.payment_line.set_amount(amount);
}
},
+ checkAmount: function(e){
+ if (e.which !== 0 && e.charCode !== 0) {
+ if(isNaN(String.fromCharCode(e.charCode))){
+ return (String.fromCharCode(e.charCode) === "." && e.currentTarget.value.toString().split(".").length < 2)?true:false;
+ }
+ }
+ return true
+ },
changedAmount: function() {
if (this.amount !== this.payment_line.get_amount()){
this.renderElement();
@@ -328,7 +336,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
var self = this;
this.name = this.payment_line.get_cashregister().get('journal_id')[1];
this._super();
- this.$('input').keyup(function(event){
+ this.$('input').keypress(_.bind(this.checkAmount, this))
+ .keyup(function(event){
self.changeAmount(event);
});
this.$('.delete-payment-line').click(function() {
diff --git a/addons/point_of_sale/wizard/pos_box.py b/addons/point_of_sale/wizard/pos_box.py
index 471153695f4..e1fa90844d7 100644
--- a/addons/point_of_sale/wizard/pos_box.py
+++ b/addons/point_of_sale/wizard/pos_box.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
from openerp.osv import osv, fields
from openerp.tools.translate import _
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
index 3b1cde3e488..2e828521757 100644
--- a/addons/point_of_sale/wizard/pos_payment.xml
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -15,7 +15,7 @@
diff --git a/addons/point_of_sale/wizard/pos_session_opening.py b/addons/point_of_sale/wizard/pos_session_opening.py
index 039dd90ae6b..39e7c564831 100644
--- a/addons/point_of_sale/wizard/pos_session_opening.py
+++ b/addons/point_of_sale/wizard/pos_session_opening.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
from openerp.osv import osv, fields
from openerp.tools.translate import _
diff --git a/addons/portal/__init__.py b/addons/portal/__init__.py
index 0045a557a49..1f60accc83d 100644
--- a/addons/portal/__init__.py
+++ b/addons/portal/__init__.py
@@ -20,7 +20,9 @@
##############################################################################
import portal
+import mail_thread
import mail_mail
+import mail_message
import wizard
import acquirer
diff --git a/addons/portal/mail_mail.py b/addons/portal/mail_mail.py
index bc982671bfe..e412732fdc9 100644
--- a/addons/portal/mail_mail.py
+++ b/addons/portal/mail_mail.py
@@ -21,7 +21,6 @@
from openerp import SUPERUSER_ID
from openerp.osv import osv
-from openerp.osv.orm import except_orm
from openerp.tools.translate import _
@@ -29,27 +28,19 @@ class mail_mail(osv.Model):
""" Update of mail_mail class, to add the signin URL to notifications. """
_inherit = 'mail.mail'
- def send_get_mail_body_footer(self, cr, uid, mail, partner=None, context=None):
- """ add a signin link inside the body of a mail.mail
- :param mail: mail.mail browse_record
- :param partner: browse_record of the specific recipient partner
- :return: the resulting body_html
+ def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None):
+ """ Generate URLs for links in mails:
+ - partner is not an user: signup_url
+ - partner is an user: fallback on classic URL
"""
+ if context is None:
+ context = {}
partner_obj = self.pool.get('res.partner')
- if partner:
- contex_signup = dict(context or {}, signup_valid=True)
- partner = partner_obj.browse(cr, SUPERUSER_ID, partner.id, context=contex_signup)
- body_footer = _("""Access your messages and documents through our Customer Portal""") % partner.signup_url
- # partner is an user: add a link to the document if read access
- if partner.user_ids and mail.model and mail.res_id \
- and self.check_access_rights(cr, partner.user_ids[0].id, 'read', raise_exception=False):
- related_user = partner.user_ids[0]
- try:
- self.pool[mail.model].check_access_rule(cr, related_user.id, [mail.res_id], 'read', context=context)
- url = partner_obj._get_signup_url_for_action(cr, related_user.id, [partner.id], action='', res_id=mail.res_id, model=mail.model, context=context)[partner.id]
- text = _("""Access this document directly in OpenERP""") % url
- except except_orm, e:
- pass
- return body_footer
+ if partner and not partner.user_ids:
+ contex_signup = dict(context, signup_valid=True)
+ signup_url = partner_obj._get_signup_url_for_action(cr, SUPERUSER_ID, [partner.id],
+ action='login', model=mail.model, res_id=mail.res_id,
+ context=contex_signup)[partner.id]
+ return _("""Access your messages and documents through our Customer Portal""") % signup_url
else:
- return super(mail_mail, self).send_get_mail_body_footer(cr, uid, mail, partner=partner, context=context)
+ return super(mail_mail, self)._get_partner_access_link(cr, uid, mail, partner=partner, context=context)
diff --git a/addons/portal/mail_message.py b/addons/portal/mail_message.py
new file mode 100644
index 00000000000..d6a38f27378
--- /dev/null
+++ b/addons/portal/mail_message.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2011 OpenERP S.A ().
+#
+# 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 osv, orm
+from openerp.tools.translate import _
+
+
+class mail_message(osv.Model):
+ """ Update of mail_message class, to restrict mail access. """
+ _inherit = 'mail.message'
+
+ def _search(self, cr, uid, args, offset=0, limit=None, order=None,
+ context=None, count=False, access_rights_uid=None):
+ """ Override that adds specific access rights of mail.message, to remove
+ all internal notes if uid is a non-employee
+ """
+ group_ids = self.pool.get('res.users').browse(cr, uid, uid, context=context).groups_id
+ group_user_id = self.pool.get("ir.model.data").get_object_reference(cr, uid, 'base', 'group_user')[1]
+ if group_user_id not in [group.id for group in group_ids]:
+ args = ['&', '|', ('type', '!=', 'comment'), ('subtype_id', '!=', False)] + list(args)
+
+ return super(mail_message, self)._search(cr, uid, args, offset=offset, limit=limit, order=order,
+ context=context, count=False, access_rights_uid=access_rights_uid)
+
+ def check_access_rule(self, cr, uid, ids, operation, context=None):
+ """ Add Access rules of mail.message for non-employee user:
+ - read:
+ - raise if the type is comment and subtype NULL (internal note)
+ """
+ group_ids = self.pool.get('res.users').browse(cr, uid, uid, context=context).groups_id
+ group_user_id = self.pool.get("ir.model.data").get_object_reference(cr, uid, 'base', 'group_user')[1]
+ if group_user_id not in [group.id for group in group_ids]:
+ cr.execute('SELECT DISTINCT id FROM "%s" WHERE type = %%s AND subtype_id IS NULL AND id = ANY (%%s)' % (self._table), ('comment', ids,))
+ if cr.fetchall():
+ raise orm.except_orm(_('Access Denied'),
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \
+ (self._description, operation))
+
+ return super(mail_message, self).check_access_rule(cr, uid, ids=ids, operation=operation, context=context)
diff --git a/addons/portal/mail_thread.py b/addons/portal/mail_thread.py
new file mode 100644
index 00000000000..44bc4d0bde8
--- /dev/null
+++ b/addons/portal/mail_thread.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2013-TODAY OpenERP S.A ().
+#
+# 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 import SUPERUSER_ID
+from openerp.osv import osv
+
+
+class mail_thread(osv.AbstractModel):
+ """ Update of mail_mail class, to add the signin URL to notifications. """
+ _inherit = 'mail.thread'
+
+ def _get_inbox_action_xml_id(self, cr, uid, context=None):
+ """ For a given message, return an action that either
+ - opens the form view of the related document if model, res_id, and
+ read access to the document
+ - opens the Inbox with a default search on the conversation if model,
+ res_id
+ - opens the Inbox with context propagated
+ """
+ cur_user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
+ # if uid is a portal user -> action is different
+ if any(group.is_portal for group in cur_user.groups_id):
+ return ('portal', 'action_mail_inbox_feeds_portal')
+ else:
+ return super(mail_thread, self)._get_inbox_action_xml_id(cr, uid, context=context)
diff --git a/addons/portal/portal_demo.xml b/addons/portal/portal_demo.xml
index c05189fd2ab..3660754b4ad 100644
--- a/addons/portal/portal_demo.xml
+++ b/addons/portal/portal_demo.xml
@@ -40,7 +40,7 @@ Mr Demo Portal
mail.group
- As your first portal member, I am very pleased to be able to be able to communicate directly with you. Be sure I'll read all news carefully!]]>
+ As your first portal member, I am very pleased to be able to communicate directly with you. Be sure I'll read all news carefully!]]>comment
diff --git a/addons/portal/security/ir.model.access.csv b/addons/portal/security/ir.model.access.csv
index 31bd7332c2f..26b0b4895e8 100644
--- a/addons/portal/security/ir.model.access.csv
+++ b/addons/portal/security/ir.model.access.csv
@@ -3,7 +3,7 @@ access_mail_message_portal,mail.message.portal,mail.model_mail_message,group_por
access_mail_mail_portal,mail.mail.portal,mail.model_mail_mail,group_portal,1,1,1,0
access_mail_notification_portal,mail.notification.portal,mail.model_mail_notification,group_portal,1,1,1,0
access_mail_followers_portal,mail.followers.portal,mail.model_mail_followers,group_portal,1,1,0,0
-access_res_partner,res.partner,base.model_res_partner,portal.group_portal,1,0,0,0
+access_res_partner_portal,res.partner.portal,base.model_res_partner,portal.group_portal,1,0,0,0
access_acquirer,portal.payment.acquirer,portal.model_portal_payment_acquirer,,1,0,0,0
access_acquirer_all,portal.payment.acquirer,portal.model_portal_payment_acquirer,base.group_system,1,1,1,1
access_ir_attachment_group_portal,ir.attachment group_portal,base.model_ir_attachment,portal.group_portal,1,0,1,0
\ No newline at end of file
diff --git a/addons/portal/tests/test_portal.py b/addons/portal/tests/test_portal.py
index 07becf5cdd9..e2b66e65af6 100644
--- a/addons/portal/tests/test_portal.py
+++ b/addons/portal/tests/test_portal.py
@@ -40,7 +40,9 @@ class test_portal(TestMailBase):
self.partner_chell_id = self.user_chell.partner_id.id
# Create a PigsPortal group
- self.group_port_id = self.mail_group.create(cr, uid, {'name': 'PigsPortal', 'public': 'groups', 'group_public_id': self.group_portal_id})
+ self.group_port_id = self.mail_group.create(cr, uid,
+ {'name': 'PigsPortal', 'public': 'groups', 'group_public_id': self.group_portal_id},
+ {'mail_create_nolog': True})
# Set an email address for the user running the tests, used as Sender for outgoing mails
self.res_users.write(cr, uid, uid, {'email': 'test@localhost'})
@@ -130,3 +132,94 @@ class test_portal(TestMailBase):
'invite: body of invitation email is incorrect')
self.assertTrue(partner_carine.signup_url in sent_email.get('body'),
'invite: body of invitation email does not contain signup url')
+
+ def test_20_notification_url(self):
+ """ Tests designed to test the URL added in notification emails. """
+ cr, uid, group_pigs = self.cr, self.uid, self.group_pigs
+
+ # Partner data
+ partner_raoul = self.res_partner.browse(cr, uid, self.partner_raoul_id)
+ partner_bert_id = self.res_partner.create(cr, uid, {'name': 'bert'})
+ partner_bert = self.res_partner.browse(cr, uid, partner_bert_id)
+ # Mail data
+ mail_mail_id = self.mail_mail.create(cr, uid, {'state': 'exception'})
+ mail = self.mail_mail.browse(cr, uid, mail_mail_id)
+
+ # Test: link for nobody -> None
+ url = self.mail_mail._get_partner_access_link(cr, uid, mail)
+ self.assertEqual(url, None,
+ 'notification email: mails not send to a specific partner should not have any URL')
+
+ # Test: link for partner -> signup URL
+ url = self.mail_mail._get_partner_access_link(cr, uid, mail, partner=partner_bert)
+ self.assertIn(partner_bert.signup_url, url,
+ 'notification email: mails send to a not-user partner should contain the signup URL')
+
+ # Test: link for user -> signin
+ url = self.mail_mail._get_partner_access_link(cr, uid, mail, partner=partner_raoul)
+ self.assertIn('action=mail.action_mail_redirect', url,
+ 'notification email: link should contain the redirect action')
+ self.assertIn('login=%s' % partner_raoul.user_ids[0].login, url,
+ 'notification email: link should contain the user login')
+
+ @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm')
+ def test_21_inbox_redirection(self):
+ """ Tests designed to test the inbox redirection of emails notification URLs. """
+ cr, uid, user_admin, group_pigs = self.cr, self.uid, self.user_admin, self.group_pigs
+ model, act_id = self.ir_model_data.get_object_reference(cr, uid, 'mail', 'action_mail_inbox_feeds')
+ model, port_act_id = self.ir_model_data.get_object_reference(cr, uid, 'portal', 'action_mail_inbox_feeds_portal')
+ # Data: post a message on pigs
+ msg_id = self.group_pigs.message_post(body='My body', partner_ids=[self.partner_bert_id, self.partner_chell_id], type='comment', subtype='mail.mt_comment')
+
+ # No specific parameters -> should redirect to Inbox
+ action = self.mail_thread.message_redirect_action(cr, self.user_raoul_id, {'params': {}})
+ self.assertEqual(action.get('type'), 'ir.actions.client',
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+ self.assertEqual(action.get('id'), act_id,
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+
+ # Bert has read access to Pigs -> should redirect to form view of Pigs
+ action = self.mail_thread.message_redirect_action(cr, self.user_raoul_id, {'params': {'message_id': msg_id}})
+ self.assertEqual(action.get('type'), 'ir.actions.act_window',
+ 'URL redirection: action with message_id for read-accredited user should redirect to Pigs')
+ self.assertEqual(action.get('res_id'), group_pigs.id,
+ 'URL redirection: action with message_id for read-accredited user should redirect to Pigs')
+
+ # Bert has no read access to Pigs -> should redirect to Inbox
+ action = self.mail_thread.message_redirect_action(cr, self.user_bert_id, {'params': {'message_id': msg_id}})
+ self.assertEqual(action.get('type'), 'ir.actions.client',
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+ self.assertEqual(action.get('id'), act_id,
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+
+ # Chell has no read access to pigs -> should redirect to Portal Inbox
+ action = self.mail_thread.message_redirect_action(cr, self.user_chell_id, {'params': {'message_id': msg_id}})
+ self.assertEqual(action.get('type'), 'ir.actions.client',
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+ self.assertEqual(action.get('id'), port_act_id,
+ 'URL redirection: action without parameters should redirect to client action Inbox')
+
+ def test_30_message_read(self):
+ cr, uid, group_port_id = self.cr, self.uid, self.group_port_id
+
+ # Data: custom subtypes
+ mt_group_public_id = self.mail_message_subtype.create(cr, uid, {'name': 'group_public', 'description': 'Group changed'})
+ self.ir_model_data.create(cr, uid, {'name': 'mt_group_public', 'model': 'mail.message.subtype', 'module': 'mail', 'res_id': mt_group_public_id})
+ # Data: post messages with various subtypes
+ msg1_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body1', type='comment', subtype='mail.mt_comment')
+ msg2_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body2', type='comment', subtype='mail.mt_group_public')
+ msg3_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body3', type='comment', subtype='mail.mt_comment')
+ msg4_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body4', type='comment')
+ msg5_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body5', type='notification')
+
+ # Do: Chell search messages: should not see internal notes (comment without subtype)
+ msg_ids = self.mail_message.search(cr, self.user_chell_id, [('model', '=', 'mail.group'), ('res_id', '=', group_port_id)])
+ self.assertEqual(set(msg_ids), set([msg1_id, msg2_id, msg3_id, msg5_id]),
+ 'mail_message: portal user has access to messages he should not read')
+
+ # Do: Chell read messages she can read
+ self.mail_message.read(cr, self.user_chell_id, msg_ids, ['body', 'type', 'subtype_id'])
+
+ # Do: Chell read a message she should not be able to read
+ with self.assertRaises(except_orm):
+ self.mail_message.read(cr, self.user_chell_id, [msg4_id], ['body', 'type', 'subtype_id'])
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index e3047cd5edb..e363afa47cb 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -172,7 +172,7 @@ class wizard_user(osv.osv_memory):
@return: browse record of model res.users
"""
res_users = self.pool.get('res.users')
- create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation
+ create_context = dict(context or {}, noshortcut=True, no_reset_password=True) # to prevent shortcut creation
values = {
'login': extract_email(wizard_user.email),
'partner_id': wizard_user.partner_id.id,
diff --git a/addons/portal_crm/i18n/fr.po b/addons/portal_crm/i18n/fr.po
new file mode 100644
index 00000000000..a0633c60306
--- /dev/null
+++ b/addons/portal_crm/i18n/fr.po
@@ -0,0 +1,546 @@
+# French 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-05-22 16:34+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: French \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-05-23 05:19+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,type:0
+msgid "Lead"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,title:0
+msgid "Title"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,probability:0
+msgid "Success Rate (%)"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Contact us"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_action:0
+msgid "Next Action Date"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,fax:0
+msgid "Fax"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,zip:0
+msgid "Zip"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,message_unread:0
+msgid "Unread Messages"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,company_id:0
+msgid "Company"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,day_open:0
+msgid "Days to Open"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Thank you for your interest, we'll respond to your request shortly."
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,priority:0
+msgid "Highest"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,mobile:0
+msgid "Mobile"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,description:0
+msgid "Notes"
+msgstr "Notes"
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,message_ids:0
+msgid "Messages"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,color:0
+msgid "Color Index"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_latitude:0
+msgid "Geo Latitude"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_name:0
+msgid "Customer Name"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,state:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,message_unread:0
+msgid "If checked new messages require your attention."
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,channel_id:0
+msgid "Communication channel (mail, direct, phone, ...)"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,type_id:0
+msgid "Campaign"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,ref:0
+msgid "Reference"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_action_next:0
+#: field:portal_crm.crm_contact_us,title_action:0
+msgid "Next Action"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,message_summary:0
+msgid ""
+"Holds the Chatter summary (number of messages, ...). This summary is "
+"directly in html format in order to be inserted in kanban views."
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_id:0
+msgid "Partner"
+msgstr ""
+
+#. module: portal_crm
+#: model:ir.actions.act_window,name:portal_crm.action_contact_us
+msgid "Contact Us"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,name:0
+msgid "Subject"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,opt_out:0
+msgid "Opt-Out"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,priority:0
+msgid "Priority"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,state_id:0
+msgid "State"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,message_follower_ids:0
+msgid "Followers"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,partner_id:0
+msgid "Linked partner (optional). Usually created when converting the lead."
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,payment_mode:0
+msgid "Payment Mode"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,state:0
+msgid "New"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,type:0
+msgid "Type"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,email_from:0
+msgid "Email"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,channel_id:0
+msgid "Channel"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Name"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,priority:0
+msgid "Lowest"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,create_date:0
+msgid "Creation Date"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Close"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,state:0
+msgid "Pending"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,type:0
+msgid "Type is used to separate Leads and Opportunities"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,categ_ids:0
+msgid "Categories"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,stage_id:0
+msgid "Stage"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,user_login:0
+msgid "User Login"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,opt_out:0
+msgid ""
+"If opt-out is checked, this contact has refused to receive emails or "
+"unsubscribed to a campaign."
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,contact_name:0
+msgid "Contact Name"
+msgstr ""
+
+#. module: portal_crm
+#: model:ir.ui.menu,name:portal_crm.portal_company_contact
+msgid "Contact"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_address_email:0
+msgid "Partner Contact Email"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,planned_revenue:0
+msgid "Expected Revenue"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,task_ids:0
+msgid "Tasks"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Contact form"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,company_currency:0
+msgid "Currency"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,write_date:0
+msgid "Update Date"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_deadline:0
+msgid "Expected Closing"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,ref2:0
+msgid "Reference 2"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,user_email:0
+msgid "User Email"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_open:0
+msgid "Opened"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,state:0
+msgid "In Progress"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,partner_name:0
+msgid ""
+"The name of the future partner company that will be created while converting "
+"the lead into opportunity"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,planned_cost:0
+msgid "Planned Costs"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,date_deadline:0
+msgid "Estimate of the date on which the opportunity will be won."
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,email_cc:0
+msgid ""
+"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"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,priority:0
+msgid "Low"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_closed:0
+#: selection:portal_crm.crm_contact_us,state:0
+msgid "Closed"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_assign:0
+msgid "Assignation Date"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,state:0
+msgid "Status"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,priority:0
+msgid "Normal"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,email_cc:0
+msgid "Global CC"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,street2:0
+msgid "Street2"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,id:0
+msgid "ID"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,phone:0
+msgid "Phone"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,message_is_follower:0
+msgid "Is a Follower"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,active:0
+msgid "Active"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,user_id:0
+msgid "Salesperson"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,day_close:0
+msgid "Days to Close"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,company_ids:0
+msgid "Companies"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,message_summary:0
+msgid "Summary"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,section_id:0
+msgid ""
+"When sending mails, the default email address is taken from the sales team."
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_address_name:0
+msgid "Partner Contact Name"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_longitude:0
+msgid "Geo Longitude"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,date_assign:0
+msgid "Last date this case was forwarded/assigned to a partner"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,email_from:0
+msgid "Email address of the contact"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,city:0
+msgid "City"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Submit"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,function:0
+msgid "Function"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,referred:0
+msgid "Referred By"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,partner_assigned_id:0
+msgid "Assigned Partner"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,type:0
+msgid "Opportunity"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,partner_assigned_id:0
+msgid "Partner this case has been forwarded/assigned to."
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,country_id:0
+msgid "Country"
+msgstr ""
+
+#. module: portal_crm
+#: view:portal_crm.crm_contact_us:0
+msgid "Thank you"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,state:0
+msgid ""
+"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'."
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,message_ids:0
+msgid "Messages and communication history"
+msgstr ""
+
+#. module: portal_crm
+#: help:portal_crm.crm_contact_us,type_id:0
+msgid ""
+"From which campaign (seminar, marketing campaign, mass mailing, ...) did "
+"this contact come from?"
+msgstr ""
+
+#. module: portal_crm
+#: selection:portal_crm.crm_contact_us,priority:0
+msgid "High"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,section_id:0
+msgid "Sales Team"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,street:0
+msgid "Street"
+msgstr ""
+
+#. module: portal_crm
+#: field:portal_crm.crm_contact_us,date_action_last:0
+msgid "Last Action"
+msgstr ""
+
+#. module: portal_crm
+#: model:ir.model,name:portal_crm.model_portal_crm_crm_contact_us
+msgid "Contact form for the portal"
+msgstr ""
diff --git a/addons/portal_event/i18n/fr.po b/addons/portal_event/i18n/fr.po
new file mode 100644
index 00000000000..81c0a603fc6
--- /dev/null
+++ b/addons/portal_event/i18n/fr.po
@@ -0,0 +1,59 @@
+# French 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-05-22 16:32+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: French \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-05-23 05:19+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
+
+#. module: portal_event
+#: view:event.event:0
+msgid "Portal Settings"
+msgstr ""
+
+#. module: portal_event
+#: model:ir.actions.act_window,help:portal_event.action_event_view
+msgid "There are no public events."
+msgstr ""
+
+#. module: portal_event
+#: selection:event.event,visibility:0
+msgid "Private"
+msgstr ""
+
+#. module: portal_event
+#: model:ir.model,name:portal_event.model_event_event
+msgid "Event"
+msgstr ""
+
+#. module: portal_event
+#: model:ir.actions.act_window,name:portal_event.action_event_view
+#: model:ir.ui.menu,name:portal_event.portal_company_events
+msgid "Events"
+msgstr ""
+
+#. module: portal_event
+#: field:event.event,visibility:0
+msgid "Visibility"
+msgstr ""
+
+#. module: portal_event
+#: help:event.event,visibility:0
+msgid "Event's visibility in the portal's contact page"
+msgstr ""
+
+#. module: portal_event
+#: selection:event.event,visibility:0
+msgid "Public"
+msgstr ""
diff --git a/addons/portal_event/portal_event_view.xml b/addons/portal_event/portal_event_view.xml
old mode 100755
new mode 100644
diff --git a/addons/portal_hr_employees/hr_employee_view.xml b/addons/portal_hr_employees/hr_employee_view.xml
index a3182cd5b1c..ace0daaff87 100644
--- a/addons/portal_hr_employees/hr_employee_view.xml
+++ b/addons/portal_hr_employees/hr_employee_view.xml
@@ -35,11 +35,35 @@
HR - Employess Kanbanhr.employee
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Tel:
+
Mobile:
+
+
+
+
+
+
+
+
+
diff --git a/addons/portal_hr_employees/i18n/fr.po b/addons/portal_hr_employees/i18n/fr.po
new file mode 100644
index 00000000000..3fdc48a35de
--- /dev/null
+++ b/addons/portal_hr_employees/i18n/fr.po
@@ -0,0 +1,95 @@
+# French 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-05-22 16:29+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: French \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-05-23 05:19+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Coach"
+msgstr ""
+
+#. module: portal_hr_employees
+#: model:ir.actions.act_window,name:portal_hr_employees.action_team
+#: view:portal_crm.crm_contact_us:0
+msgid "Our Team"
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Group By..."
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Company"
+msgstr ""
+
+#. module: portal_hr_employees
+#: selection:hr.employee,visibility:0
+msgid "Public"
+msgstr ""
+
+#. module: portal_hr_employees
+#: help:hr.employee,visibility:0
+msgid "Employee's visibility in the portal's contact page"
+msgstr ""
+
+#. module: portal_hr_employees
+#: selection:hr.employee,visibility:0
+msgid "Private"
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Manager"
+msgstr ""
+
+#. module: portal_hr_employees
+#: model:ir.model,name:portal_hr_employees.model_hr_employee
+msgid "Employee"
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Job"
+msgstr ""
+
+#. module: portal_hr_employees
+#: field:hr.employee,visibility:0
+msgid "Visibility"
+msgstr ""
+
+#. module: portal_hr_employees
+#: field:hr.employee,public_info:0
+msgid "Public Info"
+msgstr ""
+
+#. module: portal_hr_employees
+#: model:ir.model,name:portal_hr_employees.model_portal_crm_crm_contact_us
+msgid "Contact form for the portal"
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+msgid "Department"
+msgstr ""
+
+#. module: portal_hr_employees
+#: view:hr.employee:0
+#: field:portal_crm.crm_contact_us,employee_ids:0
+msgid "Employees"
+msgstr ""
diff --git a/addons/portal_project/security/portal_security.xml b/addons/portal_project/security/portal_security.xml
index 8d58ed70aeb..67e57766ebd 100644
--- a/addons/portal_project/security/portal_security.xml
+++ b/addons/portal_project/security/portal_security.xml
@@ -33,27 +33,26 @@
- Project/Task: employees: public, portal, employee or following or assigned
+ Project/Task: employees: public, portal, employee or (followers and following)['|',
- ('user_id', '=', user.id),
- '|',
- ('project_id.privacy_visibility', 'in', ['public', 'portal', 'employees']),
- '&',
- ('project_id.privacy_visibility', '=', 'followers'),
- ('message_follower_ids', 'in', [user.partner_id.id]),
+ ('project_id.privacy_visibility', 'in', ['public', 'portal', 'employees']),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.partner_id.id]),
]
- Project/Task: portal users: public or portal and following
+ Project/Task: portal users: public or (portal and colleagues following) or (followers and following)
- ['|',
- ('project_id.privacy_visibility', '=', 'public'),
+ ['|', '|',
+ ('project_id.privacy_visibility', 'in', ['public']),
'&',
- ('project_id.privacy_visibility', 'in', ['portal', 'followers']),
- '|',
- ('message_follower_ids','in', [user.partner_id.id]),
- ('user_id', '=', user.id),
+ ('project_id.privacy_visibility', '=', 'portal'),
+ ('message_follower_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.partner_id.id]),
]
diff --git a/addons/portal_project_issue/i18n/fr.po b/addons/portal_project_issue/i18n/fr.po
new file mode 100644
index 00000000000..48fc9e2ea59
--- /dev/null
+++ b/addons/portal_project_issue/i18n/fr.po
@@ -0,0 +1,40 @@
+# French 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:06+0000\n"
+"PO-Revision-Date: 2013-05-22 08:03+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: French \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-05-23 05:19+0000\n"
+"X-Generator: Launchpad (build 16640)\n"
+
+#. module: portal_project_issue
+#: view:project.issue:0
+msgid "Creation:"
+msgstr ""
+
+#. module: portal_project_issue
+#: model:ir.actions.act_window,help:portal_project_issue.project_issue_categ_act0
+msgid ""
+"
\n"
+" Click to create an issue.\n"
+"
\n"
+" You can track your issues from this menu and the action we\n"
+" will take.\n"
+"
\n"
+" "
+msgstr ""
+
+#. module: portal_project_issue
+#: model:ir.actions.act_window,name:portal_project_issue.project_issue_categ_act0
+msgid "Issues"
+msgstr ""
diff --git a/addons/portal_project_issue/security/portal_security.xml b/addons/portal_project_issue/security/portal_security.xml
index f6cd8d89be7..598c1620a82 100644
--- a/addons/portal_project_issue/security/portal_security.xml
+++ b/addons/portal_project_issue/security/portal_security.xml
@@ -3,28 +3,27 @@
- Project/Issue: portal users: public or portal and following
+ Project/Issue: portal users: public or (portal and colleagues following) or (followers and following)
- ['|',
- ('project_id.privacy_visibility', '=', 'public'),
+ ['|', '|',
+ ('project_id.privacy_visibility', 'in', ['public']),
'&',
- ('project_id.privacy_visibility', 'in', ['portal', 'followers']),
- '|',
- ('message_follower_ids','in', [user.partner_id.id]),
- ('user_id', '=', user.id),
+ ('project_id.privacy_visibility', '=', 'portal'),
+ ('message_follower_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.partner_id.id]),
]
- Project/Issue: employees: public, portal, employee or following or assigned
+ Project/Issue: employees: public, portal, employee or (followers and following)['|',
- ('user_id', '=', user.id),
- '|',
- ('project_id.privacy_visibility', 'in', ['public', 'portal', 'employees']),
- '&',
- ('project_id.privacy_visibility', '=', 'followers'),
- ('message_follower_ids', 'in', [user.partner_id.id]),
+ ('project_id.privacy_visibility', 'in', ['public', 'portal', 'employees']),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.partner_id.id]),
]
diff --git a/addons/portal_project_long_term/security/portal_security.xml b/addons/portal_project_long_term/security/portal_security.xml
index eab70ebe734..d8aec542847 100644
--- a/addons/portal_project_long_term/security/portal_security.xml
+++ b/addons/portal_project_long_term/security/portal_security.xml
@@ -3,16 +3,9 @@
- Project/Phase: portal users: public or portal and following
+ Project/Phase: portal users: public or (portal and colleagues following) or (followers and following)
- ['|',
- ('project_id.privacy_visibility', '=', 'public'),
- '&',
- ('project_id.privacy_visibility', 'in', ['portal', 'followers']),
- '|',
- ('message_follower_ids','in', [user.partner_id.id]),
- ('user_id', '=', user.id),
- ]
+ [('project_id.privacy_visibility', 'in', ['public', 'portal'])]
diff --git a/addons/portal_sale/portal_sale.py b/addons/portal_sale/portal_sale.py
index cd3b702d3c5..07300c5d463 100644
--- a/addons/portal_sale/portal_sale.py
+++ b/addons/portal_sale/portal_sale.py
@@ -104,25 +104,6 @@ class account_invoice(osv.Model):
pass
return action_dict
- def invoice_validate(self, cr, uid, ids, context=None):
- # fetch the partner's id and subscribe the partner to the invoice
- document = self.browse(cr, uid, ids[0], context=context)
- partner = document.partner_id
- # TDE note: this code should be improved: used a real invite wizard instead of an ugly email
- if partner.id not in document.message_follower_ids:
- self.message_subscribe(cr, uid, ids, [partner.id], context=context)
- mail_values = {
- 'recipient_ids': [(4, partner.id)],
- 'subject': 'Invitation to follow %s' % document.name_get()[0][1],
- 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1],
- 'auto_delete': True,
- 'type': 'email',
- }
- mail_obj = self.pool.get('mail.mail')
- mail_id = mail_obj.create(cr, uid, mail_values, context=context)
- mail_obj.send(cr, uid, [mail_id], context=context)
- return super(account_invoice, self).invoice_validate(cr, uid, ids, context=context)
-
def get_signup_url(self, cr, uid, ids, context=None):
assert len(ids) == 1
document = self.browse(cr, uid, ids[0], context=context)
diff --git a/addons/procurement/stock_orderpoint.xml b/addons/procurement/stock_orderpoint.xml
index 31c48046d64..67d610c65c9 100644
--- a/addons/procurement/stock_orderpoint.xml
+++ b/addons/procurement/stock_orderpoint.xml
@@ -1,4 +1,3 @@
-
@@ -7,50 +6,50 @@
25.05.0
-
+
-
+ 10.05.0
-
+
-
+ 12.05.0
-
+
-
+ 50.010.0
-
+
-
+ 15.05.0
-
+
-
+ 5.03.0
-
+
-
+
-
+
\ No newline at end of file
diff --git a/addons/product/process/product_process.xml b/addons/product/process/product_process.xml
index 03ce904abad..652710fac94 100644
--- a/addons/product/process/product_process.xml
+++ b/addons/product/process/product_process.xml
@@ -43,8 +43,8 @@
-
-
+
+
diff --git a/addons/product/product.py b/addons/product/product.py
index 518e455ddc1..656812bebbb 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -292,9 +292,14 @@ class product_template(osv.osv):
_columns = {
'name': fields.char('Name', size=128, required=True, translate=True, select=True),
'product_manager': fields.many2one('res.users','Product Manager'),
- 'description': fields.text('Description',translate=True),
- 'description_purchase': fields.text('Purchase Description',translate=True),
- 'description_sale': fields.text('Sale Description',translate=True),
+ 'description': fields.text('Description',translate=True,
+ help="A precise description of the Product, used only for internal information purposes."),
+ 'description_purchase': fields.text('Purchase Description',translate=True,
+ help="A description of the Product that you want to communicate to your suppliers. "
+ "This description will be copied to every Purchase Order, Reception and Supplier Invoice/Refund."),
+ 'description_sale': fields.text('Sale Description',translate=True,
+ help="A description of the Product that you want to communicate to your customers. "
+ "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"),
'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."),
'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
'rental': fields.boolean('Can be Rent'),
diff --git a/addons/product/report/product_label.xsl b/addons/product/report/product_label.xsl
index 641db73ea7d..5dbb2d64a28 100644
--- a/addons/product/report/product_label.xsl
+++ b/addons/product/report/product_label.xsl
@@ -67,7 +67,7 @@
-
+
diff --git a/addons/project/html/Mario-Riva.png b/addons/project/html/Mario-Riva.png
new file mode 100644
index 00000000000..35b030a4265
Binary files /dev/null and b/addons/project/html/Mario-Riva.png differ
diff --git a/addons/project/html/Yoshi-Tashiro.png b/addons/project/html/Yoshi-Tashiro.png
new file mode 100644
index 00000000000..f3457a9088e
Binary files /dev/null and b/addons/project/html/Yoshi-Tashiro.png differ
diff --git a/addons/project/html/index.html b/addons/project/html/index.html
new file mode 100644
index 00000000000..93f1be8a41d
--- /dev/null
+++ b/addons/project/html/index.html
@@ -0,0 +1,197 @@
+
+
+OpenERP's collaborative and realtime project management helps your team get
+work done. Keep track of everything, from the big picture to the minute
+details, from the customer contract to the billing.
+
+Organize projects around your own processes. Work on tasks and issues using the kanban view, schedule tasks using the gantt chart
+and control deadlines in the calendar view. Every project may have it's own stages
+allowing teams to optimize their job.
+
+
+
+
Kanban
+
+
+
+
+
+
Gantt Charts
+
+
+
+
+
Calendar
+
+
+
+
+
+
+
+
Easy to use
+
+
+
+
+
+Get organized as fast as you can think. The easy-to-use interface takes no time
+to learn, and every action is instantaneous, so there’s nothing standing
+between you and your sweet productive flow.
+
+
+
+
+
+
+
Work Together
+
Real time chats, document sharing, email integration
+
+
+
+Use open chatter to communicate with your team or customers and share comments
+and documents on tasks and issues. Integrate discussion fast with the email
+integration.
+
+Talk to others users or customers with the live chat feature.
+
+
+
+
+
+
+
+
+
+
+
Collaborative Writing
+
The power of etherpad, inside your tasks
+
+
+
+
+
+Collaboratively edit the same specifications or meeting minutes right inside the
+application. The incorporated etherpad feature allows several people to work
+on the same tasks, at the same time.
+
+
+This is very efficient for scrum meetings, meeting minutes or complex
+specifications. Every user has their own color and you can replay the whole
+creation of the content.
+
+
+
+
+
+
+
+
Get Work Done
+
+
+Get alerts on followed events to stay up to date with what interests you. Use
+instant green/red visual indicators to scan through what has been done and what
+requires your attention.
+
+
+
+
+
+
+
+
+
+
+
Timesheets, Contracts & Invoicing
+
+
+
+
+
+Projects are automatically integrated with customer contracts allowing you to
+invoice based on time & materials and record timesheets easily.
+
+
+
+
+
+
+
+
+
Track Issues
+
Support services, helpdesk, bug tracker, etc.
+
+
+Single out the issues that arise in a project in order to have a better focus
+on resolving them. Integrate customer interaction on every issue and get
+accurate reports on your team's performance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Many companies already enjoy it
+
Hear what they have to say !
+
+
+
+
+ OpenERP provides essential platform for our project management.
+ Things are better organized and much more visible with it.
+
+
+
+
+
+ The possibility to link the Project Management to Sales and Manufacturing widely
+ extends the range of possible applications beyond the needs of service companies.
+
+
+
+
+Get the right purchase proposition at the right time to reduce your inventory level. Improve your purchase and inventory performance with procurement rules depending on stock levels, logistic rules, sales orders, forecasted manufacturing orders, etc.
+
+Send requests for quotations or purchase orders to your supplier in one click. Get access to product receptions and invoices from your purchase order.
+
+
+
+
+
+
+
+
+
+
+
Purchase Tenders
+
Get the best price by negotiating with several suppliers
+
+
+
+
+
+Launch purchase tenders, integrate supplier's answers in the process and compare propositions. Choose the best offer and send purchase orders easily. Use reporting to analyse the quality of your suppliers afterwards.
+
+Integrate all supplier's communications on the purchase orders (or RfQs) to get a strong traceability on the negotiation or after sales service issues. Use the claim management module to track issues related to suppliers.
+
+
+
+
+
+
+
+
+
+
+
+
Standard Price, Average Price, FIFO
+
+
+
+
+
+Use the costing method that reflects your business: standard price, average price, fifo or lifo. Get your accounting entries and the right inventory valuation in real-time; OpenERP manages everything for you, transparently.
+
+
+
+
+
+
+
+
+
Import Supplier Pricelists
+
Take smart purchase decisions using the best prices
+
+
+Easily import supplier's pricelists to make smarter purchase decisions based on promotions, prices depending on quantities and special contract conditions. You can even base your sales price depending on your supplier's prices.
+
+
+
+
+
+
+
+
+
+
+
Control Products and Invoices
+
+
+
+
+
+
+
+No product or order is left behind, the inventory control allows you to manage back orders, refunds, product reception and quality control. Choose the right control method according to your need.
+
+
+Control supplier invoices with no effort. Choose the right method according to your need: pre-generate draft invoices based on purchase orders, on products receptions, create invoices manually and import lines from purchase orders, etc.
+
+
+
+
+
+
+
+
Get Statistics On Your Purchases
+
+
+Get accurate statistics on the performance of your suppliers through flexible reporting: delivery delays, negotiated discount on prices, quantities purchased, etc. Integrate purchases with the analytic accounting to analyse your contracts profitability.
+