[IMP] sale:-wizard in the action of list view and changes in the yaml
bzr revid: mtr@mtr-20100928114624-s4zukca2g5ea0dt8
This commit is contained in:
@@ -841,13 +841,6 @@ class sale_order_line(osv.osv):
|
||||
'product_packaging': False
|
||||
}
|
||||
|
||||
def create_sale_order_line_invoice(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
context.update({'active_ids' : ids,'active_id' : ids})
|
||||
self.pool.get('sale.order.line.make.invoice').make_invoices(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
@@ -157,10 +157,10 @@
|
||||
<field name="invoiced"/>
|
||||
<group attrs="{'invisible':[('invoiced','=',True)]}">
|
||||
<button colspan="1"
|
||||
name="create_sale_order_line_invoice"
|
||||
name="%(action_view_sale_order_line_make_invoice)d"
|
||||
states="confirmed"
|
||||
string="Create Invoice"
|
||||
type="object"
|
||||
string="Make Invoices"
|
||||
type="action"
|
||||
icon="terp-document-new" />
|
||||
</group>
|
||||
</group>
|
||||
@@ -403,9 +403,9 @@ to your configuration: from the sales order, from the pickings, etc.
|
||||
<field name="state"/>
|
||||
<group col="3" colspan="2">
|
||||
<button colspan="1"
|
||||
name="create_sale_order_line_invoice"
|
||||
string="Create Invoice"
|
||||
type="object"
|
||||
name="%(action_view_sale_order_line_make_invoice)d"
|
||||
string="Make Invoice"
|
||||
type="action"
|
||||
icon="terp-document-new"
|
||||
attrs="{'invisible': ['|',('state', 'in', ('draft','cancel')),('invoiced', '=', 1)]}"/>
|
||||
<button name="button_cancel"
|
||||
|
||||
@@ -41,15 +41,20 @@
|
||||
-
|
||||
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
|
||||
-
|
||||
I click on the "Create Invoice" button of sale order line
|
||||
I click on the "Make Invoice" button of sale order line
|
||||
-
|
||||
!record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_0}:
|
||||
{}
|
||||
-
|
||||
I click on the "Create Invoice" button of wizard
|
||||
-
|
||||
!python {model: sale.order.line}: |
|
||||
!python {model: sale.order.line.make.invoice}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
|
||||
sol = so.order_line[0]
|
||||
self.create_sale_order_line_invoice(cr, uid, [sol.id], {"lang": "en_US",
|
||||
"tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale.menu_invoicing_sales_order_lines")],
|
||||
"search_default_uninvoiced": 1, "active_id": ref("sale.menu_invoicing_sales_order_lines"),
|
||||
self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang": "en_US",
|
||||
"tz": False, "active_model": "sale.order.line", "active_ids": [sol.id],
|
||||
"search_default_uninvoiced": 1, "active_id": sol.id,
|
||||
})
|
||||
-
|
||||
I verify that "Invoiced" has been set to True.
|
||||
@@ -115,17 +120,20 @@
|
||||
sale_id=self.browse(cr, uid, ref("sale_order_so3"))
|
||||
assert(sale_id.invoiced == True), "Paid has not been set to true"
|
||||
-
|
||||
I click on the "Create Invoice" button of sale order and verify that it gives a warning message
|
||||
I create an invoice for another sale order line. I click on the "Make Invoice" button of sale order line
|
||||
-
|
||||
I create an invoice for another sale order line. I click on the "Create Invoice" button of sale order line
|
||||
-
|
||||
!python {model: sale.order.line}: |
|
||||
!record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_1}:
|
||||
{}
|
||||
-
|
||||
I click on the "Create Invoice" button of wizard
|
||||
-
|
||||
!python {model: sale.order.line.make.invoice}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
|
||||
sol = so.order_line[1]
|
||||
self.create_sale_order_line_invoice(cr, uid, [sol.id], {"lang": "en_US",
|
||||
"tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale.menu_invoicing_sales_order_lines")],
|
||||
"search_default_uninvoiced": 1, "active_id": ref("sale.menu_invoicing_sales_order_lines"),
|
||||
self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_1")], {"lang": "en_US",
|
||||
"tz": False, "active_model": "sale.order.line", "active_ids": [sol.id],
|
||||
"search_default_uninvoiced": 1, "active_id": sol.id,
|
||||
})
|
||||
-
|
||||
I verify that invoice for sale order line has been created.
|
||||
|
||||
@@ -20,7 +20,18 @@
|
||||
<field name="res_model">sale.order.line.make.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_sale_order_line_make_invoice"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="sale_order_line_make_invoice">
|
||||
<field name="model_id" ref="sale.model_sale_order_line" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Make Invoices</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_view_sale_order_line_make_invoice'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">sale.order.line</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -24,8 +24,18 @@
|
||||
<field name="res_model">sale.make.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_sale_order_make_invoice"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.values" id="sale_order_make_invoice">
|
||||
<field name="model_id" ref="sale.model_sale_order" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Make Invoices</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_sale_order_make_invoice'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">sale.order</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user