[IMP]: improve progress bar from sale order line tree view.
bzr revid: atp@tinyerp.com-20120909173020-gljs3gss7ljm310w
This commit is contained in:
parent
4cd3b7cecb
commit
d630d3b6b6
|
@ -134,7 +134,6 @@
|
|||
<field name="date_order"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="invoiced_rate" widget="progressbar"/>
|
||||
<field name="amount_total" sum="Total Tax Included"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
|
|
@ -69,19 +69,24 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
""" create invoices for the active sale orders """
|
||||
if context is None:
|
||||
context = {}
|
||||
sale_obj = self.pool.get('sale.order')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
ir_property_obj = self.pool.get('ir.property')
|
||||
act_window = self.pool.get('ir.actions.act_window')
|
||||
fiscal_obj = self.pool.get('account.fiscal.position')
|
||||
wizard = self.browse(cr, uid, ids[0], context)
|
||||
sale_ids = context.get('active_ids', [])
|
||||
|
||||
if wizard.advance_payment_method == 'all':
|
||||
# create the final invoices of the active sale orders
|
||||
res = self.pool.get('sale.order').manual_invoice(cr, uid, sale_ids, context)
|
||||
res = sale_obj.manual_invoice(cr, uid, sale_ids, context)
|
||||
if context.get('open_invoices', False):
|
||||
return res
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
if wizard.advance_payment_method == 'lines':
|
||||
# open the list view of sale order lines to invoice
|
||||
act_window = self.pool.get('ir.actions.act_window')
|
||||
res = act_window.for_xml_id(cr, uid, 'sale', 'action_order_line_tree2', context)
|
||||
res['context'] = {
|
||||
'search_default_uninvoiced': 1,
|
||||
|
@ -91,9 +96,6 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
|
||||
assert wizard.advance_payment_method in ('fixed', 'percentage')
|
||||
|
||||
sale_obj = self.pool.get('sale.order')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
inv_ids = []
|
||||
|
||||
for sale in sale_obj.browse(cr, uid, sale_ids, context=context):
|
||||
|
@ -109,10 +111,10 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
|
||||
# determine and check income account
|
||||
if not wizard.product_id.id :
|
||||
prop = self.pool.get('ir.property').get(cr, uid,
|
||||
prop = ir_property_obj.get(cr, uid,
|
||||
'property_account_income_categ', 'product.category', context=context)
|
||||
prop_id = prop and prop.id or False
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, sale.fiscal_position.id or False, prop_id)
|
||||
account_id = fiscal_obj.map_account(cr, uid, sale.fiscal_position.id or False, prop_id)
|
||||
if not account_id:
|
||||
raise osv.except_osv(_('Configuration Error!'),
|
||||
_('There is no income account defined as global property.'))
|
||||
|
|
|
@ -682,6 +682,7 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
result = super(sale_advance_payment_inv, self).create_invoices(cr, uid, ids, context=context)
|
||||
sale_obj = self.pool.get('sale.order')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
sale_line_obj = self.pool.get('sale.order.line')
|
||||
wizard = self.browse(cr, uid, ids[0], context)
|
||||
sale_ids = context.get('active_ids', [])
|
||||
|
||||
|
@ -732,5 +733,5 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
'discount': False,
|
||||
'tax_id': res.get('invoice_line_tax_id'),
|
||||
}
|
||||
self.pool.get('sale.order.line').create(cr, uid, vals, context=context)
|
||||
sale_line_obj.create(cr, uid, vals, context=context)
|
||||
return result
|
||||
|
|
|
@ -28,18 +28,6 @@
|
|||
|
||||
<menuitem action="sale.action_shop_form" id="menu_action_shop_form" parent="base.menu_base_config" sequence="35" groups="stock.group_locations"/>
|
||||
|
||||
<record id="view_order_tree_sale_stock_inherit" model="ir.ui.view">
|
||||
<field name="name">sale.order.tree.sale.stock</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="user_id" position="after">
|
||||
<field name="picked_rate" widget="progressbar"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_order_form_inherit" model="ir.ui.view">
|
||||
<field name="name">sale.order.form.sale.stock</field>
|
||||
<field name="model">sale.order</field>
|
||||
|
|
Loading…
Reference in New Issue