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 3959799f1bb..e92bd3a7879 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1670,7 +1670,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..29197a97b07 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -722,7 +722,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 +769,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 +783,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 +870,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 +986,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)
@@ -1517,8 +1519,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 +1663,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 13bc694a1cc..603c4254b19 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2111,10 +2111,8 @@
-
-
-
+
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index b6fae3140b5..f6c89a92560 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -50,11 +50,12 @@
-
+ {'search_default_partner_id': [active_id], 'default_partner_id': active_id}Contracts/Analytic Accountsaccount.analytic.account
- tree,form
+
+ partner.view.buttons
@@ -67,7 +68,7 @@
name="%(account.action_invoice_tree)d"
context="{'search_default_partner_id': active_id,'default_partner_id': active_id}" groups="account.group_account_invoice"/>
-
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 79a1e76c7e7..4dbdf41abf0 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -77,6 +77,7 @@
Analytic Accountsir.actions.act_windowaccount.analytic.account
+ {}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..f1f1aee7d41 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'):
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..be1e0aac402 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
@@ -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_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_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_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/invoice.py b/addons/account_voucher/invoice.py
index 03a3e5fab67..c11f9d532e9 100644
--- a/addons/account_voucher/invoice.py
+++ b/addons/account_voucher/invoice.py
@@ -41,6 +41,7 @@ class invoice(osv.osv):
'target': 'new',
'domain': '[]',
'context': {
+ 'payment_expected_currency': inv.currency_id.id,
'default_partner_id': self.pool.get('res.partner')._find_accounting_partner(inv.partner_id).id,
'default_amount': inv.type in ('out_refund', 'in_refund') and -inv.residual or inv.residual,
'default_reference': inv.name,
diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml
index c9270dc695c..2cd612affc7 100644
--- a/addons/account_voucher/test/account_voucher.yml
+++ b/addons/account_voucher/test/account_voucher.yml
@@ -6,7 +6,7 @@
account_id: account.cash
amount: 1000.0
company_id: base.main_company
- journal_id: account.bank_journal
+ journal_id: account.sales_journal
name: Voucher for Axelor
narration: Basic Pc
line_cr_ids:
diff --git a/addons/account_voucher/test/case1_usd_usd_payment_rate.yml b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
new file mode 100644
index 00000000000..037fc1497ec
--- /dev/null
+++ b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
@@ -0,0 +1,247 @@
+-
+ In order to check the Account_voucher module with multi-currency in OpenERP,
+ I create 2 Invoices in USD and make 1 Payment in USD based on the currency rating given by the bank which is slightly different that the one encoded in OpenERP
+-
+ I set the income and expense currency accounts on the main company
+-
+ !python {model: res.company}: |
+ from datetime import datetime
+ vals = {
+ 'income_currency_exchange_account_id': ref('account.o_expense'),
+ 'expense_currency_exchange_account_id': ref('account.o_expense')}
+ self.write(cr, uid, ref('base.main_company'), vals)
+-
+ I create currency USD in OpenERP for January of 1.333333 Rate
+-
+ !python {model: res.currency.rate}: |
+ from datetime import datetime
+ curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0]
+ date = '%s-01-01' %(datetime.now().year)
+ ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)])
+ self.write(cr, uid, ids, {'rate': 1.333333})
+-
+ I create currency USD in OpenERP for February of 1.250000 Rate
+-
+ !record {model: res.currency.rate, id: feb_usd}:
+ currency_id: base.USD
+ name: !eval "'%s-02-01' %(datetime.now().year)"
+ rate: 1.250000
+
+-
+ I create currency USD in OpenERP for March of 1.111111 Rate
+-
+ !record {model: res.currency.rate, id: mar_usd}:
+ currency_id: base.USD
+ name: !eval "'%s-03-01' %(datetime.now().year)"
+ rate: 1.111111
+
+-
+ I create currency USD in OpenERP for April of 1.052632 Rate
+-
+ !record {model: res.currency.rate, id: apr_usd}:
+ currency_id: base.USD
+ name: !eval "'%s-04-01' %(datetime.now().year)"
+ rate: 1.052632
+
+-
+ I create a cash account with currency USD
+-
+ !record {model: account.account, id: account_cash_usd_id}:
+ currency_id: base.USD
+ name: "cash account in usd"
+ code: "Xcash usd"
+ type: 'liquidity'
+ user_type: "account.data_account_type_cash"
+
+-
+ I create a bank journal with USD as currency
+-
+ !record {model: account.journal, id: bank_journal_USD}:
+ name: Bank Journal(USD)
+ code: BUSD
+ type: bank
+ analytic_journal_id: account.sit
+ sequence_id: account.sequence_bank_journal
+ default_debit_account_id: account_cash_usd_id
+ default_credit_account_id: account_cash_usd_id
+ currency: base.USD
+ company_id: base.main_company
+
+-
+ I create a new partner Kate Mc Kay
+-
+ !record {model: res.partner, id: res_partner_mc_kay}:
+ name: "Mc Kay Kate"
+ property_account_receivable: account.a_recv
+ property_account_payable: account.a_pay
+-
+ I create the first invoice on 1st January for 200 USD
+-
+ !record {model: account.invoice, id: account_invoice_jan_payment_rate}:
+ account_id: account.a_recv
+ company_id: base.main_company
+ currency_id: base.USD
+ date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
+ period_id: account.period_1
+ invoice_line:
+ - account_id: account.a_sale
+ name: '[PCSC234] PC Assemble SC234'
+ price_unit: 200.0
+ quantity: 1.0
+ product_id: product.product_product_3
+ uos_id: product.product_uom_unit
+ journal_id: account.sales_journal
+ partner_id: res_partner_mc_kay
+ reference_type: none
+-
+ I Validate invoice by clicking on Validate button
+-
+ !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_jan_payment_rate}
+-
+ I check that first invoice move is correct for debtor account (debit - credit == 150.0)
+-
+ !python {model: account.invoice}: |
+ invoice_id = self.browse(cr, uid, ref("account_invoice_jan_payment_rate"))
+ assert invoice_id.move_id, "Move not created for open invoice"
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
+ move_line = move_line_obj.browse(cr, uid, move_lines[0])
+ assert (move_line.debit - move_line.credit == 150.0), "Invoice move is not correct for debtors account"
+-
+ I create the second invoice on 1st February for 100 USD
+-
+ !record {model: account.invoice, id: account_invoice_feb_payment_rate}:
+ account_id: account.a_recv
+ company_id: base.main_company
+ currency_id: base.USD
+ date_invoice: !eval "'%s-02-01' %(datetime.now().year)"
+ period_id: account.period_2
+ invoice_line:
+ - account_id: account.a_sale
+ name: '[PCSC234] PC Assemble SC234'
+ price_unit: 100.0
+ quantity: 1.0
+ product_id: product.product_product_3
+ uos_id: product.product_uom_unit
+ journal_id: account.sales_journal
+ partner_id: res_partner_mc_kay
+ reference_type: none
+-
+ I Validate invoice by clicking on Validate button
+-
+ !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_feb_payment_rate}
+-
+ I check that second invoice move is correct for debtor account (debit - credit == 80)
+-
+ !python {model: account.invoice}: |
+ invoice_id = self.browse(cr, uid, ref("account_invoice_feb_payment_rate"))
+ assert invoice_id.move_id, "Move not created for open invoice"
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
+ move_line = move_line_obj.browse(cr, uid, move_lines[0])
+ assert (move_line.debit - move_line.credit == 80), "Invoice move is not correct for debtors account"
+
+-
+ I set the context that will be used for the encoding of all the vouchers of this file
+-
+ !context
+ 'type': 'receipt'
+-
+ On the first March, I create the first voucher of payment with values 240 USD, journal USD, and specifying that $1 = 0.8€
+-
+ !record {model: account.voucher, id: account_voucher_1_case1_payment_rate, view: view_vendor_receipt_form}:
+ account_id: account.cash
+ amount: 240.0
+ company_id: base.main_company
+ journal_id: bank_journal_USD
+ name: 'Payment: Case 1 USD/USD payment rate'
+ partner_id: res_partner_mc_kay
+ period_id: account.period_3
+ date: !eval time.strftime("%Y-03-01")
+ payment_option: 'with_writeoff'
+ writeoff_acc_id: account.a_expense
+ comment: 'Write Off'
+ payment_rate: 0.8
+ payment_rate_currency_id: base.EUR
+
+-
+ I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$>
+-
+ !python {model: account.voucher}: |
+ vals = {}
+ voucher_id = self.browse(cr, uid, ref('account_voucher_1_case1_payment_rate'))
+ data = []
+ for item in voucher_id.line_cr_ids:
+ if item.amount_unreconciled == 200.00:
+ data += [(item.id, 180.0)]
+ else:
+ data += [(item.id, 70.0)]
+ for line_id, amount in data:
+ self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount})
+ assert (voucher_id.state=='draft'), "Voucher is not in draft state"
+-
+ I check that writeoff amount computed is -10.0
+-
+ !python {model: account.voucher}: |
+ voucher = ref('account_voucher_1_case1_payment_rate')
+ voucher_id = self.browse(cr, uid, voucher)
+ assert (voucher_id.writeoff_amount == -10.0), "Writeoff amount is not -10.0"
+-
+ I confirm the voucher
+-
+ !python {model: account.voucher}: |
+ voucher = ref('account_voucher_1_case1_payment_rate')
+ self.signal_proforma_voucher(cr, uid, [voucher])
+-
+ I check that the move of my first voucher is valid
+-
+ !python {model: account.voucher}: |
+ voucher = ref('account_voucher_1_case1_payment_rate')
+ voucher_id = self.browse(cr, uid, voucher)
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
+ for move_line in move_line_obj.browse(cr, uid, move_lines):
+ assert move_line.state == 'valid', "Voucher move is not valid"
+-
+ I check that my debtor account is correct
+-
+ I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 144 and 56
+-
+ I check that my write-off is correct. 8 debit and 10 amount_currency
+-
+ !python {model: account.voucher}: |
+ voucher = ref('account_voucher_1_case1_payment_rate')
+ voucher_id = self.browse(cr, uid, voucher)
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
+ for move_line in move_line_obj.browse(cr, uid, move_lines):
+ if move_line.amount_currency == -180.00:
+ assert move_line.credit == 144.00, "Debtor account has wrong entry."
+ elif move_line.amount_currency == -70.00:
+ assert move_line.credit == 56.00, "Debtor account has wrong entry."
+ elif move_line.amount_currency == 10.00:
+ assert move_line.debit == 8.00, "Writeoff amount is wrong: Got a debit of %s (expected 8,00€)" % (move_line.debit)
+ elif move_line.amount_currency == 240.00:
+ assert move_line.debit == 192.00, "Bank entry is wrong."
+ else:
+ assert False, "Unrecognized journal entry"
+-
+ I check the residual amount of Invoice1, should be 20 in amount_currency and 6 in amount_residual
+-
+ !python {model: account.invoice}: |
+ invoice_id = self.browse(cr, uid, ref("account_invoice_jan_payment_rate"))
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
+ move_line = move_line_obj.browse(cr, uid, move_lines[0])
+ assert (move_line.amount_residual == 6.0) , "Residual amount is not correct for first Invoice"
+ assert (move_line.amount_residual_currency == 20.0) , "Residual amount in currency is not correct for first Invoice"
+-
+ I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual
+-
+ !python {model: account.invoice}: |
+ invoice_id = self.browse(cr, uid, ref("account_invoice_feb_payment_rate"))
+ move_line_obj = self.pool.get('account.move.line')
+ move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
+ move_line = move_line_obj.browse(cr, uid, move_lines[0])
+ assert (move_line.amount_residual == 24.0) , "Residual amount is not correct for second Invoice"
+ assert (move_line.amount_residual_currency == 30.0) , "Residual amount in currency is not correct for second Invoice"
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
index 02dd82f5c14..f523e312933 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
@@ -201,7 +201,7 @@
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 55.56 and move_line.amount_residual == 20) , "Residual amount is not correct for first Invoice"
+ assert (move_line.amount_residual_currency == 55.56 and move_line.amount_residual == 20) , "Residual amount is not correct for first Invoice. Got %s USD (%s EUR)" %(move_line.amount_residual_currency, move_line.amount_residual)
-
I check the residual amuont of Invoice2, should be 22.22 in residual currency and 10 in amount_residual
-
diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml
index a0ef13d96aa..90c36e371bf 100644
--- a/addons/account_voucher/test/case4_cad_chf.yml
+++ b/addons/account_voucher/test/case4_cad_chf.yml
@@ -161,7 +161,7 @@
-
I check that the debtor account has 1 new line with -298.78 as amount_currency columns and 149.39 of credit and currency is CAD.
-
- I check that my currency rate difference is correct. 0 in debit with no amount_currency
+ I check that my currency rate difference is correct. 0 in debit with 98.78 CAD as amount_currency
-
I check that my writeoff is correct. 11.05 credit and -13.26 amount_currency
-
@@ -176,7 +176,8 @@
elif move_line.amount_currency == -298.78:
assert move_line.credit == 149.39, "Debtor account has wrong entry."
elif move_line.debit == 0.00 and move_line.credit == 0.00:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
+ assert move_line.amount_currency == 98.78, "Incorrect Currency Difference, got %s as amount_currency (expected 98.78)." % (move_line.amount_currency)
+ assert move_line.currency_id.id == ref('base.CAD'), "Incorrect Currency Difference, got %s (expected 'CAD')" % (move_line.currency_id.name)
elif move_line.credit == 10.61:
assert move_line.amount_currency == -13.26, "Writeoff amount is wrong."
else:
diff --git a/addons/account_voucher/test/case_eur_usd.yml b/addons/account_voucher/test/case_eur_usd.yml
index 94f0c718980..8dce677fd9a 100644
--- a/addons/account_voucher/test/case_eur_usd.yml
+++ b/addons/account_voucher/test/case_eur_usd.yml
@@ -41,7 +41,7 @@
currency: base.USD
company_id: base.main_company
-
- I create an invoice
+ On the first of January, I create an invoice of 1000€
-
!record {model: account.invoice, id: account_invoice_eur_usd}:
account_id: account.a_recv
@@ -79,7 +79,7 @@
!context
'type': 'receipt'
-
- I create the voucher of payment with values 1350 USD, journal USD,
+ On the first of February, I create the voucher of payment with values 1350 USD, journal USD,
-
!record {model: account.voucher, id: account_voucher_eur_usd_case, view: view_vendor_receipt_form}:
account_id: account.cash
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 109c2f9aec9..dea94d59f4e 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -46,6 +46,9 @@
+
+
+
account.voucher.payment.low.priority.formaccount.voucher
@@ -107,7 +110,7 @@
-
+
@@ -119,6 +122,7 @@
+
account.voucher.payment.formaccount.voucher
@@ -157,7 +161,7 @@
-
+
-
+
-
-
+
+
-
-
-
+
+
@@ -237,6 +244,7 @@
on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"
groups="account.group_account_user"/>
+
diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py
index 025f1f79f70..0477efa5b1f 100644
--- a/addons/anonymization/anonymization.py
+++ b/addons/anonymization/anonymization.py
@@ -543,6 +543,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
fixes = group(fixes, ('model_name', 'field_name'))
for line in data:
+ queries = []
table_name = self.pool[line['model_id']]._table if line['model_id'] in self.pool else None
# check if custom sql exists:
diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.eot b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.eot
old mode 100755
new mode 100644
diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.svg b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.svg
old mode 100755
new mode 100644
diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.ttf b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.ttf
old mode 100755
new mode 100644
diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.woff b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.woff
old mode 100755
new mode 100644
diff --git a/addons/auth_openid/res_users.py b/addons/auth_openid/res_users.py
index 47e119f2a1e..897dea07982 100644
--- a/addons/auth_openid/res_users.py
+++ b/addons/auth_openid/res_users.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
##############################################################################
#
# OpenERP, Open Source Management Solution
diff --git a/addons/auth_openid/utils.py b/addons/auth_openid/utils.py
index 806198f99c2..0474e23fe4b 100644
--- a/addons/auth_openid/utils.py
+++ b/addons/auth_openid/utils.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
##############################################################################
#
# OpenERP, Open Source Management Solution
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_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/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml
index c788872b47e..703b4ebb254 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',
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 4e5dee5ae34..701a9671fee 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -23,8 +23,9 @@ from openerp.addons.base_status.base_stage import base_stage
import crm
from datetime import datetime
from operator import itemgetter
-from openerp.osv import fields, osv
+from openerp.osv import fields, osv, orm
import time
+from openerp import SUPERUSER_ID
from openerp import tools
from openerp.tools.translate import _
from openerp.tools import html2plaintext
@@ -980,15 +981,18 @@ class crm_lead(base_stage, format_address, osv.osv):
def message_get_reply_to(self, cr, uid, ids, context=None):
""" Override to get the reply_to of the parent project. """
return [lead.section_id.message_get_reply_to()[0] if lead.section_id else False
- for lead in self.browse(cr, uid, ids, context=context)]
+ for lead in self.browse(cr, SUPERUSER_ID, ids, context=context)]
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
recipients = super(crm_lead, self).message_get_suggested_recipients(cr, uid, ids, context=context)
- for lead in self.browse(cr, uid, ids, context=context):
- if lead.partner_id:
- self._message_add_suggested_recipient(cr, uid, recipients, lead, partner=lead.partner_id, reason=_('Customer'))
- elif lead.email_from:
- self._message_add_suggested_recipient(cr, uid, recipients, lead, email=lead.email_from, reason=_('Customer Email'))
+ try:
+ for lead in self.browse(cr, uid, ids, context=context):
+ if lead.partner_id:
+ self._message_add_suggested_recipient(cr, uid, recipients, lead, partner=lead.partner_id, reason=_('Customer'))
+ elif lead.email_from:
+ self._message_add_suggested_recipient(cr, uid, recipients, lead, email=lead.email_from, reason=_('Customer Email'))
+ except (osv.except_osv, orm.except_orm): # no read access rights -> just ignore suggested recipients because this imply modifying followers
+ pass
return recipients
def message_new(self, cr, uid, msg, custom_values=None, context=None):
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index 2226b4ac895..7ee3287fd75 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -12,6 +12,7 @@
{
'default_type':'lead',
'stage_type':'lead',
+ 'needaction_menu_ref': 'crm.menu_crm_opportunities',
'search_default_unassigned':1,
}
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 62090dd0efc..225b2ffc292 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -556,7 +556,7 @@
- 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/email_template/email_template.py b/addons/email_template/email_template.py
index 00285ebcd91..4a767457321 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -382,6 +382,7 @@ class email_template(osv.osv):
attachment_ids = values.pop('attachment_ids', [])
attachments = values.pop('attachments', [])
msg_id = mail_mail.create(cr, uid, values, context=context)
+ mail = mail_mail.browse(cr, uid, msg_id, context=context)
# manage attachments
for attachment in attachments:
@@ -390,7 +391,7 @@ class email_template(osv.osv):
'datas_fname': attachment[0],
'datas': attachment[1],
'res_model': 'mail.message',
- 'res_id': msg_id,
+ 'res_id': mail.mail_message_id.id,
}
context.pop('default_type', None)
attachment_ids.append(ir_attachment.create(cr, uid, attachment_data, context=context))
diff --git a/addons/email_template/html2text.py b/addons/email_template/html2text.py
old mode 100644
new mode 100755
diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml
index 46ed49e6627..3cb83896ca2 100644
--- a/addons/email_template/wizard/mail_compose_message_view.xml
+++ b/addons/email_template/wizard/mail_compose_message_view.xml
@@ -28,7 +28,7 @@
Use template
+ on_change="onchange_template_id(template_id, composition_mode, model, res_id, context)" domain="[('model_id.model','=',model)]"/>
diff --git a/addons/mail/tests/test_mail_features.py b/addons/mail/tests/test_mail_features.py
index 7eea66b3b90..e1bef837010 100644
--- a/addons/mail/tests/test_mail_features.py
+++ b/addons/mail/tests/test_mail_features.py
@@ -116,18 +116,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 +183,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])
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/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/pad/py_etherpad/__init__.py b/addons/pad/py_etherpad/__init__.py
index 6af310b48aa..0db607fe16f 100644
--- a/addons/pad/py_etherpad/__init__.py
+++ b/addons/pad/py_etherpad/__init__.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
"""Module to talk to EtherpadLite API."""
import json
diff --git a/addons/pad/static/src/css/etherpad.css b/addons/pad/static/src/css/etherpad.css
index ad47be32b02..a0002ebe97c 100644
--- a/addons/pad/static/src/css/etherpad.css
+++ b/addons/pad/static/src/css/etherpad.css
@@ -43,7 +43,7 @@
z-index: 1000;
}
-.oe_pad.oe_configured .oe_pad_content.oe_editing{
+.oe_pad .oe_pad_content.oe_editing{
border: solid 1px #c4c4c4;
height:500px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
@@ -53,7 +53,7 @@
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
-.oe_pad.oe_configured.oe_pad_fullscreen .oe_pad_content {
+.oe_pad.oe_pad_fullscreen .oe_pad_content {
height: 100%;
border: none;
-webkit-box-shadow: none;
@@ -63,7 +63,7 @@
box-shadow: none;
}
-.oe_pad.oe_unconfigured > p {
+.oe_pad .oe_unconfigured {
text-align: center;
opacity: 0.75;
}
diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js
index 1a2de41745b..ba5ee3a3037 100644
--- a/addons/pad/static/src/js/pad.js
+++ b/addons/pad/static/src/js/pad.js
@@ -9,6 +9,7 @@ openerp.pad = function(instance) {
this.on("change:configured", this, this.switch_configured);
},
initialize_content: function() {
+ var self = this;
this.switch_configured();
this.$('.oe_pad_switch').click(function() {
self.$el.toggleClass('oe_pad_fullscreen');
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index c278db2f19a..fc6c874fab5 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -110,7 +110,7 @@ class plugin_handler(osv.osv_memory):
model_obj.message_post(cr, uid, [res_id],
body=msg.get('body'),
subject=msg.get('subject'),
- type='email',
+ type='comment' if model == 'res.partner' else 'email',
parent_id=msg.get('parent_id'),
attachments=msg.get('attachments'))
notify = _("Mail successfully pushed")
diff --git a/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh b/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh
index e1103b30acf..5ca7a5a934a 100755
--- a/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh
+++ b/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
make clean
make
cp ../openerp_plugin.xpi /home/openerp/
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/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_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..e7026986ea4 100644
--- a/addons/portal/__init__.py
+++ b/addons/portal/__init__.py
@@ -21,6 +21,7 @@
import portal
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..967822c7d60 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 _
@@ -35,21 +34,14 @@ class mail_mail(osv.Model):
:param partner: browse_record of the specific recipient partner
:return: the resulting body_html
"""
+ 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)
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/tests/test_portal.py b/addons/portal/tests/test_portal.py
index 07becf5cdd9..e96cbc263f6 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,28 @@ 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_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_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_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/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/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/project.py b/addons/project/project.py
index 8d7f09f8c4e..5d5abce3066 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -198,8 +198,12 @@ class project(osv.osv):
return res
def _task_count(self, cr, uid, ids, field_name, arg, context=None):
+ if context is None:
+ context = {}
res = dict.fromkeys(ids, 0)
- task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)])
+ ctx = context.copy()
+ ctx['active_test'] = False
+ task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)], context=ctx)
for task in self.pool.get('project.task').browse(cr, uid, task_ids, context):
res[task.project_id.id] += 1
return res
@@ -210,7 +214,7 @@ class project(osv.osv):
def _get_visibility_selection(self, cr, uid, context=None):
""" Overriden in portal_project to offer more options """
- return [('public', 'All Users'),
+ return [('public', 'Public'),
('employees', 'Employees Only'),
('followers', 'Followers Only')]
@@ -275,7 +279,17 @@ class project(osv.osv):
"with Tasks (or optionally Issues if the Issue Tracker module is installed)."),
'alias_model': fields.selection(_alias_models, "Alias Model", select=True, required=True,
help="The kind of document created when an email is received on this project's email alias"),
- 'privacy_visibility': fields.selection(_visibility_selection, 'Privacy / Visibility', required=True),
+ 'privacy_visibility': fields.selection(_visibility_selection, 'Privacy / Visibility', required=True,
+ help="Holds visibility of the tasks or issues that belong to the current project:\n"
+ "- Public: everybody sees everything; if portal is activated, portal users\n"
+ " see all tasks or issues; if anonymous portal is activated, visitors\n"
+ " see all tasks or issues\n"
+ "- Portal (only available if Portal is installed): employees see everything;\n"
+ " if portal is activated, portal users see the tasks or issues followed by\n"
+ " them or by someone of their company\n"
+ "- Employees Only: employees see all tasks or issues\n"
+ "- Followers Only: employees see only the followed tasks or issues; if portal\n"
+ " is activated, portal users see the followed tasks or issues."),
'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','Pending'),('close','Closed')], 'Status', required=True,),
'doc_count':fields.function(_get_attached_docs, string="Number of documents attached", type='int')
}
@@ -293,7 +307,7 @@ class project(osv.osv):
'sequence': 10,
'type_ids': _get_type_common,
'alias_model': 'project.task',
- 'privacy_visibility': 'public',
+ 'privacy_visibility': 'employees',
}
# TODO: Why not using a SQL contraints ?
@@ -612,7 +626,8 @@ class task(base_stage, osv.osv):
search_domain = []
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
if project_id:
- search_domain += [('project_ids', '=', project_id)]
+ search_domain += ['|', ('project_ids', '=', project_id)]
+ search_domain += [('id', 'in', ids)]
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
# restore order of the search
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index f5fbf878fd0..b7dcc2bdb83 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -62,7 +62,7 @@
E-Learning Integrationproject.task
- public
+ employees
@@ -76,6 +76,7 @@
Website Design Templatesproject.task
+ employees
@@ -89,6 +90,7 @@
Data Import/Export Pluginproject.task
+ followers
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 0d2c139ce86..eb042e5f0c7 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -52,7 +52,8 @@
kanban,tree,form,calendar,gantt,graph{
'search_default_project_id': [active_id],
- 'default_project_id': active_id,
+ 'default_project_id': active_id,
+ 'active_test': False,
}
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index 4bbaa9b788e..e674019443b 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -75,15 +75,13 @@
- Project/Task: employees: public or employee or following or assigned
+ Project/Task: employees: public or employee or (followers and following)['|',
- ('user_id', '=', user.id),
- '|',
- ('project_id.privacy_visibility', 'in', ['public', 'employees']),
- '&',
- ('project_id.privacy_visibility', '=', 'followers'),
- ('message_follower_ids', 'in', [user.partner_id.id]),
+ ('project_id.privacy_visibility', 'in', ['public', 'employees']),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.partner_id.id]),
]
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index 1467ce55fab..4bfd5b783c7 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -106,6 +106,8 @@
+
+
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 517d335aa48..a008c670138 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -495,10 +495,10 @@ class project_issue(base_stage, osv.osv):
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
recipients = super(project_issue, self).message_get_suggested_recipients(cr, uid, ids, context=context)
for issue in self.browse(cr, uid, ids, context=context):
- if issue.partner_id:
- self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer'))
- elif issue.email_from:
+ if issue.email_from:
self._message_add_suggested_recipient(cr, uid, recipients, issue, email=issue.email_from, reason=_('Customer Email'))
+ elif issue.partner_id:
+ self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer'))
return recipients
def message_new(self, cr, uid, msg, custom_values=None, context=None):
diff --git a/addons/project_issue/security/project_issue_security.xml b/addons/project_issue/security/project_issue_security.xml
index 5215a94a8b7..c8ed12086e4 100644
--- a/addons/project_issue/security/project_issue_security.xml
+++ b/addons/project_issue/security/project_issue_security.xml
@@ -10,15 +10,13 @@
- Project/Issue: employees: public or employee or following or assigned
+ Project/Issue: employees: public or employee or (followers and following)['|',
- '|',
- ('project_id.privacy_visibility', 'in', ['public', 'employees']),
- '&',
- ('project_id.privacy_visibility', '=', 'followers'),
- ('message_follower_ids', 'in', [user.id]),
- ('user_id', '=', user.id),
+ ('project_id.privacy_visibility', 'in', ['public', 'employees']),
+ '&',
+ ('project_id.privacy_visibility', '=', 'followers'),
+ ('message_follower_ids', 'in', [user.id]),
]
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 26e34048b40..849e558563a 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -640,7 +640,7 @@ class purchase_order(osv.osv):
'product_uom': order_line.product_uom.id,
'product_uos': order_line.product_uom.id,
'date': self.date_to_datetime(cr, uid, order.date_order, context),
- 'date_expected': self.date_to_datetime(cr, uid, order.date_order, context),
+ 'date_expected': self.date_to_datetime(cr, uid, order_line.date_planned, context),
'location_id': order.partner_id.property_stock_supplier.id,
'location_dest_id': order.location_id.id,
'picking_id': picking_id,
@@ -952,7 +952,8 @@ class purchase_order_line(osv.osv):
lang = res_partner.browse(cr, uid, partner_id).lang
context_partner.update( {'lang': lang, 'partner_id': partner_id} )
product = product_product.browse(cr, uid, product_id, context=context_partner)
- name = product.name
+ #call name_get() with partner in the context to eventually match name and description in the seller_ids field
+ dummy, name = product_product.name_get(cr, uid, product_id, context=context_partner)[0]
if product.description_purchase:
name += '\n' + product.description_purchase
res['value'].update({'name': name})
diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml
old mode 100755
new mode 100644
diff --git a/addons/purchase_requisition/test/purchase_requisition_demo.yml b/addons/purchase_requisition/test/purchase_requisition_demo.yml
old mode 100755
new mode 100644
diff --git a/addons/report_webkit/__init__.py b/addons/report_webkit/__init__.py
index 2c23fd8ed90..e00289407d8 100644
--- a/addons/report_webkit/__init__.py
+++ b/addons/report_webkit/__init__.py
@@ -25,7 +25,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/report_webkit/__openerp__.py b/addons/report_webkit/__openerp__.py
index b962669eee9..f4035a951de 100644
--- a/addons/report_webkit/__openerp__.py
+++ b/addons/report_webkit/__openerp__.py
@@ -25,7 +25,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/report_webkit/company.py b/addons/report_webkit/company.py
index f9ae4191528..b29354938de 100644
--- a/addons/report_webkit/company.py
+++ b/addons/report_webkit/company.py
@@ -25,7 +25,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/report_webkit/convert.py b/addons/report_webkit/convert.py
index b4d42325bb6..e30209a77dc 100644
--- a/addons/report_webkit/convert.py
+++ b/addons/report_webkit/convert.py
@@ -25,7 +25,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/report_webkit/header.py b/addons/report_webkit/header.py
index 9713efc5382..7a290662498 100644
--- a/addons/report_webkit/header.py
+++ b/addons/report_webkit/header.py
@@ -25,7 +25,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/report_webkit/ir_report.py b/addons/report_webkit/ir_report.py
index 4b64a54c420..cea2b4e8329 100644
--- a/addons/report_webkit/ir_report.py
+++ b/addons/report_webkit/ir_report.py
@@ -25,7 +25,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/report_webkit/report_helper.py b/addons/report_webkit/report_helper.py
index af9408b834e..83286dc59bd 100644
--- a/addons/report_webkit/report_helper.py
+++ b/addons/report_webkit/report_helper.py
@@ -25,7 +25,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/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py
index 3d8e41c42ff..82061daa758 100644
--- a/addons/report_webkit/webkit_report.py
+++ b/addons/report_webkit/webkit_report.py
@@ -26,7 +26,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/report_webkit/wizard/__init__.py b/addons/report_webkit/wizard/__init__.py
index e8ae8b79fc0..e95244cc7aa 100644
--- a/addons/report_webkit/wizard/__init__.py
+++ b/addons/report_webkit/wizard/__init__.py
@@ -25,7 +25,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/report_webkit/wizard/report_webkit_actions.py b/addons/report_webkit/wizard/report_webkit_actions.py
index 5f91d05d671..e22e7948d59 100644
--- a/addons/report_webkit/wizard/report_webkit_actions.py
+++ b/addons/report_webkit/wizard/report_webkit_actions.py
@@ -25,7 +25,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/resource/faces/observer.py b/addons/resource/faces/observer.py
index 894345230ea..28ae58eb2b6 100644
--- a/addons/resource/faces/observer.py
+++ b/addons/resource/faces/observer.py
@@ -22,7 +22,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
#@-node:<< Copyright >>
diff --git a/addons/resource/faces/pcalendar.py b/addons/resource/faces/pcalendar.py
index c82c49d4816..24c974233d8 100644
--- a/addons/resource/faces/pcalendar.py
+++ b/addons/resource/faces/pcalendar.py
@@ -22,7 +22,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
#@-node:<< Copyright >>
diff --git a/addons/resource/faces/plocale.py b/addons/resource/faces/plocale.py
index 61bfa91917b..908fd1252e9 100644
--- a/addons/resource/faces/plocale.py
+++ b/addons/resource/faces/plocale.py
@@ -17,7 +17,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
import gettext
diff --git a/addons/resource/faces/resource.py b/addons/resource/faces/resource.py
index 3451806444e..faee8174994 100644
--- a/addons/resource/faces/resource.py
+++ b/addons/resource/faces/resource.py
@@ -22,7 +22,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
#@-node:<< Copyright >>
diff --git a/addons/resource/faces/task.py b/addons/resource/faces/task.py
index 7516f41db2a..961f6213d1d 100644
--- a/addons/resource/faces/task.py
+++ b/addons/resource/faces/task.py
@@ -22,7 +22,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
#@-node:<< Copyright >>
diff --git a/addons/resource/faces/timescale.py b/addons/resource/faces/timescale.py
index 3e7c3c1dc89..818c031b7d5 100644
--- a/addons/resource/faces/timescale.py
+++ b/addons/resource/faces/timescale.py
@@ -17,7 +17,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
import faces.pcalendar as pcal
diff --git a/addons/resource/faces/utils.py b/addons/resource/faces/utils.py
index 54985767613..6568c314fb5 100644
--- a/addons/resource/faces/utils.py
+++ b/addons/resource/faces/utils.py
@@ -17,7 +17,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.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
############################################################################
import observer
diff --git a/addons/resource/resource.py b/addons/resource/resource.py
index 944c90a3749..449fa422ab4 100644
--- a/addons/resource/resource.py
+++ b/addons/resource/resource.py
@@ -25,6 +25,7 @@ from dateutil import rrule
import math
from faces import *
from openerp.osv import fields, osv
+from openerp.tools.float_utils import float_compare
from openerp.tools.translate import _
from itertools import groupby
@@ -108,11 +109,11 @@ class resource_calendar(osv.osv):
result = []
maxrecur = 100
current_hour = dt_from.hour
- while (todo>0) and maxrecur:
+ while float_compare(todo, 0, 4) and maxrecur:
cr.execute("select hour_from,hour_to from resource_calendar_attendance where dayofweek='%s' and calendar_id=%s order by hour_from desc", (dt_from.weekday(),id))
for (hour_from,hour_to) in cr.fetchall():
leave_flag = False
- if (hour_from0):
+ if (hour_fromtodo:
hour_from = m-todo
@@ -161,10 +162,10 @@ class resource_calendar(osv.osv):
result = []
maxrecur = 100
current_hour = dt_from.hour
- while (todo>0) and maxrecur:
+ while float_compare(todo, 0, 4) and maxrecur:
for (hour_from,hour_to) in [(item['hour_from'], item['hour_to']) for item in hours_by_cal[id] if item['dayofweek'] == str(dt_from.weekday())]:
leave_flag = False
- if (hour_to>current_hour) and (todo>0):
+ if (hour_to>current_hour) and float_compare(todo, 0, 4):
m = max(hour_from, current_hour)
if (hour_to-m)>todo:
hour_to = m+todo
diff --git a/addons/sale/res_partner_view.xml b/addons/sale/res_partner_view.xml
index 40ac119fdee..5107f0c17af 100644
--- a/addons/sale/res_partner_view.xml
+++ b/addons/sale/res_partner_view.xml
@@ -69,27 +69,15 @@
Falsesale.group_delivery_invoice_address
-
+
+ Falsesale.group_delivery_invoice_address
-
- False
- sale.group_delivery_invoice_address
-
-
- False
- sale.group_delivery_invoice_address
-
-
- False
- sale.group_delivery_invoice_address
-
-
- False
- sale.group_delivery_invoice_address
-
-
+ Falsesale.group_delivery_invoice_address
diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py
index 83b953cc4d5..3b04319f5c7 100644
--- a/addons/sale/wizard/sale_line_invoice.py
+++ b/addons/sale/wizard/sale_line_invoice.py
@@ -21,6 +21,7 @@
from openerp.osv import osv, fields
from openerp.tools.translate import _
+from openerp import netsvc
class sale_order_line_make_invoice(osv.osv_memory):
_name = "sale.order.line.make.invoice"
@@ -80,6 +81,7 @@ class sale_order_line_make_invoice(osv.osv_memory):
sales_order_line_obj = self.pool.get('sale.order.line')
sales_order_obj = self.pool.get('sale.order')
+ wf_service = netsvc.LocalService('workflow')
for line in sales_order_line_obj.browse(cr, uid, context.get('active_ids', []), context=context):
if (not line.invoiced) and (line.state not in ('draft', 'cancel')):
if not line.order_id in invoices:
diff --git a/addons/sale_analytic_plans/sale_analytic_plans_view.xml b/addons/sale_analytic_plans/sale_analytic_plans_view.xml
index 3600d71b7d4..121efbdf12e 100644
--- a/addons/sale_analytic_plans/sale_analytic_plans_view.xml
+++ b/addons/sale_analytic_plans/sale_analytic_plans_view.xml
@@ -52,5 +52,17 @@
+
+ account.invoice.form.analytic.inherit
+ account.invoice
+
+
+
+
+
+
+
+
+
diff --git a/addons/sale_crm/sale_crm.py b/addons/sale_crm/sale_crm.py
index d0899729050..3172999c545 100644
--- a/addons/sale_crm/sale_crm.py
+++ b/addons/sale_crm/sale_crm.py
@@ -31,6 +31,12 @@ class sale_order(osv.osv):
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
}
+ def _prepare_invoice(self, cr, uid, order, lines, context=None):
+ invoice_vals = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context)
+ if order.section_id and order.section_id.id:
+ invoice_vals['section_id'] = order.section_id.id
+ return invoice_vals
+
class crm_case_section(osv.osv):
_inherit = 'crm.case.section'
diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml
index eab9d38bf10..31c0317969a 100644
--- a/addons/sale_crm/sale_crm_view.xml
+++ b/addons/sale_crm/sale_crm_view.xml
@@ -16,6 +16,11 @@
+
+
+ {'stage_type': 'opportunity', 'default_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'}
+
+
sale.order.inheritsale.order
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 764d9de453e..db73bae3b6c 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -29,7 +29,7 @@ from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import netsvc
from openerp import tools
-from openerp.tools import float_compare
+from openerp.tools import float_compare, DEFAULT_SERVER_DATETIME_FORMAT
import openerp.addons.decimal_precision as dp
import logging
_logger = logging.getLogger(__name__)
@@ -647,7 +647,7 @@ class stock_picking(osv.osv):
),
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
- 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
store=True, type='datetime', string='Max. Expected Date', select=2),
@@ -2323,7 +2323,6 @@ class stock_move(osv.osv):
'line_id': move_lines,
'ref': move.picking_id and move.picking_id.name})
-
def action_done(self, cr, uid, ids, context=None):
""" Makes the move done and if all moves are done, it will finish the picking.
@return:
@@ -2369,7 +2368,7 @@ class stock_move(osv.osv):
if todo:
self.action_confirm(cr, uid, todo, context=context)
- self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
+ self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
for id in move_ids:
wf_service.trg_trigger(uid, 'stock.move', id, cr)
@@ -2412,14 +2411,14 @@ class stock_move(osv.osv):
# or if it's the same as that of the secondary amount being posted.
account_obj = self.pool.get('account.account')
src_acct, dest_acct = account_obj.browse(cr, uid, [src_account_id, dest_account_id], context=context)
- src_main_currency_id = src_acct.company_id.currency_id.id
- dest_main_currency_id = dest_acct.company_id.currency_id.id
+ src_main_currency_id = src_acct.currency_id and src_acct.currency_id.id or src_acct.company_id.currency_id.id
+ dest_main_currency_id = dest_acct.currency_id and dest_acct.currency_id.id or dest_acct.company_id.currency_id.id
cur_obj = self.pool.get('res.currency')
if reference_currency_id != src_main_currency_id:
# fix credit line:
credit_line_vals['credit'] = cur_obj.compute(cr, uid, reference_currency_id, src_main_currency_id, reference_amount, context=context)
if (not src_acct.currency_id) or src_acct.currency_id.id == reference_currency_id:
- credit_line_vals.update(currency_id=reference_currency_id, amount_currency=reference_amount)
+ credit_line_vals.update(currency_id=reference_currency_id, amount_currency=-reference_amount)
if reference_currency_id != dest_main_currency_id:
# fix debit line:
debit_line_vals['debit'] = cur_obj.compute(cr, uid, reference_currency_id, dest_main_currency_id, reference_amount, context=context)
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 6097885175b..b1a1fa048be 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1262,8 +1262,8 @@
-
-
+
+