[FIX] Sale_*: Misc improvements (tooltips,strings...etc)

lp bug: https://launchpad.net/bugs/687463 fixed

bzr revid: mra@mra-laptop-20101213060723-3yvidr2b3x9n4q6n
This commit is contained in:
Mustufa Rangwala 2010-12-13 11:37:23 +05:30
parent c87800a68c
commit 7b390b3c81
25 changed files with 170 additions and 169 deletions

View File

@ -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),
}

View File

@ -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

View File

@ -20,8 +20,8 @@
<field name="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_sale_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Sale Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Confirmed sale order to invoice.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Sales Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Confirmed sales order to invoice.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="account.process_process_invoiceprocess0"/>
<field name="subflow_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
@ -32,8 +32,8 @@
<field name="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_sale_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Sale Order Requisition&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Drives procurement orders for every sale order line.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Sales Order Requisition&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Drives procurement orders for every sales order line.&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="process_process_salesprocess0"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'waiting_date', 'manual', 'progress', 'shipping_except', 'invoice_except', 'done', 'cancel')&quot;&quot;&quot;" name="model_states"/>
@ -45,7 +45,7 @@
<field name="model_id" ref="sale.model_sale_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Quotation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft state of sale order&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Draft state of sales order&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
@ -55,7 +55,7 @@
<field name="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_sale_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Sale Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Sales Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Drives procurement and invoicing&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='manual'&quot;&quot;&quot;" name="model_states"/>
@ -67,7 +67,7 @@
<field name="model_id" ref="procurement.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Procurement Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;One Procurement order for each sale order line and for each of the components.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;One Procurement order for each sales order line and for each of the components.&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
<field name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='confirmed'&quot;&quot;&quot;" name="model_states"/>
@ -136,7 +136,7 @@
<record id="process_transition_confirmquotation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirm Quotation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The salesman confirms the quotation. The state of the sale order becomes 'In progress' or 'Manual in progress'.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;The salesman confirms the quotation. The state of the sales order becomes 'In progress' or 'Manual in progress'.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_saleorder0"/>
<field model="process.node" name="source_node_id" ref="process_node_quotation0"/>
<field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/>
@ -145,7 +145,7 @@
<record id="process_transition_saleprocurement0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Create Procurement Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;A procurement order is automatically created as soon as a sale order is confirmed or as the invoice is paid. It drives the purchasing and the production of products regarding to the rules and to the sale order's parameters. &quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;A procurement order is automatically created as soon as a sales order is confirmed or as the invoice is paid. It drives the purchasing and the production of products regarding to the rules and to the sales order's parameters. &quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_saleprocurement0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
</record>
@ -153,7 +153,7 @@
<record id="process_transition_packing0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Create Pick List&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The Pick List form is created as soon as the sale order is confirmed, in the same time as the procurement order. It represents the assignment of parts to the sale order. There is 1 pick list by sale order line which evolves with the availability of parts.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;The Pick List form is created as soon as the sales order is confirmed, in the same time as the procurement order. It represents the assignment of parts to the sales order. There is 1 pick list by sales order line which evolves with the availability of parts.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_packinglist0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleprocurement0"/>
</record>
@ -186,15 +186,15 @@
<record id="process_transition_saleorderprocurement0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Procurement of sold material&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;For every sale order line, a procurement order is created to supply the sold product.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;For every sales order line, a procurement order is created to supply the sold product.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="procurement.process_node_procureproducts0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleorderprocurement0"/>
</record>
<record id="process_transition_saleinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;From a sale order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Depending on the Invoicing control of the sale order, the invoice can be based on delivered or on ordered quantities. Thus, a sale order can generates an invoice or a delivery order as soon as it is confirmed by the salesman.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;From a sales order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Depending on the Invoicing control of the sales order, the invoice can be based on delivered or on ordered quantities. Thus, a sales order can generates an invoice or a delivery order as soon as it is confirmed by the salesman.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="account.process_node_draftinvoices0"/>
<field model="process.node" name="source_node_id" ref="process_node_order0"/>
</record>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -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(

View File

@ -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 "\

View File

@ -5,10 +5,10 @@
Requests Links
-->
<record id="req_link_sale_order" model="res.request.link">
<field name="name">Sale Order</field>
<field name="name">Sales Order</field>
<field name="object">sale.order</field>
</record>
<!--
Resource: sale.shop
-->
@ -18,8 +18,8 @@
<field model="account.payment.term" name="payment_default_id" search="[]"/>
<field model="res.company" name="company_id" search="[]"/>
</record>
<function eval="('default',False,'shop_id', [('sale.order', False)], shop, True, False, False, False, True)" id="sale_default_set" model="ir.values" name="set"/>
</data>
</openerp>

View File

@ -4,12 +4,12 @@
<!-- Sequences for sale.order -->
<record id="seq_type_sale_order" model="ir.sequence.type">
<field name="name">Sale Order</field>
<field name="name">Sales Order</field>
<field name="code">sale.order</field>
</record>
<record id="seq_sale_order" model="ir.sequence">
<field name="name">Sale Order</field>
<field name="name">Sales Order</field>
<field name="code">sale.order</field>
<field name="prefix">SO</field>
<field name="padding">3</field>

View File

@ -33,28 +33,28 @@
<field name="type">make_to_stock</field>
</record>
<assert id="test_order_1" model="sale.order" severity="error" string="The amount of the sale order is correctly computed">
<assert id="test_order_1" model="sale.order" severity="error" string="The amount of the sales order is correctly computed">
<test expr="sum([l.price_subtotal for l in order_line]) == amount_untaxed"/>
</assert>
<workflow action="order_confirm" model="sale.order" ref="test_order_1"/>
<assert id="test_order_1" model="sale.order" string="the sale order is now in 'Manual in progress' state">
<assert id="test_order_1" model="sale.order" string="the sales order is now in 'Manual in progress' state">
<test expr="state">manual</test>
</assert>
<workflow action="manual_invoice" model="sale.order" ref="test_order_1" uid="base.user_root"/>
<assert id="test_order_1" model="sale.order" string="the sale order is now in progress">
<assert id="test_order_1" model="sale.order" string="the sales order is now in progress">
<test expr="state">progress</test>
</assert>
<!-- Treat generated invoice -->
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sale order has now a corresponding invoice">
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sales order has now a corresponding invoice">
<test expr="len(invoice_ids) == 1"/>
</assert>
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sale order's has the same amount and is currently a draft">
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sales order's has the same amount and is currently a draft">
<test expr="invoice_ids[0].amount_untaxed == amount_untaxed"/>
<test expr="invoice_ids[0].amount_total == amount_total"/>
<test expr="invoice_ids[0].state">draft</test>
@ -75,16 +75,16 @@
<value eval="ref('account.bank_journal')"/>
</function>
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sale order's invoice is now paid">
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sales order's invoice is now paid">
<test expr="invoice_ids[0].state">paid</test>
</assert>
<!-- Treat generated picking -->
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sale order has now a correspending picking">
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sales order has now a correspending picking">
<test expr="len(picking_ids) == 1"/>
</assert>
<assert id="test_order_1" model="sale.order" severity="error" string="the sale order's picking will be sent to the good address and is already confirmed">
<assert id="test_order_1" model="sale.order" severity="error" string="the sales order's picking will be sent to the good address and is already confirmed">
<test expr="picking_ids[0].address_id == partner_shipping_id"/>
<!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT -->
</assert>
@ -94,7 +94,7 @@
<value eval="[obj(ref('test_order_1')).picking_ids[0].id]" model="sale.order"/>
</function>
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sale order's picking is now assigned">
<assert id="test_order_1" model="sale.order" severity="fatal" string="the sales order's picking is now assigned">
<test expr="picking_ids[0].state">assigned</test>
</assert>
@ -107,14 +107,14 @@
<value eval="obj(ref('test_order_1')).picking_ids[0].id" model="sale.order"/>
</workflow>
<assert id="test_order_1" model="sale.order" string="the sale order's picking is now done">
<assert id="test_order_1" model="sale.order" string="the sales order's picking is now done">
<test expr="picking_ids[0].state">done</test>
</assert>
<!-- Run all schedulers -->
<function model="procurement.order" name="run_scheduler"/>
<assert id="test_order_1" model="sale.order" string="the sale order is now done">
<assert id="test_order_1" model="sale.order" string="the sales order is now done">
<test expr="state">done</test>
</assert>
</data>

View File

@ -14,7 +14,7 @@
<field name="model">sale.shop</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sale Shop">
<form string="Sales Shop">
<field name="name" select="1"/>
<field name="warehouse_id" required="1" select="1" widget="selection"/>
<field name="company_id" widget='selection' groups="base.group_multi_company"/>
@ -30,7 +30,7 @@
<field name="model">sale.shop</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sale Shop">
<tree string="Sales Shop">
<field name="name"/>
<field name="warehouse_id"/>
<field name="pricelist_id"/>
@ -122,7 +122,7 @@
groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<newline/>
<field colspan="4" mode="tree,form,graph" name="order_line" nolabel="1" widget="one2many_list">
<form string="Sale Order Lines">
<form string="Sales Order Lines">
<notebook>
<page string="Order Line">
<field colspan="4"
@ -245,8 +245,9 @@
<field colspan="4" name="note" nolabel="1"/>
</page>
<page string="History" groups="base.group_extended">
<separator colspan="4" string="Related Invoices"/>
<separator colspan="4" string="Invoices"/>
<field colspan="4" name="invoice_ids" nolabel="1" context="{'form_view_ref':'account.invoice_form'}"/>
<separator colspan="4" string="Packings"/>
<field colspan="4" name="picking_ids" nolabel="1"/>
</page>
</notebook>
@ -430,7 +431,7 @@
<field name="order_partner_id"/>
<field name="product_id"/>
<field name="salesman_id">
<filter icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sale Order Lines related to a Sales Order of mine"/>
<filter icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
</field>
<newline/>
<group expand="context.get('report',False)" string="Group By..." colspan="9" col="8">
@ -474,7 +475,7 @@
<field name="order_partner_id"/>
<field name="product_id"/>
<field name="salesman_id">
<filter icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sale Order Lines"/>
<filter icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/>
</field>
<newline />
<group expand="0" string="Group By..." colspan="9" col="8">

View File

@ -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)],

