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 8421409d4ce..8516fcd96ae 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -211,17 +211,17 @@ - +
- - + + - +
@@ -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/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 @@ - diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index d654078a055..c0516d09de3 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -166,6 +166,7 @@ class purchase_order(osv.osv): 'warehouse_id': fields.many2one('stock.warehouse', 'Destination Warehouse', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}), 'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]), 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."), + 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", readonly=True, required=True), 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True), 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}), 'validator' : fields.many2one('res.users', 'Validated by', readonly=True), @@ -246,6 +247,11 @@ class purchase_order(osv.osv): def button_dummy(self, cr, uid, ids, context=None): return True + def onchange_pricelist(self, cr, uid, ids, pricelist_id, context=None): + if not pricelist_id: + return {} + return {'value': {'currency_id': self.pool.get('product.pricelist').browse(cr, uid, pricelist_id, context=context).currency_id.id}} + def onchange_dest_address_id(self, cr, uid, ids, address_id): if not address_id: return {} diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index bfff06f5eaf..446c17578cb 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -223,7 +223,8 @@ - + + @@ -249,14 +250,14 @@ - - + + - +