From c4cbd56be61ee747c4be3be335bed4b140d040fa Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Mon, 27 May 2013 16:42:16 +0530 Subject: [PATCH] [IMP] remove unnecessary chnages bzr revid: rma@tinyerp.com-20130527111216-dyo8qprm6zh5u3cj --- addons/purchase/purchase.py | 1 - addons/purchase/wizard/purchase_line_invoice.py | 1 - addons/sale/sale.py | 7 +++---- addons/sale/sale_view.xml | 2 +- addons/sale/wizard/sale_line_invoice.py | 2 +- addons/sale/wizard/sale_make_invoice_advance.py | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 54d167d5fa1..0ad39fca4f8 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -226,7 +226,6 @@ class purchase_order(osv.osv): 'create_uid': fields.many2one('res.users', 'Responsible'), 'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal'), - } _defaults = { 'date_order': fields.date.context_today, diff --git a/addons/purchase/wizard/purchase_line_invoice.py b/addons/purchase/wizard/purchase_line_invoice.py index 051441d1095..b8ee4b69a32 100644 --- a/addons/purchase/wizard/purchase_line_invoice.py +++ b/addons/purchase/wizard/purchase_line_invoice.py @@ -64,7 +64,6 @@ class purchase_line_invoice(osv.osv_memory): def make_invoice_by_partner(partner, orders, lines_ids): - """ create a new invoice for one supplier @param partner : The object partner diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d519db7e02a..210e4dd3be6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -212,7 +212,7 @@ class sale_order(osv.osv): ], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="""This field controls how invoice and delivery operations are synchronized."""), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order."), - 'currency_id': fields.many2one('res.currency','Currency', readonly=True, required=True,states={'draft': [('readonly', False)],'sent': [('readonly', False)]}), + 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", string="Currency", readonly=True, required=True), 'project_id': fields.many2one('account.analytic.account', 'Contract / Analytic', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."), 'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), @@ -258,8 +258,7 @@ class sale_order(osv.osv): 'shop_id': _get_default_shop, 'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'], 'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'], - 'note': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note, - 'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id + 'note': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note } _sql_constraints = [ ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'), @@ -385,7 +384,7 @@ class sale_order(osv.osv): 'partner_id': order.partner_invoice_id.id, 'journal_id': journal_ids[0], 'invoice_line': [(6, 0, lines)], - 'currency_id': order.currency_id.id, + 'currency_id': order.pricelist_id.currency_id.id, 'comment': order.note, 'payment_term': order.payment_term and order.payment_term.id or False, 'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id, diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index d1826da02c1..e24a6e45fe0 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -163,7 +163,7 @@ - + diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 06aae9ea6d5..3b04319f5c7 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -68,7 +68,7 @@ class sale_order_line_make_invoice(osv.osv_memory): 'account_id': a, 'partner_id': order.partner_invoice_id.id, 'invoice_line': [(6, 0, lines)], - 'currency_id' : order.currency_id.id, + 'currency_id' : order.pricelist_id.currency_id.id, 'comment': order.note, 'payment_term': pay_term, 'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id, diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 68446778323..4cb00245ade 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -141,7 +141,7 @@ class sale_advance_payment_inv(osv.osv_memory): 'account_id': sale.partner_id.property_account_receivable.id, 'partner_id': sale.partner_invoice_id.id, 'invoice_line': [(0, 0, inv_line_values)], - 'currency_id': sale.currency_id.id, + 'currency_id': sale.pricelist_id.currency_id.id, 'comment': '', 'payment_term': sale.payment_term.id, 'fiscal_position': sale.fiscal_position.id or sale.partner_id.property_account_position.id