diff --git a/addons/account/account.py b/addons/account/account.py index bf072507aa0..ab3d065421f 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -155,6 +155,7 @@ class account_account_type(osv.osv): return res def _save_report_type(self, cr, uid, account_type_id, field_name, field_value, arg, context=None): + field_value = field_value or 'none' obj_data = self.pool.get('ir.model.data') obj_financial_report = self.pool.get('account.financial.report') #unlink if it exists somewhere in the financial reports related to BS or PL @@ -596,10 +597,7 @@ class account_account(osv.osv): return res def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): - if default is None: - default = {} - else: - default = default.copy() + default = {} if default is None else default.copy() if done_list is None: done_list = [] account = self.browse(cr, uid, id, context=context) @@ -781,10 +779,7 @@ class account_journal(osv.osv): ] def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): - if default is None: - default = {} - else: - default = default.copy() + default = {} if default is None else default.copy() if done_list is None: done_list = [] journal = self.browse(cr, uid, id, context=context) @@ -1185,6 +1180,7 @@ class account_fiscalyear(osv.osv): } def copy(self, cr, uid, id, default=None, context=None): + default = {} if default is None else default.copy() default.update({ 'period_ids': [], 'end_journal_period_id': False @@ -1444,14 +1440,8 @@ class account_move(osv.osv): return result def copy(self, cr, uid, id, default=None, context=None): - if context is None: - default = {} - else: - default = default.copy() - if context is None: - context = {} - else: - context = context.copy() + default = {} if default is None else default.copy() + context = {} if context is None else context.copy() default.update({ 'state':'draft', 'name':'/', diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 8b2a9aff257..549363ce269 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -461,9 +461,10 @@ class account_bank_statement(osv.osv): return {} balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context) - journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id'], context=context) + journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id', 'currency'], context=context) company_id = journal_data['company_id'] - return {'value': {'balance_start': balance_start, 'company_id': company_id}} + currency_id = journal_data['currency'] or self.pool.get('res.company').browse(cr, uid, company_id[0], context=context).currency_id.id + return {'value': {'balance_start': balance_start, 'company_id': company_id, 'currency': currency_id}} def unlink(self, cr, uid, ids, context=None): stat = self.read(cr, uid, ids, ['state'], context=context) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 3c2922ff141..8516fcd96ae 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -211,17 +211,17 @@ - +
- - + + - +
@@ -322,7 +322,7 @@ + options='{"always_reload": True}'/> @@ -368,16 +368,16 @@ - +
- - - + + +
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 1c40bebba52..d98b53ebbbd 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -633,13 +633,10 @@
+ - @@ -1130,8 +1127,8 @@ - - + + @@ -1177,8 +1174,8 @@ - - + + @@ -2567,7 +2564,7 @@ action = pool.get('res.config').next(cr, uid, [], context) - + @@ -2629,12 +2626,12 @@ action = pool.get('res.config').next(cr, uid, [], context) - - - + + + - + diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index 3fab306863c..520ee733e73 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -106,27 +106,27 @@ - - - - - + + + + + - - - - + + + + - + + + + + + diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 423026251c2..f97f3f6af3c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1070,7 +1070,8 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: if not line.move_line_id.amount_residual: raise osv.except_osv(_('Wrong bank statement line'),_("You have to delete the bank statement line which the payment was reconciled to manually. Please check the payment of the partner %s by the amount of %s.")%(line.voucher_id.partner_id.name, line.voucher_id.amount)) - currency_rate_difference = line.move_line_id.amount_residual - amount + sign = voucher_brw.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 = { diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 78b76e5c9b7..e1a48c6c535 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -136,11 +136,8 @@ -