[IMP] sale,warning: usability

This commit is contained in:
Randhir Mayatra
2014-10-15 09:43:37 +02:00
committed by Richard Mathot
parent 19c7bfb635
commit f34ea0bc54
4 changed files with 17 additions and 12 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
</div>
<div name="module_warning">
<field name="module_warning" class="oe_inline"/>
<label for="module_warning"/>
<label for="module_warning"/> <span class="oe_grey">Purchase and Warehouse Management will be installed</span>
</div>
<div>
<field name="group_sale_delivery_address" class="oe_inline"/>
@@ -31,17 +31,13 @@ class sale_advance_payment_inv(osv.osv_memory):
[('all', 'Invoice the whole sales order'), ('percentage','Percentage'), ('fixed','Fixed price (deposit)'),
('lines', 'Some order lines')],
'What do you want to invoice?', required=True,
help="""Use Invoice the whole sale order to create the final invoice.
Use Percentage to invoice a percentage of the total amount.
Use Fixed Price to invoice a specific amound in advance.
Use Some Order Lines to invoice a selection of the sales order lines."""),
help="""Use Invoice the whole sale order to create the final invoice.\nUse Percentage to invoice a percentage of the total amount.\nUse Fixed Price to invoice a specific amount in advance.\nUse Some Order Lines to invoice a selection of the sales order lines."""),
'qtty': fields.float('Quantity', digits=(16, 2), required=True),
'product_id': fields.many2one('product.product', 'Advance Product',
domain=[('type', '=', 'service')],
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'.\nYou may have to create it and set it as a default value on this field."),
'amount': fields.float('Advance Amount', digits_compute= dp.get_precision('Account'),
help="The amount to be invoiced in advance."),
help="The amount to be invoiced in advance. \nTaxes are not taken into account for advance invoices."),
}
def _get_advance_product(self, cr, uid, context=None):
+3 -3
View File
@@ -68,7 +68,7 @@ class sale_order(osv.osv):
'message': message,
}
if partner.sale_warn == 'block':
return {'value': {'partner_id': False}, 'warning': warning}
return {'value': {'partner_id': False, 'partner_invoice_id': False, 'partner_shipping_id':False, 'pricelist_id' : False}, 'warning': warning}
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
@@ -149,7 +149,7 @@ class account_invoice(osv.osv):
class stock_picking(osv.osv):
_inherit = 'stock.picking'
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
def onchange_partner_id(self, cr, uid, ids, partner_id=None, context=None):
if not partner_id:
return {}
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
@@ -166,7 +166,7 @@ class stock_picking(osv.osv):
if partner.picking_warn == 'block':
return {'value': {'partner_id': False}, 'warning': warning}
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context)
result = {}
if result.get('warning',False):
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message']
+10 -1
View File
@@ -59,6 +59,15 @@
</notebook>
</field>
</record>
<record id="stock_picking_form_view_inherit" model="ir.ui.view">
<field name="name">stock.picking.form.inherit</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet/group/group/field[@name='partner_id']" position="replace">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" />
</xpath>
</field>
</record>
</data>
</openerp>