[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): class sale_order(osv.osv):
_inherit = 'sale.order' _inherit = 'sale.order'
_columns = { _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), 'id': fields.integer('ID', readonly=True,invisible=True),
} }

View File

@ -27,7 +27,7 @@
The base module to manage quotations and sales orders. The base module to manage quotations and sales orders.
* Workflow with validation steps: * Workflow with validation steps:
- Quotation -> Sale order -> Invoice - Quotation -> Sales order -> Invoice
* Invoicing methods: * Invoicing methods:
- Invoice on order (before or after shipping) - Invoice on order (before or after shipping)
- Invoice on delivery - Invoice on delivery

View File

@ -20,8 +20,8 @@
<field name="menu_id" ref="sale.menu_sale_order"/> <field name="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_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;subflow&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;Confirmed sale order to invoice.&quot;&quot;&quot;" name="note"/> <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="process_id" ref="account.process_process_invoiceprocess0"/>
<field name="subflow_id" ref="process_process_salesprocess0"/> <field name="subflow_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/> <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="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_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;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Sale Order Requisition&quot;&quot;&quot;" name="name"/> <field eval="&quot;&quot;&quot;Sales 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;Drives procurement orders for every sales order line.&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="process_process_salesprocess0"/> <field name="subflow_id" ref="process_process_salesprocess0"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/> <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"/> <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 name="model_id" ref="sale.model_sale_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/> <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;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 name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/> <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/> <field eval="0" name="flow_start"/>
@ -55,7 +55,7 @@
<field name="menu_id" ref="sale.menu_sale_order"/> <field name="menu_id" ref="sale.menu_sale_order"/>
<field name="model_id" ref="sale.model_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;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 eval="&quot;&quot;&quot;Drives procurement and invoicing&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_salesprocess0"/> <field name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='manual'&quot;&quot;&quot;" name="model_states"/> <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 name="model_id" ref="procurement.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/> <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;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="subflow_id" ref="procurement.process_process_procurementprocess0"/>
<field name="process_id" ref="process_process_salesprocess0"/> <field name="process_id" ref="process_process_salesprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='confirmed'&quot;&quot;&quot;" name="model_states"/> <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"> <record id="process_transition_confirmquotation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/> <field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirm Quotation&quot;&quot;&quot;" name="name"/> <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="target_node_id" ref="process_node_saleorder0"/>
<field model="process.node" name="source_node_id" ref="process_node_quotation0"/> <field model="process.node" name="source_node_id" ref="process_node_quotation0"/>
<field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/> <field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/>
@ -145,7 +145,7 @@
<record id="process_transition_saleprocurement0" model="process.transition"> <record id="process_transition_saleprocurement0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/> <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;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="target_node_id" ref="process_node_saleprocurement0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleorder0"/> <field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
</record> </record>
@ -153,7 +153,7 @@
<record id="process_transition_packing0" model="process.transition"> <record id="process_transition_packing0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/> <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;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="target_node_id" ref="process_node_packinglist0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleprocurement0"/> <field model="process.node" name="source_node_id" ref="process_node_saleprocurement0"/>
</record> </record>
@ -186,15 +186,15 @@
<record id="process_transition_saleorderprocurement0" model="process.transition"> <record id="process_transition_saleorderprocurement0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/> <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;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="target_node_id" ref="procurement.process_node_procureproducts0"/>
<field model="process.node" name="source_node_id" ref="process_node_saleorderprocurement0"/> <field model="process.node" name="source_node_id" ref="process_node_saleorderprocurement0"/>
</record> </record>
<record id="process_transition_saleinvoice0" model="process.transition"> <record id="process_transition_saleinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/> <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;From a sales 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;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="target_node_id" ref="account.process_node_draftinvoices0"/>
<field model="process.node" name="source_node_id" ref="process_node_order0"/> <field model="process.node" name="source_node_id" ref="process_node_order0"/>
</record> </record>

View File

