From 7b390b3c811bd29ce08fb529151938ae4529232d Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 13 Dec 2010 11:37:23 +0530 Subject: [PATCH] [FIX] Sale_*: Misc improvements (tooltips,strings...etc) lp bug: https://launchpad.net/bugs/687463 fixed bzr revid: mra@mra-laptop-20101213060723-3yvidr2b3x9n4q6n --- addons/delivery/sale.py | 2 +- addons/sale/__openerp__.py | 2 +- addons/sale/process/sale_process.xml | 26 ++--- addons/sale/product.py | 6 +- addons/sale/sale.py | 108 +++++++++--------- addons/sale/sale_data.xml | 8 +- addons/sale/sale_sequence.xml | 4 +- addons/sale/sale_unit_test.xml | 22 ++-- addons/sale/sale_view.xml | 13 ++- addons/sale/stock.py | 6 +- addons/sale/stock_view.xml | 14 +-- addons/sale/wizard/sale_line_invoice.py | 4 +- addons/sale/wizard/sale_line_invoice.xml | 4 +- addons/sale/wizard/sale_make_invoice.py | 18 +-- .../sale/wizard/sale_make_invoice_advance.py | 6 +- addons/sale_crm/wizard/crm_make_sale.py | 66 +++++------ addons/sale_journal/__openerp__.py | 2 +- addons/sale_layout/__openerp__.py | 2 +- addons/sale_layout/sale_layout.py | 4 +- addons/sale_layout/sale_layout_view.xml | 2 +- addons/sale_margin/sale_margin.py | 2 +- addons/sale_mrp/__openerp__.py | 4 +- addons/sale_mrp/sale_mrp.py | 6 +- addons/sale_order_dates/__openerp__.py | 2 +- addons/sale_order_dates/sale_order_dates.py | 6 +- 25 files changed, 170 insertions(+), 169 deletions(-) diff --git a/addons/delivery/sale.py b/addons/delivery/sale.py index ee9295eb5d4..8589ee88201 100644 --- a/addons/delivery/sale.py +++ b/addons/delivery/sale.py @@ -26,7 +26,7 @@ from osv import fields,osv class sale_order(osv.osv): _inherit = 'sale.order' _columns = { - 'carrier_id':fields.many2one("delivery.carrier","Delivery method", help="Complete this field if you plan to invoice the shipping based on picking."), + 'carrier_id':fields.many2one("delivery.carrier", "Delivery Method", help="Complete this field if you plan to invoice the shipping based on picking."), 'id': fields.integer('ID', readonly=True,invisible=True), } diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 6978a0bb072..bf7d238790a 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -27,7 +27,7 @@ The base module to manage quotations and sales orders. * Workflow with validation steps: - - Quotation -> Sale order -> Invoice + - Quotation -> Sales order -> Invoice * Invoicing methods: - Invoice on order (before or after shipping) - Invoice on delivery diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml index eb4386304ac..b688f2aeb7f 100644 --- a/addons/sale/process/sale_process.xml +++ b/addons/sale/process/sale_process.xml @@ -20,8 +20,8 @@ - - + + @@ -32,8 +32,8 @@ - - + + @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -186,15 +186,15 @@ - + - - + + diff --git a/addons/sale/product.py b/addons/sale/product.py index cf86f49f583..7cd174f16e0 100644 --- a/addons/sale/product.py +++ b/addons/sale/product.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -56,7 +56,7 @@ class product_product(osv.osv): 'pricelist_sale':fields.function( _pricelist_calculate, method=True, - string='Sale Pricelists', + string='Sales Pricelists', store=True, type="text"), 'pricelist_purchase':fields.function( diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 05a71edb065..9dd353a7b20 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -30,7 +30,7 @@ import netsvc class sale_shop(osv.osv): _name = "sale.shop" - _description = "Sale Shop" + _description = "Sales Shop" _columns = { 'name': fields.char('Shop Name', size=64, required=True), 'payment_default_id': fields.many2one('account.payment.term', 'Default Payment Term', required=True), @@ -47,7 +47,7 @@ sale_shop() class sale_order(osv.osv): _name = "sale.order" - _description = "Sale Order" + _description = "Sales Order" def copy(self, cr, uid, id, default=None, context=None): if context is None: @@ -206,7 +206,7 @@ class sale_order(osv.osv): 'name': fields.char('Order Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, select=True), 'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)]}), - 'origin': fields.char('Source document', size=64, help="Reference of the document that generated this sale order request."), + 'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this sales order request."), 'client_order_ref': fields.char('Customer Reference', size=64), 'state': fields.selection([ ('draft', 'Quotation'), @@ -217,41 +217,41 @@ class sale_order(osv.osv): ('invoice_except', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') - ], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True), + ], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True), 'date_order': fields.date('Ordered Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), - 'create_date': fields.date('Creation Date', readonly=True, help="Date on which sale order is created"), - 'date_confirm': fields.date('Confirmation Date', readonly=True, help="Date on which sale order is confirmed"), + 'create_date': fields.date('Creation Date', readonly=True, help="Date on which sales order is created."), + 'date_confirm': fields.date('Confirmation Date', readonly=True, help="Date on which sales order is confirmed."), 'user_id': fields.many2one('res.users', 'Salesman', states={'draft': [('readonly', False)]}, select=True), 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)]}, required=True, change_default=True, select=True), - 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sale order"), + 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sales order."), 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="The name and address of the contact who requested the order or quotation."), - 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sale order"), + 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."), - 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction"), + 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), 'picking_policy': fields.selection([('direct', 'Partial Delivery'), ('one', 'Complete Delivery')], 'Picking Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""), 'order_policy': fields.selection([ ('prepaid', 'Payment Before Delivery'), ('manual', 'Shipping & Manual Invoice'), - ('postpaid', 'Invoice on Order After Delivery'), - ('picking', 'Invoice from Delivery'), + ('postpaid', 'Invoice On Order After Delivery'), + ('picking', 'Invoice From The Picking'), ], 'Shipping Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="""The Shipping Policy is used to synchronise invoice and delivery operations. - - The 'Pay before delivery' choice will first generate the invoice and then generate the picking order after the payment of this invoice. + - The 'Pay Before delivery' choice will first generate the invoice and then generate the picking order after the payment of this invoice. - The 'Shipping & Manual Invoice' will create the picking order directly and wait for the user to manually click on the 'Invoice' button to generate the draft invoice. - - The 'Invoice on Order After Delivery' choice will generate the draft invoice based on sale order after all picking lists have been finished. - - The 'Invoice from the picking' choice is used to create an invoice during the picking process."""), - 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current sale order"), - 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)]}, help="The analytic account related to a sale order"), + - The 'Invoice On Order After Delivery' choice will generate the draft invoice based on sales order after all picking lists have been finished. + - The 'Invoice From The Picking' choice is used to create an invoice during the picking process."""), + 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist for current sales order."), + 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('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)]}), - 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', readonly=True, help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."), - 'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Picking', readonly=True, help="This is a list of picking that has been generated for this sale order"), - 'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sale order has been delivered. This field is updated only after the scheduler have been launched !"), + 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', readonly=True, help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."), + 'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Picking', readonly=True, help="This is a list of picking that has been generated for this sales order."), + 'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sales order has been delivered. This field is updated only after the scheduler(s) have been launched."), 'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'), 'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'), 'invoiced': fields.function(_invoiced, method=True, string='Paid', - fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid"), + fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid."), 'note': fields.text('Notes'), 'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount', @@ -259,21 +259,21 @@ class sale_order(osv.osv): 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), 'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10), }, - multi='sums', help="The amount without tax"), + multi='sums', help="The amount without tax."), 'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Taxes', store = { 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), 'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10), }, - multi='sums', help="The tax amount"), + multi='sums', help="The tax amount."), 'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Total', store = { 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), 'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10), }, - multi='sums', help="The total amount"), + multi='sums', help="The total amount."), - 'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you want your invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True), + 'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sales order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you want your invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True), 'payment_term': fields.many2one('account.payment.term', 'Payment Term'), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'), 'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True) @@ -281,7 +281,7 @@ class sale_order(osv.osv): _defaults = { 'picking_policy': 'direct', 'date_order': lambda *a: time.strftime('%Y-%m-%d'), - 'order_policy': 'manual', + 'state': 'draft', 'user_id': lambda obj, cr, uid, context: uid, 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'), @@ -302,7 +302,7 @@ class sale_order(osv.osv): if s['state'] in ['draft', 'cancel']: unlink_ids.append(s['id']) else: - raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !')) + raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sales Order(s) which are already confirmed !')) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) def onchange_shop_id(self, cr, uid, ids, shop_id): @@ -328,7 +328,7 @@ class sale_order(osv.osv): wf_service.trg_delete(uid, 'sale.order', inv_id, cr) wf_service.trg_create(uid, 'sale.order', inv_id, cr) for (id,name) in self.name_get(cr, uid, ids): - message = _("The sale order '%s' has been set in draft state.") %(name,) + message = _("The sales order '%s' has been set in draft state.") %(name,) self.log(cr, uid, id, message) return True @@ -393,7 +393,7 @@ class sale_order(osv.osv): #FIXME: the method should return the list of invoices created (invoice_ids) # and not the id of the last invoice created (res). The problem is that we - # cannot change it directly since the method is called by the sale order + # cannot change it directly since the method is called by the sales order # workflow and I suppose it expects a single id... def _inv_get(self, cr, uid, order, context=None): if context is None: @@ -410,7 +410,7 @@ class sale_order(osv.osv): journal_ids = journal_obj.search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)], limit=1) if not journal_ids: raise osv.except_osv(_('Error !'), - _('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id)) + _('There is no sales journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id)) a = order.partner_id.property_account_receivable.id pay_term = order.payment_term and order.payment_term.id or False invoiced_sale_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('order_id', '=', order.id), ('invoiced', '=', True)], context=context) @@ -576,7 +576,7 @@ class sale_order(osv.osv): if vals: self.pool.get('sale.order.line').write(cr, uid, [line.id], vals, context=context) # - # Update the sale order state. + # Update the sales order state. # if order.state == 'invoice_except': self.write(cr, uid, [order.id], {'state': 'progress'}, context=context) @@ -591,22 +591,22 @@ class sale_order(osv.osv): for pick in sale.picking_ids: if pick.state not in ('draft', 'cancel'): raise osv.except_osv( - _('Could not cancel sale order !'), - _('You must first cancel all picking attached to this sale order.')) + _('Could not cancel sales order !'), + _('You must first cancel all picking attached to this sales order.')) for r in self.read(cr, uid, ids, ['picking_ids']): for pick in r['picking_ids']: wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr) for inv in sale.invoice_ids: if inv.state not in ('draft', 'cancel'): raise osv.except_osv( - _('Could not cancel this sale order !'), - _('You must first cancel all invoices attached to this sale order.')) + _('Could not cancel this sales order !'), + _('You must first cancel all invoices attached to this sales order.')) for r in self.read(cr, uid, ids, ['invoice_ids']): for inv in r['invoice_ids']: wf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_cancel', cr) sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line], {'state': 'cancel'}) - message = _("The sale order '%s' has been cancelled.") % (sale.name,) + message = _("The sales order '%s' has been cancelled.") % (sale.name,) self.log(cr, uid, sale.id, message) self.write(cr, uid, ids, {'state': 'cancel'}) return True @@ -618,7 +618,7 @@ class sale_order(osv.osv): else: self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')}) self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line]) - message = _("The quotation '%s' has been converted to a sale order.") % (o.name,) + message = _("The quotation '%s' has been converted to a sales order.") % (o.name,) self.log(cr, uid, o.id, message) return True @@ -724,7 +724,7 @@ class sale_order(osv.osv): 'note': line.notes, 'company_id': order.company_id.id, }) - + if line.product_id: proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, @@ -745,7 +745,7 @@ class sale_order(osv.osv): }) proc_ids.append(proc_id) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id}) - + if order.state == 'shipping_except': for pick in order.picking_ids: for move in pick.move_lines: @@ -762,7 +762,7 @@ class sale_order(osv.osv): if picking_id: wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) - + if order.state == 'shipping_except': val['state'] = 'progress' val['shipped'] = False @@ -857,11 +857,11 @@ class sale_order_line(osv.osv): return res _name = 'sale.order.line' - _description = 'Sale Order Line' + _description = 'Sales Order Line' _columns = { 'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}), 'name': fields.char('Description', size=256, required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sale order lines."), + 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sales order lines."), 'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True), 'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), @@ -884,11 +884,11 @@ class sale_order_line(osv.osv): 'notes': fields.text('Notes'), 'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}), 'state': fields.selection([('draft', 'Draft'),('confirmed', 'Confirmed'),('done', 'Done'),('cancel', 'Cancelled'),('exception', 'Exception')], 'State', required=True, readonly=True, - help='* The \'Draft\' state is set when the related sale order in draft state. \ - \n* The \'Confirmed\' state is set when the related sale order is confirmed. \ - \n* The \'Exception\' state is set when the related sale order is set as exception. \ - \n* The \'Done\' state is set when the sale order line has been picked. \ - \n* The \'Cancelled\' state is set when a user cancel the sale order related.'), + help='* The \'Draft\' state is set when the related sales order in draft state. \ + \n* The \'Confirmed\' state is set when the related sales order is confirmed. \ + \n* The \'Exception\' state is set when the related sales order is set as exception. \ + \n* The \'Done\' state is set when the sales order line has been picked. \ + \n* The \'Cancelled\' state is set when a user cancel the sales order related.'), 'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', store=True, string='Customer'), 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesman'), 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True, states={'draft': [('readonly', False)]}), @@ -985,12 +985,12 @@ class sale_order_line(osv.osv): context = {} for line in self.browse(cr, uid, ids, context=context): if line.invoiced: - raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sale order line that has already been invoiced !')) + raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sales order line that has already been invoiced !')) for move_line in line.move_ids: if move_line.state != 'cancel': raise osv.except_osv( - _('Could not cancel sale order line!'), - _('You must first cancel stock moves attached to this sale order line.')) + _('Could not cancel sales order line!'), + _('You must first cancel stock moves attached to this sales order line.')) return self.write(cr, uid, ids, {'state': 'cancel'}) def button_confirm(self, cr, uid, ids, context=None): @@ -1039,7 +1039,7 @@ class sale_order_line(osv.osv): uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): if not partner_id: - raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sale form !\nPlease set one customer before choosing a product.')) + raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sales form !\nPlease set one customer before choosing a product.')) warning = {} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') @@ -1151,7 +1151,7 @@ class sale_order_line(osv.osv): warning = { 'title': 'No Pricelist !', 'message': - 'You have to select a pricelist or a customer in the sale form !\n' + 'You have to select a pricelist or a customer in the sales form !\n' 'Please set one before choosing a product.' } else: @@ -1187,10 +1187,10 @@ class sale_order_line(osv.osv): def unlink(self, cr, uid, ids, context=None): if context is None: context = {} - """Allows to delete sale order lines in draft,cancel states""" + """Allows to delete sales order lines in draft,cancel states""" for rec in self.browse(cr, uid, ids, context=context): if rec.state not in ['draft', 'cancel']: - raise osv.except_osv(_('Invalid action !'), _('Cannot delete a sale order line which is %s !') %(rec.state,)) + raise osv.except_osv(_('Invalid action !'), _('Cannot delete a sales order line which is %s !') %(rec.state,)) return super(sale_order_line, self).unlink(cr, uid, ids, context=context) sale_order_line() @@ -1213,7 +1213,7 @@ class sale_config_picking_policy(osv.osv_memory): 'step': fields.selection([ ('one', 'Delivery Order Only'), ('two', 'Picking List & Delivery Order') - ], 'Steps To Deliver a Sale Order', required=True, + ], 'Steps To Deliver a Sales Order', required=True, help="By default, OpenERP is able to manage complex routing and paths "\ "of products in your warehouse and partner locations. This will configure "\ "the most common and simple methods to deliver products to the customer "\ diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index f2ebe3af020..655dfc3b9bf 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -5,10 +5,10 @@ Requests Links --> - Sale Order + Sales Order sale.order - + @@ -18,8 +18,8 @@ - + - + diff --git a/addons/sale/sale_sequence.xml b/addons/sale/sale_sequence.xml index 8a500a9395c..dadd1942940 100644 --- a/addons/sale/sale_sequence.xml +++ b/addons/sale/sale_sequence.xml @@ -4,12 +4,12 @@ - Sale Order + Sales Order sale.order - Sale Order + Sales Order sale.order SO 3 diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml index 95a23024412..421cb36c440 100644 --- a/addons/sale/sale_unit_test.xml +++ b/addons/sale/sale_unit_test.xml @@ -33,28 +33,28 @@ make_to_stock - + - + manual - + progress - + - + draft @@ -75,16 +75,16 @@ - + paid - + - + @@ -94,7 +94,7 @@ - + assigned @@ -107,14 +107,14 @@ - + done - + done diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index adafd1938fa..5d1e06c2d35 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -14,7 +14,7 @@ sale.shop form -
+ @@ -30,7 +30,7 @@ sale.shop tree - + @@ -122,7 +122,7 @@ groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" /> - + - + + @@ -430,7 +431,7 @@ - + @@ -474,7 +475,7 @@ - + diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 72e3f0a6c24..dd0aa3ad855 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -24,7 +24,7 @@ from osv import osv, fields class stock_move(osv.osv): _inherit = 'stock.move' _columns = { - 'sale_line_id': fields.many2one('sale.order.line', 'Sale Order Line', ondelete='set null', select=True, readonly=True), + 'sale_line_id': fields.many2one('sale.order.line', 'Sales Order Line', ondelete='set null', select=True, readonly=True), } def _create_chained_picking(self, cr, uid, pick_name, picking, ptype, move, context=None): @@ -37,7 +37,7 @@ stock_move() class stock_picking(osv.osv): _inherit = 'stock.picking' _columns = { - 'sale_id': fields.many2one('sale.order', 'Sale Order', ondelete='set null', select=True), + 'sale_id': fields.many2one('sale.order', 'Sales Order', ondelete='set null', select=True), } _defaults = { 'sale_id': False @@ -97,7 +97,7 @@ class stock_picking(osv.osv): def _invoice_line_hook(self, cursor, user, move_line, invoice_line_id): sale_line_obj = self.pool.get('sale.order.line') if move_line.sale_line_id: - sale_line_obj.write(cursor, user, [move_line.sale_line_id.id], + sale_line_obj.write(cursor, user, [move_line.sale_line_id.id], { 'invoiced': True, 'invoice_lines': [(4, invoice_line_id)], diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml index 4075c523cb9..238982f46cb 100644 --- a/addons/sale/stock_view.xml +++ b/addons/sale/stock_view.xml @@ -12,7 +12,7 @@ - + stock.move.form stock.move @@ -24,7 +24,7 @@ - + - - - + + + Outgoing picking Inherited stock.picking diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 0b6a5219b0c..05f17b58e3b 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -25,7 +25,7 @@ import netsvc class sale_order_line_make_invoice(osv.osv_memory): _name = "sale.order.line.make.invoice" - _description = "Sale OrderLine Make_invoice" + _description = "Sales OrderLine Make_invoice" def make_invoices(self, cr, uid, ids, context): """ To make invoices. @@ -108,7 +108,7 @@ class sale_order_line_make_invoice(osv.osv_memory): sales_order_obj.write(cr, uid, [line.order_id.id], {'state': 'progress'}) if not invoices: - raise osv.except_osv(_('Warning'), _('Invoice cannot be created for this Sale Order Line due to one of the following reasons:\n1.The state of this sale order line is either "draft" or "cancel"!\n2.The Sale Order Line is Invoiced!')) + raise osv.except_osv(_('Warning'), _('Invoice cannot be created for this Sales Order Line due to one of the following reasons:\n1.The state of this sales order line is either "draft" or "cancel"!\n2.The Sales Order Line is Invoiced!')) return {} diff --git a/addons/sale/wizard/sale_line_invoice.xml b/addons/sale/wizard/sale_line_invoice.xml index 774759c82c7..6562af09258 100644 --- a/addons/sale/wizard/sale_line_invoice.xml +++ b/addons/sale/wizard/sale_line_invoice.xml @@ -2,7 +2,7 @@ - Sale OrderLine Make Invoice + Sales OrderLine Make Invoice sale.order.line.make.invoice form @@ -23,7 +23,7 @@ new - + diff --git a/addons/sale/wizard/sale_make_invoice.py b/addons/sale/wizard/sale_make_invoice.py index 7dd9ddac8d1..7ca635f5484 100644 --- a/addons/sale/wizard/sale_make_invoice.py +++ b/addons/sale/wizard/sale_make_invoice.py @@ -24,7 +24,7 @@ import netsvc class sale_make_invoice(osv.osv_memory): _name = "sale.make.invoice" - _description = "Sale Make Invoice" + _description = "Sales Make Invoice" _columns = { 'grouped': fields.boolean('Group the invoices', help='Check the box to group the invoices for the same customers'), 'invoice_date': fields.date('Invoice Date'), @@ -32,16 +32,16 @@ class sale_make_invoice(osv.osv_memory): _defaults = { 'grouped': False } - + def view_init(self, cr, uid, fields_list, context=None): if context is None: context = {} - record_id = context and context.get('active_id', False) + record_id = context and context.get('active_id', False) order = self.pool.get('sale.order').browse(cr, uid, record_id) if order.state == 'draft': - raise osv.except_osv(_('Warning !'),'You can not create invoice when sale order is not confirmed.') + raise osv.except_osv(_('Warning !'),'You can not create invoice when sales order is not confirmed.') return False - + def make_invoices(self, cr, uid, ids, context={}): order_obj = self.pool.get('sale.order') mod_obj = self.pool.get('ir.model.data') @@ -51,11 +51,11 @@ class sale_make_invoice(osv.osv_memory): wf_service = netsvc.LocalService("workflow") for id in context.get(('active_ids'), []): wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr) - + for o in order_obj.browse(cr, uid, context.get(('active_ids'), []), context): for i in o.invoice_ids: newinv.append(i.id) - + res = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_invoice_filter') return { @@ -67,9 +67,9 @@ class sale_make_invoice(osv.osv_memory): 'view_id': False, 'context': "{'type': 'out_refund'}", 'type': 'ir.actions.act_window', - 'search_view_id': res and res[1] or False + 'search_view_id': res and res[1] or False } -sale_make_invoice() +sale_make_invoice() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 8623ba0b879..94d5ab38953 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -23,7 +23,7 @@ from tools.translate import _ class sale_advance_payment_inv(osv.osv_memory): _name = "sale.advance.payment.inv" - _description = "Sale Advance Payment Invoice" + _description = "Sales Advance Payment Invoice" _columns = { 'product_id': fields.many2one('product.product', 'Advance Product', required=True, help="Select a product of type service which is called 'Advance Product'. You may have to create it and set it as a default value on this field."), @@ -59,7 +59,7 @@ class sale_advance_payment_inv(osv.osv_memory): if sale.order_policy == 'postpaid': raise osv.except_osv( _('Error'), - _("You cannot make an advance on a sale order \ + _("You cannot make an advance on a sales order \ that is defined as 'Automatic Invoice after delivery'.")) val = obj_lines.product_id_change(cr, uid, [], sale_adv_obj.product_id.id, uom = False, partner_id = sale.partner_id.id, fposition_id = sale.fiscal_position.id) @@ -134,7 +134,7 @@ sale_advance_payment_inv() class sale_open_invoice(osv.osv_memory): _name = "sale.open.invoice" - _description = "Sale Open Invoice" + _description = "Sales Open Invoice" def open_invoice(self, cr, uid, ids, context=None): diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 0c72c3205cd..83a95663b72 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -28,7 +28,7 @@ class crm_make_sale(osv.osv_memory): """ Make sale order for crm """ _name = "crm.make.sale" - _description = "Make sale" + _description = "Make sales" def _selectPartner(self, cr, uid, context=None): """ @@ -61,9 +61,9 @@ class crm_make_sale(osv.osv_memory): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param ids: List of crm make sale' ids + @param ids: List of crm make sales' ids @param context: A standard dictionary for contextual values - @return: Dictionary value of created sale order. + @return: Dictionary value of created sales order. """ if not context: context = {} @@ -75,7 +75,7 @@ class crm_make_sale(osv.osv_memory): for make in self.browse(cr, uid, ids, context=context): partner = make.partner_id - partner_addr = partner_obj.address_get(cr, uid, [partner.id], + partner_addr = partner_obj.address_get(cr, uid, [partner.id], ['default', 'invoice', 'delivery', 'contact']) pricelist = partner.property_product_pricelist.id fpos = partner.property_account_position and partner.property_account_position.id or False @@ -84,23 +84,23 @@ class crm_make_sale(osv.osv_memory): if not partner and case.partner_id: partner = case.partner_id fpos = partner.property_account_position and partner.property_account_position.id or False - partner_addr = partner_obj.address_get(cr, uid, [partner.id], + partner_addr = partner_obj.address_get(cr, uid, [partner.id], ['default', 'invoice', 'delivery', 'contact']) pricelist = partner.property_product_pricelist.id if False in partner_addr.values(): raise osv.except_osv(_('Data Insufficient!'), _('Customer has no addresses defined!')) vals = { - 'origin': _('Opportunity: %s') % str(case.id), - 'section_id': case.section_id and case.section_id.id or False, - 'shop_id': make.shop_id.id, - 'partner_id': partner.id, - 'pricelist_id': pricelist, - 'partner_invoice_id': partner_addr['invoice'], - 'partner_order_id': partner_addr['contact'], - 'partner_shipping_id': partner_addr['delivery'], - 'date_order': time.strftime('%Y-%m-%d'), - 'fiscal_position': fpos, + 'origin': _('Opportunity: %s') % str(case.id), + 'section_id': case.section_id and case.section_id.id or False, + 'shop_id': make.shop_id.id, + 'partner_id': partner.id, + 'pricelist_id': pricelist, + 'partner_invoice_id': partner_addr['invoice'], + 'partner_order_id': partner_addr['contact'], + 'partner_shipping_id': partner_addr['delivery'], + 'date_order': time.strftime('%Y-%m-%d'), + 'fiscal_position': fpos, } if partner.id: vals['user_id'] = partner.user_id and partner.user_id.id or uid @@ -117,22 +117,22 @@ class crm_make_sale(osv.osv_memory): return {} if len(new_ids)<=1: value = { - 'domain': str([('id', 'in', new_ids)]), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'sale.order', - 'view_id': False, - 'type': 'ir.actions.act_window', + 'domain': str([('id', 'in', new_ids)]), + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'sale.order', + 'view_id': False, + 'type': 'ir.actions.act_window', 'res_id': new_ids and new_ids[0] } else: value = { - 'domain': str([('id', 'in', new_ids)]), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'sale.order', - 'view_id': False, - 'type': 'ir.actions.act_window', + 'domain': str([('id', 'in', new_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'sale.order', + 'view_id': False, + 'type': 'ir.actions.act_window', 'res_id': new_ids } return value @@ -145,14 +145,14 @@ class crm_make_sale(osv.osv_memory): return shop and shop[0] or False _columns = { - 'shop_id': fields.many2one('sale.shop', 'Shop', required=True), - 'partner_id': fields.many2one('res.partner', 'Customer', required=True), - 'close': fields.boolean('Close Opportunity', help='Check this to close the opportunity after having created the sale order.'), + 'shop_id': fields.many2one('sale.shop', 'Shop', required=True), + 'partner_id': fields.many2one('res.partner', 'Customer', required=True), + 'close': fields.boolean('Close Opportunity', help='Check this to close the opportunity after having created the sale order.'), } _defaults = { - 'shop_id': _get_shop_id, - 'close': True, - 'partner_id': _selectPartner, + 'shop_id': _get_shop_id, + 'close': True, + 'partner_id': _selectPartner, } crm_make_sale() diff --git a/addons/sale_journal/__openerp__.py b/addons/sale_journal/__openerp__.py index 37fc05fd066..54a3f7afd95 100644 --- a/addons/sale_journal/__openerp__.py +++ b/addons/sale_journal/__openerp__.py @@ -24,7 +24,7 @@ 'version': '1.0', 'category': 'Generic Modules/Sales & Purchases', 'description': """ - The sale journal modules allows you to categorise your + The sales journal modules allows you to categorise your sales and deliveries (picking lists) between different journals. This module is very helpful for bigger companies that works by departments. diff --git a/addons/sale_layout/__openerp__.py b/addons/sale_layout/__openerp__.py index b8490c02fc9..1f771ff3044 100755 --- a/addons/sale_layout/__openerp__.py +++ b/addons/sale_layout/__openerp__.py @@ -27,7 +27,7 @@ This module provides features to improve the layout of the Sales Order. It gives you the possibility to - * order all the lines of an sale order + * order all the lines of an sales order * add titles, comment lines, sub total lines * draw horizontal lines and put page breaks diff --git a/addons/sale_layout/sale_layout.py b/addons/sale_layout/sale_layout.py index 90192615f1a..d6ff8a0236f 100755 --- a/addons/sale_layout/sale_layout.py +++ b/addons/sale_layout/sale_layout.py @@ -32,7 +32,7 @@ class sale_order_line(osv.osv): if line.layout_type == 'article': return super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context) return res - + def invoice_line_create(self, cr, uid, ids, context={}): new_ids = [] list_seq = [] @@ -102,7 +102,7 @@ class sale_order_line(osv.osv): return super(sale_order_line, self).copy(cr, uid, id, default, context) _order = "order_id, sequence asc" - _description = "Sale Order line" + _description = "Sales Order line" _inherit = "sale.order.line" _columns = { 'layout_type': fields.selection([ diff --git a/addons/sale_layout/sale_layout_view.xml b/addons/sale_layout/sale_layout_view.xml index 3eac7eb1f3f..03ec9f73c78 100755 --- a/addons/sale_layout/sale_layout_view.xml +++ b/addons/sale_layout/sale_layout_view.xml @@ -26,7 +26,7 @@ - + diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 3a0e09a0309..998ca50b918 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -64,7 +64,7 @@ class sale_order(osv.osv): return result _columns = { - 'margin': fields.function(_product_margin, method=True, string='Margin', store=True, help="It gives profitability by calculating the difference between the Unit Price and Cost Price"), + 'margin': fields.function(_product_margin, method=True, string='Margin', store=True, help="It gives profitability by calculating the difference between the Unit Price and Cost Price."), } sale_order() diff --git a/addons/sale_mrp/__openerp__.py b/addons/sale_mrp/__openerp__.py index e9eb4cbba92..9c3404ada74 100644 --- a/addons/sale_mrp/__openerp__.py +++ b/addons/sale_mrp/__openerp__.py @@ -25,7 +25,7 @@ 'version': '1.0', 'category': 'Generic Modules/Sales & MRP', 'description': """ - This module provides facility to the user to install mrp and sale modules + This module provides facility to the user to install mrp and sales modules at a time. It is basically used when we want to keep track of production orders generated from sales order. It adds sales name and sales Reference on production order @@ -35,7 +35,7 @@ 'depends': ['mrp', 'sale'], 'init_xml': [], 'update_xml': [ - 'security/sale_mrp_security.xml', + 'security/sale_mrp_security.xml', 'security/ir.model.access.csv', 'sale_mrp_view.xml', ], diff --git a/addons/sale_mrp/sale_mrp.py b/addons/sale_mrp/sale_mrp.py index 2ae230ae4a8..03ae1e57f0f 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -26,7 +26,7 @@ class mrp_production(osv.osv): _inherit = 'mrp.production' def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context=None): - """ Finds reference of sale order for production order. + """ Finds reference of sales order for production order. @param field_names: Names of fields. @param arg: User defined arguments @return: Dictionary of values. @@ -72,8 +72,8 @@ class mrp_production(osv.osv): return res _columns = { - 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sale order.'), - 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'), + 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sales Name', help='Indicate the name of sales order.'), + 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sales Reference', help='Indicate the Customer Reference from sales order.'), } mrp_production() diff --git a/addons/sale_order_dates/__openerp__.py b/addons/sale_order_dates/__openerp__.py index 5a66d8111de..ff6e85645f8 100644 --- a/addons/sale_order_dates/__openerp__.py +++ b/addons/sale_order_dates/__openerp__.py @@ -21,7 +21,7 @@ { - 'name': 'Sale Order Dates', + 'name': 'Sales Order Dates', 'version': '1.0', 'category': 'Generic Modules/CRM & SRM', 'description': """ diff --git a/addons/sale_order_dates/sale_order_dates.py b/addons/sale_order_dates/sale_order_dates.py index 2877ba0967d..be5f02e8b03 100644 --- a/addons/sale_order_dates/sale_order_dates.py +++ b/addons/sale_order_dates/sale_order_dates.py @@ -54,9 +54,9 @@ class sale_order_dates(osv.osv): return res _columns = { - 'commitment_date': fields.function(_get_commitment_date, method=True, store=True, type='date', string='Commitment Date', help="Date on which delivery of products is to be made"), - 'requested_date': fields.date('Requested Date', help="Date on which customer has requested for sales"), - 'effective_date': fields.function(_get_effective_date, method=True, type='date', store=True, string='Effective Date',help="Date on which picking is created"), + 'commitment_date': fields.function(_get_commitment_date, method=True, store=True, type='date', string='Commitment Date', help="Date on which delivery of products is to be made."), + 'requested_date': fields.date('Requested Date', help="Date on which customer has requested for sales."), + 'effective_date': fields.function(_get_effective_date, method=True, type='date', store=True, string='Effective Date',help="Date on which picking is created."), } sale_order_dates()