[IMP] sale order view
bzr revid: fp@openerp.com-20120713225131-f5l8w42u34rvqpa4
This commit is contained in:
parent
84c2888dde
commit
8f95b17d27
|
@ -726,7 +726,7 @@ class sale_order(osv.osv):
|
|||
self.cancel_send_note(cr, uid, [sale.id], context=None)
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
return True
|
||||
|
||||
|
||||
def action_button_confirm(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
|
@ -1017,7 +1017,7 @@ class sale_order(osv.osv):
|
|||
if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
# ------------------------------------------------
|
||||
# OpenChatter methods and notifications
|
||||
# ------------------------------------------------
|
||||
|
@ -1107,7 +1107,7 @@ class sale_order_line(osv.osv):
|
|||
_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)]}),
|
||||
'name': fields.text('Product 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 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),
|
||||
|
@ -1127,7 +1127,7 @@ class sale_order_line(osv.osv):
|
|||
'product_uos': fields.many2one('product.uom', 'Product UoS'),
|
||||
'product_packaging': fields.many2one('product.packaging', 'Packaging'),
|
||||
'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True),
|
||||
'discount': fields.float('Discount (%)', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'discount': fields.float('Discount', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'number_packages': fields.function(_number_packages, type='integer', string='Number Packages'),
|
||||
'notes': fields.text('Notes'),
|
||||
'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
|
@ -1382,8 +1382,6 @@ class sale_order_line(osv.osv):
|
|||
uos = False
|
||||
else:
|
||||
uos = False
|
||||
if product_obj.description_sale:
|
||||
result['notes'] = product_obj.description_sale
|
||||
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
||||
if update_tax: #The quantity only have changed
|
||||
result['delay'] = (product_obj.sale_delay or 0.0)
|
||||
|
@ -1392,6 +1390,8 @@ class sale_order_line(osv.osv):
|
|||
|
||||
if not flag:
|
||||
result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
|
||||
if product_obj.description_sale:
|
||||
result['name'] += '\n'+product_obj.description_sale
|
||||
domain = {}
|
||||
if (not uom) and (not uos):
|
||||
result['product_uom'] = product_obj.uom_id.id
|
||||
|
|
|
@ -189,61 +189,62 @@
|
|||
<field name="order_line">
|
||||
<form string="Sales Order Lines" version="7.0">
|
||||
<header>
|
||||
<button name="%(action_view_sale_order_line_make_invoice)d" states="confirmed" string="Invoice" type="action" icon="terp-document-new"/>
|
||||
<field name="invoiced" invisible="1"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
|
||||
</header>
|
||||
<group col="4" colspan="4">
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)"/>
|
||||
<field name="name" placeholder="Product/Service characteristics"/>
|
||||
</group>
|
||||
<group>
|
||||
<label for="product_uom_qty"/>
|
||||
<div>
|
||||
<field
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
name="product_uom_qty" class="oe_inline"
|
||||
name="product_uom_qty"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
|
||||
<field name="product_uom" groups="product.group_uom" class="oe_inline"
|
||||
<field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"
|
||||
on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, context)"/>
|
||||
|
||||
</div>
|
||||
<label for="product_uos_qty"/>
|
||||
<div>
|
||||
<field groups="product.group_uos" name="product_uos_qty" class="oe_inline"/>
|
||||
<field groups="product.group_uos" name="product_uos" class="oe_inline"/>
|
||||
<label for="product_uos_qty" groups="product.group_uos"/>
|
||||
<div groups="product.group_uos">
|
||||
<field name="product_uos_qty"/>
|
||||
<field name="product_uos" class="oe_inline oe_no_button"/>
|
||||
</div>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<label for="discount"/>
|
||||
<div>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/> %%
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_packaging"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)"
|
||||
domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging"
|
||||
colspan="3"/>
|
||||
<field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
|
||||
<field name="invoiced"/>
|
||||
<button name="%(action_view_sale_order_line_make_invoice)d" states="confirmed" string="Make Invoices" type="action" icon="terp-document-new"/>
|
||||
</group>
|
||||
<group col="4">
|
||||
<label for="delay"/>
|
||||
<div>
|
||||
<field name="delay"/> days
|
||||
</div>
|
||||
<field name="type"/>
|
||||
<field name="delay"/>
|
||||
<field name="th_weight"/>
|
||||
|
||||
<!-- we should put a config wizard for these two fields -->
|
||||
<field name="address_allotment_id"/>
|
||||
<field name="property_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<field name="notes" groups="base.group_sale_notes_subtotal" placeholder="Add a note on order line..."/>
|
||||
<div groups="base.group_no_one">
|
||||
<separator colspan="4" string="Invoice Lines"/>
|
||||
<field colspan="4" name="invoice_lines" nolabel="1"/>
|
||||
<separator colspan="4" string="Stock Moves"/>
|
||||
<field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
|
||||
</div>
|
||||
</group>
|
||||
<label for="name"/>
|
||||
<field name="name"/>
|
||||
<div groups="base.group_no_one">
|
||||
<label for="invoice_lines"/>
|
||||
<field name="invoice_lines"/>
|
||||
<label for="move_ids"/>
|
||||
<field name="move_ids" widget="many2many"/>
|
||||
</div>
|
||||
</form>
|
||||
<tree string="Sales Order Lines">
|
||||
<field name="sequence"/>
|
||||
|
|
Loading…
Reference in New Issue