@ -56,7 +56,7 @@ class product_product(osv.osv):
'pricelist_sale':fields.function( 'pricelist_sale':fields.function(
_pricelist_calculate, _pricelist_calculate,
method=True, method=True,
string='Sale Pricelists', string='Sales Pricelists',
store=True, store=True,
type="text"), type="text"),
'pricelist_purchase':fields.function( 'pricelist_purchase':fields.function(

View File

@ -30,7 +30,7 @@ import netsvc
class sale_shop(osv.osv): class sale_shop(osv.osv):
_name = "sale.shop" _name = "sale.shop"
_description = "Sale Shop" _description = "Sales Shop"
_columns = { _columns = {
'name': fields.char('Shop Name', size=64, required=True), 'name': fields.char('Shop Name', size=64, required=True),
'payment_default_id': fields.many2one('account.payment.term', 'Default Payment Term', 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): class sale_order(osv.osv):
_name = "sale.order" _name = "sale.order"
_description = "Sale Order" _description = "Sales Order"
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
if context is None: if context is None:
@ -206,7 +206,7 @@ class sale_order(osv.osv):
'name': fields.char('Order Reference', size=64, required=True, 'name': fields.char('Order Reference', size=64, required=True,
readonly=True, states={'draft': [('readonly', False)]}, select=True), readonly=True, states={'draft': [('readonly', False)]}, select=True),
'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)]}), '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), 'client_order_ref': fields.char('Customer Reference', size=64),
'state': fields.selection([ 'state': fields.selection([
('draft', 'Quotation'), ('draft', 'Quotation'),
@ -217,41 +217,41 @@ class sale_order(osv.osv):
('invoice_except', 'Invoice Exception'), ('invoice_except', 'Invoice Exception'),
('done', 'Done'), ('done', 'Done'),
('cancel', 'Cancelled') ('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)]}), '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"), '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 sale order is confirmed"), '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), '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_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_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': 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?"""), '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([ 'order_policy': fields.selection([
('prepaid', 'Payment Before Delivery'), ('prepaid', 'Payment Before Delivery'),
('manual', 'Shipping & Manual Invoice'), ('manual', 'Shipping & Manual Invoice'),
('postpaid', 'Invoice on Order After Delivery'), ('postpaid', 'Invoice On Order After Delivery'),
('picking', 'Invoice from Delivery'), ('picking', 'Invoice From The Picking'),
], 'Shipping Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, ], 'Shipping Policy', required=True, readonly=True, states={'draft': [('readonly', False)]},
help="""The Shipping Policy is used to synchronise invoice and delivery operations. 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 '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 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."""), - 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"), '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 sale 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)]}), '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)."), '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 sale order"), '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 sale order has been delivered. This field is updated only after the scheduler have been launched !"), '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'), '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_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoiced': fields.function(_invoiced, method=True, string='Paid', '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'), 'note': fields.text('Notes'),
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount', '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': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 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', 'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Taxes',
store = { store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), '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), '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', 'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Total',
store = { store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), '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), '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'), 'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'), '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) '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 = { _defaults = {
'picking_policy': 'direct', 'picking_policy': 'direct',
'date_order': lambda *a: time.strftime('%Y-%m-%d'), 'date_order': lambda *a: time.strftime('%Y-%m-%d'),
'order_policy': 'manual',
'state': 'draft', 'state': 'draft',
'user_id': lambda obj, cr, uid, context: uid, 'user_id': lambda obj, cr, uid, context: uid,
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'), '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']: if s['state'] in ['draft', 'cancel']:
unlink_ids.append(s['id']) unlink_ids.append(s['id'])
else: 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) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
def onchange_shop_id(self, cr, uid, ids, shop_id): 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_delete(uid, 'sale.order', inv_id, cr)
wf_service.trg_create(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): 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) self.log(cr, uid, id, message)
return True return True
@ -393,7 +393,7 @@ class sale_order(osv.osv):
#FIXME: the method should return the list of invoices created (invoice_ids) #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 # 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... # workflow and I suppose it expects a single id...
def _inv_get(self, cr, uid, order, context=None): def _inv_get(self, cr, uid, order, context=None):
if context is 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) journal_ids = journal_obj.search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)], limit=1)
if not journal_ids: if not journal_ids:
raise osv.except_osv(_('Error !'), 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 a = order.partner_id.property_account_receivable.id
pay_term = order.payment_term and order.payment_term.id or False 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) 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: if vals:
self.pool.get('sale.order.line').write(cr, uid, [line.id], vals, context=context) 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': if order.state == 'invoice_except':
self.write(cr, uid, [order.id], {'state': 'progress'}, context=context) 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: for pick in sale.picking_ids:
if pick.state not in ('draft', 'cancel'): if pick.state not in ('draft', 'cancel'):
raise osv.except_osv( raise osv.except_osv(
_('Could not cancel sale order !'), _('Could not cancel sales order !'),
_('You must first cancel all picking attached to this sale order.')) _('You must first cancel all picking attached to this sales order.'))
for r in self.read(cr, uid, ids, ['picking_ids']): for r in self.read(cr, uid, ids, ['picking_ids']):
for pick in r['picking_ids']: for pick in r['picking_ids']:
wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr) wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr)
for inv in sale.invoice_ids: for inv in sale.invoice_ids:
if inv.state not in ('draft', 'cancel'): if inv.state not in ('draft', 'cancel'):
raise osv.except_osv( raise osv.except_osv(
_('Could not cancel this sale order !'), _('Could not cancel this sales order !'),
_('You must first cancel all invoices attached to this sale order.')) _('You must first cancel all invoices attached to this sales order.'))
for r in self.read(cr, uid, ids, ['invoice_ids']): for r in self.read(cr, uid, ids, ['invoice_ids']):
for inv in r['invoice_ids']: for inv in r['invoice_ids']:
wf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_cancel', cr) 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], sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
{'state': 'cancel'}) {'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.log(cr, uid, sale.id, message)
self.write(cr, uid, ids, {'state': 'cancel'}) self.write(cr, uid, ids, {'state': 'cancel'})
return True return True
@ -618,7 +618,7 @@ class sale_order(osv.osv):
else: else:
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')}) 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]) 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) self.log(cr, uid, o.id, message)
return True return True
@ -857,11 +857,11 @@ class sale_order_line(osv.osv):
return res return res
_name = 'sale.order.line' _name = 'sale.order.line'
_description = 'Sale Order Line' _description = 'Sales Order Line'
_columns = { _columns = {
'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}), '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)]}), '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)]}), '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), '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), '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'), 'notes': fields.text('Notes'),
'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}), '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, '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. \ help='* The \'Draft\' state is set when the related sales order in draft state. \
\n* The \'Confirmed\' state is set when the related sale order is confirmed. \ \n* The \'Confirmed\' state is set when the related sales order is confirmed. \
\n* The \'Exception\' state is set when the related sale order is set as exception. \ \n* The \'Exception\' state is set when the related sales order is set as exception. \
\n* The \'Done\' state is set when the sale order line has been picked. \ \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 sale order related.'), \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'), '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'), '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)]}), '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 = {} context = {}
for line in self.browse(cr, uid, ids, context=context): for line in self.browse(cr, uid, ids, context=context):
if line.invoiced: 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: for move_line in line.move_ids:
if move_line.state != 'cancel': if move_line.state != 'cancel':
raise osv.except_osv( raise osv.except_osv(
_('Could not cancel sale order line!'), _('Could not cancel sales order line!'),
_('You must first cancel stock moves attached to this sale order line.')) _('You must first cancel stock moves attached to this sales order line.'))
return self.write(cr, uid, ids, {'state': 'cancel'}) return self.write(cr, uid, ids, {'state': 'cancel'})
def button_confirm(self, cr, uid, ids, context=None): 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, 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): lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
if not partner_id: 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 = {} warning = {}
product_uom_obj = self.pool.get('product.uom') product_uom_obj = self.pool.get('product.uom')
partner_obj = self.pool.get('res.partner') partner_obj = self.pool.get('res.partner')
@ -1151,7 +1151,7 @@ class sale_order_line(osv.osv):
warning = { warning = {
'title': 'No Pricelist !', 'title': 'No Pricelist !',
'message': '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.' 'Please set one before choosing a product.'
} }
else: else:
@ -1187,10 +1187,10 @@ class sale_order_line(osv.osv):
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
if context is None: if context is None:
context = {} 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): for rec in self.browse(cr, uid, ids, context=context):
if rec.state not in ['draft', 'cancel']: 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) return super(sale_order_line, self).unlink(cr, uid, ids, context=context)
sale_order_line() sale_order_line()
@ -1213,7 +1213,7 @@ class sale_config_picking_policy(osv.osv_memory):
'step': fields.selection([ 'step': fields.selection([
('one', 'Delivery Order Only'), ('one', 'Delivery Order Only'),
('two', 'Picking List & Delivery Order') ('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 "\ help="By default, OpenERP is able to manage complex routing and paths "\
"of products in your warehouse and partner locations. This will configure "\ "of products in your warehouse and partner locations. This will configure "\
"the most common and simple methods to deliver products to the customer "\ "the most common and simple methods to deliver products to the customer "\

View File

@ -5,7 +5,7 @@
Requests Links Requests Links
--> -->
<record id="req_link_sale_order" model="res.request.link"> <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> <field name="object">sale.order</field>
</record> </record>

View File

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

View File

@ -33,28 +33,28 @@
<field name="type">make_to_stock</field> <field name="type">make_to_stock</field>
</record> </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"/> <test expr="sum([l.price_subtotal for l in order_line]) == amount_untaxed"/>
</assert> </assert>
<workflow action="order_confirm" model="sale.order" ref="test_order_1"/> <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> <test expr="state">manual</test>
</assert> </assert>
<workflow action="manual_invoice" model="sale.order" ref="test_order_1" uid="base.user_root"/> <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> <test expr="state">progress</test>
</assert> </assert>
<!-- Treat generated invoice --> <!-- 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"/> <test expr="len(invoice_ids) == 1"/>
</assert> </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_untaxed == amount_untaxed"/>
<test expr="invoice_ids[0].amount_total == amount_total"/> <test expr="invoice_ids[0].amount_total == amount_total"/>
<test expr="invoice_ids[0].state">draft</test> <test expr="invoice_ids[0].state">draft</test>
@ -75,16 +75,16 @@
<value eval="ref('account.bank_journal')"/> <value eval="ref('account.bank_journal')"/>
</function> </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> <test expr="invoice_ids[0].state">paid</test>
</assert> </assert>
<!-- Treat generated picking --> <!-- 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"/> <test expr="len(picking_ids) == 1"/>
</assert> </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].address_id == partner_shipping_id"/>
<!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT --> <!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT -->
</assert> </assert>
@ -94,7 +94,7 @@
<value eval="[obj(ref('test_order_1')).picking_ids[0].id]" model="sale.order"/> <value eval="[obj(ref('test_order_1')).picking_ids[0].id]" model="sale.order"/>
</function> </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> <test expr="picking_ids[0].state">assigned</test>
</assert> </assert>
@ -107,14 +107,14 @@
<value eval="obj(ref('test_order_1')).picking_ids[0].id" model="sale.order"/> <value eval="obj(ref('test_order_1')).picking_ids[0].id" model="sale.order"/>
</workflow> </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> <test expr="picking_ids[0].state">done</test>
</assert> </assert>
<!-- Run all schedulers --> <!-- Run all schedulers -->
<function model="procurement.order" name="run_scheduler"/> <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> <test expr="state">done</test>
</assert> </assert>
</data> </data>

View File

@ -14,7 +14,7 @@
<field name="model">sale.shop</field> <field name="model">sale.shop</field>
<field name="type">form</field> <field name="type">form</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Sale Shop"> <form string="Sales Shop">
<field name="name" select="1"/> <field name="name" select="1"/>
<field name="warehouse_id" required="1" select="1" widget="selection"/> <field name="warehouse_id" required="1" select="1" widget="selection"/>
<field name="company_id" widget='selection' groups="base.group_multi_company"/> <field name="company_id" widget='selection' groups="base.group_multi_company"/>
@ -30,7 +30,7 @@
<field name="model">sale.shop</field> <field name="model">sale.shop</field>
<field name="type">tree</field> <field name="type">tree</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Sale Shop"> <tree string="Sales Shop">
<field name="name"/> <field name="name"/>
<field name="warehouse_id"/> <field name="warehouse_id"/>
<field name="pricelist_id"/> <field name="pricelist_id"/>
@ -122,7 +122,7 @@
groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" /> groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<newline/> <newline/>
<field colspan="4" mode="tree,form,graph" name="order_line" nolabel="1" widget="one2many_list"> <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> <notebook>
<page string="Order Line"> <page string="Order Line">
<field colspan="4" <field colspan="4"
@ -245,8 +245,9 @@
<field colspan="4" name="note" nolabel="1"/> <field colspan="4" name="note" nolabel="1"/>
</page> </page>
<page string="History" groups="base.group_extended"> <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'}"/> <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"/> <field colspan="4" name="picking_ids" nolabel="1"/>
</page> </page>
</notebook> </notebook>
@ -430,7 +431,7 @@
<field name="order_partner_id"/> <field name="order_partner_id"/>
<field name="product_id"/> <field name="product_id"/>
<field name="salesman_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> </field>
<newline/> <newline/>
<group expand="context.get('report',False)" string="Group By..." colspan="9" col="8"> <group expand="context.get('report',False)" string="Group By..." colspan="9" col="8">
@ -474,7 +475,7 @@
<field name="order_partner_id"/> <field name="order_partner_id"/>
<field name="product_id"/> <field name="product_id"/>
<field name="salesman_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> </field>
<newline /> <newline />
<group expand="0" string="Group By..." colspan="9" col="8"> <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): class stock_move(osv.osv):
_inherit = 'stock.move' _inherit = 'stock.move'
_columns = { _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): 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): class stock_picking(osv.osv):
_inherit = 'stock.picking' _inherit = 'stock.picking'
_columns = { _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 = { _defaults = {
'sale_id': False 'sale_id': False

View File

@ -49,7 +49,7 @@
</record> </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"> <record id="stock_picking_out_inherit_sale" model="ir.ui.view">
<field name="name">Outgoing picking Inherited</field> <field name="name">Outgoing picking Inherited</field>

View File

@ -25,7 +25,7 @@ import netsvc
class sale_order_line_make_invoice(osv.osv_memory): class sale_order_line_make_invoice(osv.osv_memory):
_name = "sale.order.line.make.invoice" _name = "sale.order.line.make.invoice"
_description = "Sale OrderLine Make_invoice" _description = "Sales OrderLine Make_invoice"
def make_invoices(self, cr, uid, ids, context): def make_invoices(self, cr, uid, ids, context):
""" """
To make invoices. 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'}) sales_order_obj.write(cr, uid, [line.order_id.id], {'state': 'progress'})
if not invoices: 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 {} return {}

View File

@ -2,7 +2,7 @@
<openerp> <openerp>
<data> <data>
<record id="view_sale_order_line_make_invoice" model="ir.ui.view"> <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="model">sale.order.line.make.invoice</field>
<field name="type">form</field> <field name="type">form</field>
<field name="arch" type="xml"> <field name="arch" type="xml">

View File

@ -24,7 +24,7 @@ import netsvc
class sale_make_invoice(osv.osv_memory): class sale_make_invoice(osv.osv_memory):
_name = "sale.make.invoice" _name = "sale.make.invoice"
_description = "Sale Make Invoice" _description = "Sales Make Invoice"
_columns = { _columns = {
'grouped': fields.boolean('Group the invoices', help='Check the box to group the invoices for the same customers'), 'grouped': fields.boolean('Group the invoices', help='Check the box to group the invoices for the same customers'),
'invoice_date': fields.date('Invoice Date'), 'invoice_date': fields.date('Invoice Date'),
@ -39,7 +39,7 @@ class sale_make_invoice(osv.osv_memory):
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) order = self.pool.get('sale.order').browse(cr, uid, record_id)
if order.state == 'draft': 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 return False
def make_invoices(self, cr, uid, ids, context={}): def make_invoices(self, cr, uid, ids, context={}):

View File

@ -23,7 +23,7 @@ from tools.translate import _
class sale_advance_payment_inv(osv.osv_memory): class sale_advance_payment_inv(osv.osv_memory):
_name = "sale.advance.payment.inv" _name = "sale.advance.payment.inv"
_description = "Sale Advance Payment Invoice" _description = "Sales Advance Payment Invoice"
_columns = { _columns = {
'product_id': fields.many2one('product.product', 'Advance Product', required=True, '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."), 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': if sale.order_policy == 'postpaid':
raise osv.except_osv( raise osv.except_osv(
_('Error'), _('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'.")) that is defined as 'Automatic Invoice after delivery'."))
val = obj_lines.product_id_change(cr, uid, [], sale_adv_obj.product_id.id, 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) 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): class sale_open_invoice(osv.osv_memory):
_name = "sale.open.invoice" _name = "sale.open.invoice"
_description = "Sale Open Invoice" _description = "Sales Open Invoice"
def open_invoice(self, cr, uid, ids, context=None): 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 """ """ Make sale order for crm """
_name = "crm.make.sale" _name = "crm.make.sale"
_description = "Make sale" _description = "Make sales"
def _selectPartner(self, cr, uid, context=None): def _selectPartner(self, cr, uid, context=None):
""" """
@ -61,9 +61,9 @@ class crm_make_sale(osv.osv_memory):
@param self: The object pointer @param self: The object pointer
@param cr: the current row, from the database cursor, @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks, @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 @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: if not context:
context = {} context = {}

View File

@ -24,7 +24,7 @@
'version': '1.0', 'version': '1.0',
'category': 'Generic Modules/Sales & Purchases', 'category': 'Generic Modules/Sales & Purchases',
'description': """ '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. sales and deliveries (picking lists) between different journals.
This module is very helpful for bigger companies that This module is very helpful for bigger companies that
works by departments. works by departments.

View File

@ -27,7 +27,7 @@
This module provides features to improve the layout of the Sales Order. This module provides features to improve the layout of the Sales Order.
It gives you the possibility to 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 * add titles, comment lines, sub total lines
* draw horizontal lines and put page breaks * draw horizontal lines and put page breaks

View File

@ -102,7 +102,7 @@ class sale_order_line(osv.osv):
return super(sale_order_line, self).copy(cr, uid, id, default, context) return super(sale_order_line, self).copy(cr, uid, id, default, context)
_order = "order_id, sequence asc" _order = "order_id, sequence asc"
_description = "Sale Order line" _description = "Sales Order line"
_inherit = "sale.order.line" _inherit = "sale.order.line"
_columns = { _columns = {
'layout_type': fields.selection([ 'layout_type': fields.selection([

View File

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

View File

@ -64,7 +64,7 @@ class sale_order(osv.osv):
return result return result
_columns = { _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() sale_order()

View File

@ -25,7 +25,7 @@
'version': '1.0', 'version': '1.0',
'category': 'Generic Modules/Sales & MRP', 'category': 'Generic Modules/Sales & MRP',
'description': """ '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 at a time. It is basically used when we want to keep track of production
orders generated from sales order. orders generated from sales order.
It adds sales name and sales Reference on production order It adds sales name and sales Reference on production order

View File

@ -26,7 +26,7 @@ class mrp_production(osv.osv):
_inherit = 'mrp.production' _inherit = 'mrp.production'
def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context=None): 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 field_names: Names of fields.
@param arg: User defined arguments @param arg: User defined arguments
@return: Dictionary of values. @return: Dictionary of values.
@ -72,8 +72,8 @@ class mrp_production(osv.osv):
return res return res
_columns = { _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_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='Sale Reference', help='Indicate the Customer Reference from sale 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() mrp_production()

View File

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

View File

@ -54,9 +54,9 @@ class sale_order_dates(osv.osv):
return res return res
_columns = { _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"), '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"), '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"), '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() sale_order_dates()