diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 284dba83a39..df3fb8a6455 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -1723,13 +1723,10 @@ class account_invoice_tax(osv.osv):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency = False
- factor = 1
- if ids:
- factor = self.read(cr, uid, ids[0], ['factor_tax'])['factor_tax']
if company_id:
company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0]
if currency_id and company_currency:
- amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*factor, context={'date': date_invoice or fields.date.context_today(self, cr, uid)}, round=False)
+ amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount, context={'date': date_invoice or fields.date.context_today(self, cr, uid)}, round=False)
return {'value': {'tax_amount': amount}}
_order = 'sequence'
diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py
index 6d5f4924968..4d2c10c8ccd 100644
--- a/addons/account/report/account_partner_ledger.py
+++ b/addons/account/report/account_partner_ledger.py
@@ -23,6 +23,7 @@ import time
import re
from openerp.report import report_sxw
from common_report_header import common_report_header
+from openerp import SUPERUSER_ID
from openerp.tools.translate import _
class third_party_ledger(report_sxw.rml_parse, common_report_header):
@@ -95,6 +96,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
if (data['model'] == 'res.partner') and ids:
PARTNER_REQUEST = "AND l.partner_id IN %s"
params += [tuple(ids)]
+ reconcile = "" if self.reconcil else "AND l.reconcile_id IS NULL "
self.cr.execute(
"SELECT DISTINCT l.partner_id " \
"FROM account_move_line AS l, account_account AS account, " \
@@ -103,12 +105,12 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
"AND l.account_id = account.id " \
"AND am.id = l.move_id " \
"AND am.state IN %s"
-# "AND " + self.query +" " \
+ "AND " + self.query +" " \
"AND l.account_id IN %s " \
" " + PARTNER_REQUEST + " " \
- "AND account.active ", params)
+ "AND account.active " + reconcile + " ", params)
self.partner_ids = [res['partner_id'] for res in self.cr.dictfetchall()]
- objects = obj_partner.browse(self.cr, self.uid, self.partner_ids)
+ objects = obj_partner.browse(self.cr, SUPERUSER_ID, self.partner_ids)
objects.sort(key=lambda x: (x.ref, x.name))
return super(third_party_ledger, self).set_context(objects, data, self.partner_ids, report_type)
diff --git a/addons/account/wizard/account_open_closed_fiscalyear.py b/addons/account/wizard/account_open_closed_fiscalyear.py
index f4e90ae9f2f..d676772dbbd 100644
--- a/addons/account/wizard/account_open_closed_fiscalyear.py
+++ b/addons/account/wizard/account_open_closed_fiscalyear.py
@@ -38,6 +38,9 @@ class account_open_closed_fiscalyear(osv.osv_memory):
if not period_journal:
raise osv.except_osv(_('Error!'), _("You have to set the 'End of Year Entries Journal' for this Fiscal Year which is set after generating opening entries from 'Generate Opening Entries'."))
+ if period_journal.period_id.state == 'done':
+ raise osv.except_osv(_('Error!'), _("You can not cancel closing entries if the 'End of Year Entries Journal' period is closed."))
+
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
if ids_move:
cr.execute('delete from account_move where id IN %s', (tuple(ids_move),))
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index 1baf41b5783..1a8ab9ca744 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -369,7 +369,7 @@ class mail_thread(osv.AbstractModel):
# auto_subscribe: take values and defaults into account
create_values = dict(values)
for key, val in context.iteritems():
- if key.startswith('default_'):
+ if key.startswith('default_') and key[8:] not in create_values:
create_values[key[8:]] = val
self.message_auto_subscribe(cr, uid, [thread_id], create_values.keys(), context=context, values=create_values)
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 35efd047fb0..e38f7ca25cb 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -512,23 +512,20 @@
- e.g: 1 * (reference unit) = ratio * (this unit) -
-- e.g: 1 * (this unit) = ratio * (reference unit) -
-+ e.g: 1 * (reference unit) = ratio * (this unit) +
++ e.g: 1 * (this unit) = ratio * (reference unit) +