diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2486d70c9e8..f6ae7995d0f 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1520,12 +1520,11 @@ class account_invoice_tax(models.Model): @api.multi def amount_change(self, amount, currency_id=False, company_id=False, date_invoice=False): - factor = self.factor_tax if self else 1 company = self.env['res.company'].browse(company_id) if currency_id and company.currency_id: currency = self.env['res.currency'].browse(currency_id) currency = currency.with_context(date=date_invoice or fields.Date.context_today(self)) - amount = currency.compute(amount * factor, company.currency_id, round=False) + amount = currency.compute(amount, company.currency_id, round=False) return {'value': {'tax_amount': amount}} @api.v8 diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 2ae71b6d45d..47c3a7f6512 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -24,7 +24,7 @@ from openerp.osv import osv from openerp.tools.translate import _ from openerp.report import report_sxw from common_report_header import common_report_header - +from openerp import SUPERUSER_ID class third_party_ledger(report_sxw.rml_parse, common_report_header): @@ -101,6 +101,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, " \ @@ -109,12 +110,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 = sorted(objects, 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 c142dcc3e21..a2f6b48d567 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 320e63858ec..e19de4c4c23 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -393,7 +393,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 9c3d4356f68..59ba1df1193 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -597,23 +597,20 @@ -