View File

@ -12,7 +12,7 @@
</field>
</field>
</record>
<record id="stock_move_sale" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
@ -24,7 +24,7 @@
</xpath>
</field>
</record>
<!--
<act_window
domain="[('sale_id', '=', active_id)]"
@ -33,14 +33,14 @@
res_model="stock.picking"
src_model="sale.order"
context="{'contact_display': 'partner'}" />
<record id="action_sale_picking_out_tree_view" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="stock.view_picking_out_tree"/>
<field name="act_window_id" ref="act_sale_order_2_stock_picking"/>
</record>
<record id="action_sale_picking_out_form_view" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
@ -48,9 +48,9 @@
<field name="act_window_id" ref="act_sale_order_2_stock_picking"/>
</record>
-->
<!-- Adding Sale Order Reference to outgoing picking -->
<!-- Adding Sales Order Reference to outgoing picking -->
<record id="stock_picking_out_inherit_sale" model="ir.ui.view">
<field name="name">Outgoing picking Inherited</field>
<field name="model">stock.picking</field>

View File

@ -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 {}

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<record id="view_sale_order_line_make_invoice" model="ir.ui.view">
<field name="name">Sale OrderLine Make Invoice</field>
<field name="name">Sales OrderLine Make Invoice</field>
<field name="model">sale.order.line.make.invoice</field>
<field name="type">form</field>
<field name="arch" type="xml">
@ -23,7 +23,7 @@
<field name="view_id" ref="view_sale_order_line_make_invoice"/>
<field name="target">new</field>
</record>
<record model="ir.values" id="sale_order_line_make_invoice">
<field name="model_id" ref="sale.model_sale_order_line" />
<field name="object" eval="1" />

View File

@ -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:

View File

@ -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):

View File

@ -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 users 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()

View File

@ -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.

View File

@ -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

View File

@ -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([

View File

@ -26,7 +26,7 @@
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='order_line']" position="replace">
<field name="abstract_line_ids" colspan="4" nolabel="1" widget="one2many_list">
<form string="Sale Order Lines">
<form string="Sales Order Lines">
<notebook>
<page string="Order Line">
<separator colspan="4" string="Automatic Declaration"/>

View File

@ -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()

View File

@ -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',
],

View File

@ -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()

View File

@ -21,7 +21,7 @@
{
'name': 'Sale Order Dates',
'name': 'Sales Order Dates',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """

View File

@ -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()