*added sale_wizard.xml in the update_xml tag of terp file

*added a transition in workflow of sale_order + modify the wizard of invoicing line (wizard_sale_line_invoice.py) so that if all the lines of a sale_order have been 
invoiced, its state is set to 'progress' and the workflow is updated
*added a button on form view of sale_order_line in the form view of sale_order, to call the wizard for invoicing that line (visible only if the line is in 'confirmed' 
state)
*added a domain on Sales Management/Sales Order Lines/Uninvoiced Lines to filer on state <> 'draft' and state <> 'cancell'
*added a menuitem to see all the sale_order_lines

bzr revid: qdp-9fc9639961f28893e202d48b532e453c584c6679
This commit is contained in:
qdp 2008-06-02 10:04:30 +00:00
parent fbcaf6a3f2
commit 7e13a86621
4 changed files with 40 additions and 14 deletions

View File

@ -24,10 +24,11 @@
- delivery costs
""",
"update_xml" : [
"sale_workflow.xml",
"sale_sequence.xml",
"sale_data.xml",
"sale_wizard.xml",
"sale_view.xml",
"sale_report.xml",
"sale_wizard.xml",

View File

@ -113,6 +113,7 @@
<field name="tax_id" colspan="4"/>
<separator string="States" colspan="4"/>
<field name="state" select="2"/>
<button name="%(wizard_sale_order_line_invoice)d" string="Make Invoice" states="confirmed" type="action" colspan="2"/>
<field name="invoiced" select="2"/>
</page>
<page string="Extra Info">
@ -245,10 +246,10 @@
<field name="view_mode">tree,form</field>
<field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
</record>
<menuitem
name="Sales Management/Sales Order/All Sales Order/Sales in Progress"
<menuitem
name="Sales Management/Sales Order/All Sales Order/Sales in Progress"
sequence="2"
id="menu_action_order_tree4"
id="menu_action_order_tree4"
action="action_order_tree4"/>
@ -260,9 +261,9 @@
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
</record>
<menuitem
name="Sales Management/Sales Order/All Sales Order/All Quotations"
id="menu_action_order_tree5"
<menuitem
name="Sales Management/Sales Order/All Sales Order/All Quotations"
id="menu_action_order_tree5"
sequence="1"
action="action_order_tree5"/>
@ -294,10 +295,10 @@
<field name="view_mode">tree,form</field>
<field name="domain">[('state','in',('progress','waiting_date','manual')),('user_id','=',uid)]</field>
</record>
<menuitem
name="Sales Management/Sales Order/My Sales Order/My Sales in Progress"
<menuitem
name="Sales Management/Sales Order/My Sales Order/My Sales in Progress"
sequence="2"
id="menu_action_order_tree9"
id="menu_action_order_tree9"
action="action_order_tree9"/>
@ -351,7 +352,7 @@
<field name="model">sale.order.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales order lines">
<form string="Sales Order Lines">
<notebook>
<page string="Order Lines">
<separator string="Automatic Declaration" colspan="4"/>
@ -360,7 +361,7 @@
<field name="product_uom_qty" readonly="1" select="2"/>
<field name="product_uom" readonly="2"/>
<field name="product_id" readonly="1" select="1"/>
<separator string="Manual Designation" colspan="4"/>
<field name="name" colspan="4" select="2"/>
<field name="price_unit" select="2"/>
@ -404,7 +405,7 @@
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoiced','&lt;&gt;', 1)]</field>
<field name="domain">[('invoiced','&lt;&gt;', 1),('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]</field>
</record>
<menuitem name="Sales Management/Sales Order Lines/Uninvoiced Lines" id="menu_action_order_line_tree2" action="action_order_line_tree2"/>
@ -418,6 +419,15 @@
</record>
<menuitem name="Sales Management/Sales Order Lines/Uninvoiced Lines/Uninvoiced &amp; Delivered Lines" id="menu_action_order_line_tree3" action="action_order_line_tree3"/>
<record model="ir.actions.act_window" id="action_order_line_tree4">
<field name="name">All Sale Order Lines</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Sales Management/Sales Order Lines/All Sale Order Lines" id="menu_action_order_line_tree4" action="action_order_line_tree4"/>
<act_window name="Sales"
domain="[('partner_id', '=', active_id)]"
context="{'partner_id': active_id}"

View File

@ -138,13 +138,18 @@
<field name="signal">cancel</field>
</record>
<record model="workflow.transition" id="trans_wait_invoice_all_lines_invoiced">
<field name="act_from" ref="act_wait_invoice"/>
<field name="act_to" ref="act_invoice_end"/>
<field name="signal">all_lines</field>
</record>
<record model="workflow.transition" id="trans_router_wait_invoice_shipping">
<field name="act_from" ref="act_wait_invoice"/>
<field name="act_to" ref="act_invoice_end"/>
<field name="condition">(order_policy=='picking')</field>
</record>
<record model="workflow.transition" id="trans_router_wait_invoice">
<field name="act_from" ref="act_router"/>
<field name="act_to" ref="act_wait_invoice"/>

View File

@ -82,6 +82,16 @@ def _makeInvoices(self, cr, uid, data, context):
invoices[line.order_id.id].append((line, lid))
pool.get('sale.order.line').write(cr, uid, [line.id],
{'invoiced': True})
flag = True
data_sale = pool.get('sale.order').browse(cr,uid,line.order_id.id)
for line in data_sale.order_line:
if not line.invoiced:
flag = False
break
if flag:
wf_service = netsvc.LocalService('workflow')
wf_service.trg_validate(uid, 'sale.order', line.order_id.id, 'all_lines', cr)
pool.get('sale.order').write(cr,uid,[line.order_id.id],{'state' : 'progress'})
for result in invoices.values():
order = result[0][0].order_id