[FIX] sale: in a sale order, if a line is created with only a description, no product, the system must propose direclty to create the final invoice whatever the invoicing policy
bzr revid: hmo@tinyerp.com-20120906131310-pzx34w7fcu8j28zy
This commit is contained in:
parent
56efd70c53
commit
5e2d868790
|
@ -582,6 +582,13 @@ class sale_order(osv.osv):
|
||||||
result.update(view_id = res and res[1] or False)
|
result.update(view_id = res and res[1] or False)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def test_no_product(self, cr, uid, ids, *args):
|
||||||
|
for order in self.browse(cr, uid, ids):
|
||||||
|
for line in order.order_line:
|
||||||
|
if line.product_id:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
|
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
|
||||||
res = False
|
res = False
|
||||||
invoices = {}
|
invoices = {}
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
<button name="action_button_confirm" states="draft" string="Confirm" type="object"/>
|
<button name="action_button_confirm" states="draft" string="Confirm" type="object"/>
|
||||||
<button name="action_button_confirm" states="sent" string="Confirm" class="oe_highlight" type="object"/>
|
<button name="action_button_confirm" states="sent" string="Confirm" class="oe_highlight" type="object"/>
|
||||||
<button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
|
<button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
|
||||||
attrs="{'invisible': ['|','|',('state', '!=','progress'), ('invoiced', '=', True),('order_policy','=','picking')]}"/>
|
attrs="{'invisible': ['|','|',('state', '!=','progress'), ('invoiced', '=', True),('order_policy','=','picking')]}"/> <!-- ('invoice_ids','=',[]) should be work-->
|
||||||
<button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight"
|
<button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight"
|
||||||
attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
|
attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
|
||||||
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
|
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
<record id="trans_router_wait_invoice_shipping" model="workflow.transition">
|
<record id="trans_router_wait_invoice_shipping" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_wait_invoice"/>
|
<field name="act_from" ref="act_wait_invoice"/>
|
||||||
<field name="act_to" ref="act_invoice_end"/>
|
<field name="act_to" ref="act_invoice_end"/>
|
||||||
<field name="condition">(order_policy=='picking')</field>
|
<field name="condition">(order_policy=='picking') and (not test_no_product())</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="trans_router_wait_invoice" model="workflow.transition">
|
<record id="trans_router_wait_invoice" model="workflow.transition">
|
||||||
|
@ -196,7 +196,7 @@
|
||||||
<record id="trans_wait_invoice_invoice" model="workflow.transition">
|
<record id="trans_wait_invoice_invoice" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_wait_invoice"/>
|
<field name="act_from" ref="act_wait_invoice"/>
|
||||||
<field name="act_to" ref="act_invoice"/>
|
<field name="act_to" ref="act_invoice"/>
|
||||||
<field name="condition">(order_policy=='prepaid')</field>
|
<field name="condition">(order_policy=='prepaid') or test_no_product()</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="trans_wait_invoice_invoice_manual" model="workflow.transition">
|
<record id="trans_wait_invoice_invoice_manual" model="workflow.transition">
|
||||||
|
|
Loading…
Reference in New Issue