[REM,MOVE,IMP] sale:

sale/test/invoice_on_shipped_qty.yml => sale/test/ui/make_advance_invoice.yml
  sale/test/manual_order_policy.yml => sale/test/ui/sale_make_invoice.yml
  sale/test/so_make_invoice.yml => sale/test/ui/sale_line_invoice.yml
remove : make_invoice_advance.yml
add this moved files in __openerp__.py

bzr revid: dbr@tinyerp.com-20111109060802-26ndnb358vfmhv3m
This commit is contained in:
DBR (OpenERP)
2011-11-09 11:38:02 +05:30
parent ebc3652060
commit 37094e10e1
7 changed files with 49 additions and 536 deletions
+4 -6
View File
@@ -88,15 +88,13 @@ Dashboard for Sales Manager that includes:
'test': [
'test/process/order_policy.yml',
'test/process/cancel_order.yml',
'test/ui/onchage_events.yml',
#'test/picking_order_policy.yml',
#'test/advance_invoice.yml',
#'test/so_make_line_invoice.yml',
#'test/sale_procurement.yml',
#'test/invoice_on_ordered_qty.yml',
'test/ui/make_invoice_advance.yml',
'test/ui/make_invoice_advance1.yml',
'test/ui/make_invoice_advance2.yml',
'test/ui/onchage_events.yml',
'test/ui/sale_make_invoice.yml',
'test/ui/make_advance_invoice.yml',
'test/ui/sale_line_invoice.yml',
'test/ui/delete_order.yml',
'test/ui/sale_report.yml',
],
-124
View File
@@ -1,124 +0,0 @@
-
In order to test the Sale module in OpenERP,
I create a Sale Order for Slider Mobile for 200 quantity having Shipping Policy 'Invoice from Picking' and Invoice on 'Shipped quantities'
-
!record {model: sale.order, id: sale_order_so6}:
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO006BIS
order_line:
- name: Slider Mobile
price_unit: 200
product_uom: product.product_uom_unit
product_uom_qty: 200.0
state: draft
delay: 7.0
product_id: sale.product_product_slidermobile0
product_uos_qty: 200.0
type: make_to_order
order_policy: picking
invoice_quantity: procurement
partner_id: sale.res_partner_cleartrail0
partner_invoice_id: sale.res_partner_address_2
partner_order_id: sale.res_partner_address_1
partner_shipping_id: sale.res_partner_address_3
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
I confirm the Sale Order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so6}
-
I verify that the picking has been generated for the sale order and I process it
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so6"))
assert so.picking_ids,"Picking has not been generated for sale_order_so6"
picking, = so.picking_ids
stock_partial_picking = self.pool.get('stock.partial.picking')
partial_id = stock_partial_picking.create(cr, uid, {},
context={'active_model': 'stock.picking',
'active_ids': [picking.id]})
# I change the qty to 100 for a partial delivery
partial = stock_partial_picking.browse(cr,uid,partial_id)
line_id = partial.move_ids[0].id
partial.write({'move_ids': [(1,line_id,{'quantity':100})]})
partial.do_partial()
-
Then I click on 'Create Invoices' button
-
!python {model: stock.invoice.onshipping}: |
import time
sale_obj = self.pool.get('sale.order')
sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6"))
ids = [x.id for x in sale_id.picking_ids if x.state == 'done']
wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')},
{'active_ids': ids, 'active_model': 'stock.picking'})
self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]})
-
I verify whether the invoice has been generated for SO
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so6"))
assert so.invoice_ids, "Invoices has not been generated for sale_order_so6"
-
I verify that an invoice is created on the basis of shipped quantities 100 not ordered quantities 200
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so6"))
picking_obj = self.pool.get('stock.picking')
ids = picking_obj.search(cr, uid, [('origin', '=', so.name),('type','=','out'),('state','=','done')])
qty = qty1 = 0.0
for pick_brw in picking_obj.browse(cr,uid, ids):
for lines in pick_brw.move_lines:
qty=lines.product_qty
inv_id = self.search(cr, uid, [('origin', 'like', so.name)])
inv_brw = self.browse(cr,uid,inv_id)[0]
for inv_lines in inv_brw.invoice_line:
qty1=inv_lines.quantity
assert (qty1 == qty), "Quantities are not the same: invoiced: %s, shipped: %s" % (qty1,qty)
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so6"))
import netsvc
wf_service = netsvc.LocalService("workflow")
invoice_ids = so.invoice_ids
for invoice in invoice_ids:
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
Assign analytic journal into bank journal
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
I pay the invoice
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so6"))
invoice_id = self.search(cr, uid, [('origin','like',so.name),('state','=','open')])
self.pay_and_reconcile(cr, uid, invoice_id,
40000.0, ref('account.cash'), ref('account.period_8'),
ref('sale.account_journal_bankjournal0'), ref('account.cash'),
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice are in paid state or not.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so6"))
invoice_ids = so.invoice_ids
for invoice in invoice_ids:
assert invoice.state=='paid', "Invoice for SO is not in done state."
-
I check that Paid has been set to true.
-
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so6"))
assert sale_id.invoiced == True, "Paid has not been set to true"
-261
View File
@@ -1,261 +0,0 @@
-
In order to test the Sale module in OpenERP,
I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice'
-
!record {model: sale.order, id: sale_order_so0}:
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO002
order_line:
- name: Slider Mobile
price_unit: 200
product_uom: product.product_uom_unit
product_uom_qty: 500.0
state: draft
delay: 7.0
product_id: sale.product_product_slidermobile0
product_uos_qty: 500.0
type: make_to_order
order_policy: manual
partner_id: sale.res_partner_cleartrail0
partner_invoice_id: sale.res_partner_address_2
partner_order_id: sale.res_partner_address_1
partner_shipping_id: sale.res_partner_address_3
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
I confirm the Sale Order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
-
I click on Create Invoice button to create the invoice.
-
!workflow {model: sale.order, action: manual_invoice, ref: sale_order_so0}
-
I verify whether the invoice has been generated for SO
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
import netsvc
wf_service = netsvc.LocalService("workflow")
invoice_ids = so.invoice_ids
for invoice in invoice_ids:
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
I verify that an invoice state has transit from draft to open state
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
invoice_id = self.search(cr, uid, [('origin','=',so.name),('state','=','open')])
assert invoice_id, "Invoice is not in the open state"
-
I verify that its Journal Entries has been created
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
invoice_id = self.search(cr, uid, [('origin','=',so.name),('state','=','open')])
inv_brw = self.browse(cr, uid, invoice_id)[0]
assert inv_brw.move_id, "Journal Entries has not been created"
-
Assign analytic journal into bank journal
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
I pay the invoice
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
invoice_id = self.search(cr, uid, [('origin','=',so.name),('state','=','open')])
self.pay_and_reconcile(cr, uid, invoice_id,
100000.0, ref('account.cash'), ref('account.period_8'),
ref('sale.account_journal_bankjournal0'), ref('account.cash'),
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice is in done state.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
invoice_id = self.search(cr, uid, [('origin','=',so.name),('state','=','paid')])
assert invoice_id, "Invoice for SO is not in done state."
-
I verify that Paid has been set to true.
-
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so0"))
assert(sale_id.invoiced == True), "Paid has not been set to true"
-
I verify that the picking has been generated for the sale order
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
assert so.picking_ids,"Picking has not been generated for sale_order_so0"
-
I verify that delivery order has been generated for sale order
-
!python {model: stock.picking }: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
picking_id = self.search(cr, uid, [('origin','=',so.name)])
assert(picking_id),"Delivery order has not been generated"
-
I verify that a procurement has been generated for so
-
!python {model: procurement.order}: |
from tools.translate import _
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
proc_ids = self.search(cr, uid, [('origin','=',so.name)])
assert(proc_ids),"No Procurements!"
-
Then I click on the "Run Procurement" button
-
!python {model: procurement.order}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
import netsvc
wf_service = netsvc.LocalService("workflow")
proc_ids = self.search(cr, uid, [('origin','=',so.name)])
for proc in proc_ids:
wf_service.trg_validate(uid, 'procurement.order',proc,'button_check', cr)
-
I verify that a procurement state is "running"
-
!python {model: procurement.order}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
proc_ids = self.search(cr, uid, [('origin','=',so.name),('state','in',['running','ready'])])
# should be running is 'purchase' is installed, else 'ready'
assert(proc_ids),"Procurement is not in running/ready state!"
-
I verify that a purchase order has been generated
-
!python {model: sale.order}: |
from tools.translate import _
modules = self.pool.get('ir.module.module')
mod_pur = modules.search(cr, uid, [('name','=','purchase')])
mod_brw = modules.browse(cr,uid,mod_pur)[0]
if(mod_brw.state == 'installed'):
so = self.browse(cr, uid, ref("sale_order_so0"))
pur_obj=self.pool.get('purchase.order')
pur_id=pur_obj.search(cr, uid, [('origin','=',so.name)])
assert(pur_id),"Purchase order has not been generated"
-
I click on the "Confirm" button to confirm the purchase order
-
!python {model: sale.order}: |
from tools.translate import _
modules = self.pool.get('ir.module.module')
mod_pur = modules.search(cr, uid, [('name','=','purchase')])
mod_brw = modules.browse(cr,uid,mod_pur)[0]
if(mod_brw.state == 'installed'):
pur_obj=self.pool.get('purchase.order')
so = self.browse(cr, uid, ref("sale_order_so0"))
import netsvc
wf_service = netsvc.LocalService("workflow")
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr)
-
I click on the "Approved by supplier" button to approve the purchase order
-
!python {model: sale.order}: |
from tools.translate import _
modules = self.pool.get('ir.module.module')
mod_pur = modules.search(cr, uid, [('name','=','purchase')])
mod_brw = modules.browse(cr,uid,mod_pur)[0]
if (mod_brw.state == 'installed'):
pur_obj = self.pool.get('purchase.order')
so = self.browse(cr, uid, ref("sale_order_so0"))
import netsvc
wf_service = netsvc.LocalService("workflow")
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
-
I verify that a picking related to purchase order has been generated and I process it
-
!python {model: sale.order}: |
modules = self.pool.get('ir.module.module')
mod_pur = modules.search(cr, uid, [('name','=','purchase')])
mod_brw = modules.browse(cr,uid,mod_pur)[0]
if (mod_brw.state == 'installed'):
pur_obj = self.pool.get('purchase.order')
so = self.browse(cr, uid, ref("sale_order_so0"))
pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)])
po = pur_obj.browse(cr, uid, pur_id)[0]
assert(po.picking_ids),"Picking for purchase order has not been generated"
picking, = po.picking_ids
stock_partial_picking = self.pool.get('stock.partial.picking')
partial_id = stock_partial_picking.create(cr, uid, {},
context={'active_model': 'stock.picking',
'active_ids': [picking.id]})
stock_partial_picking.do_partial(cr, uid, [partial_id])
-
I verify that picking for purchase order has been done.
-
!python {model: sale.order}: |
from tools.translate import _
modules = self.pool.get('ir.module.module')
mod_pur = modules.search(cr, uid, [('name','=','purchase')])
mod_brw = modules.browse(cr,uid,mod_pur)[0]
if(mod_brw.state == 'installed'):
pur_obj = self.pool.get('purchase.order')
so = self.browse(cr, uid, ref("sale_order_so0"))
pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)])
po = pur_obj.browse(cr, uid, pur_id)[0]
picking_obj = self.pool.get('stock.picking')
ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')])
assert(ids),"Picking is not in the done state!"
-
Then I process the picking
-
!python {model: stock.picking }: |
import time
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
pick.force_assign(cr, uid)
stock_partial_picking = self.pool.get('stock.partial.picking')
partial_id = stock_partial_picking.create(cr, uid, {},
context={'active_model': 'stock.picking',
'active_ids': [pick.id]})
stock_partial_picking.do_partial(cr, uid, [partial_id])
-
I verify that picking for sale order is in done state.
-
!python {model: stock.picking }: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
pick = self.browse(cr,uid,picking_id[0])
assert (pick.state) =='done', "Picking for SO is not in done state."
-
I verify that a "Picked" has been set to true
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
assert (so.shipped == True), "Picked has not been set to True"
-
I verify that a sale order is in done state
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
assert (so.state == 'done'), "Sale order is not in the done state."
-142
View File
@@ -1,142 +0,0 @@
-
In order to test the 'Make Invoices' wizard of sale module in the Open-ERP,
I create two Sale order,group them and create invoice.
-
I create a Sale Order for Slider Mobile for qty 100 having order_policy manual.
-
!record {model: sale.order, id: sale_order_so3}:
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO003
order_line:
- name: Slider Mobile
price_unit: 200.0
product_uom: product.product_uom_unit
product_uom_qty: 100.0
state: draft
delay: 7.0
product_id: sale.product_product_slidermobile0
product_uos_qty: 100.0
type: make_to_order
order_policy: manual
partner_id: sale.res_partner_cleartrail0
partner_invoice_id: sale.res_partner_address_2
partner_order_id: sale.res_partner_address_1
partner_shipping_id: sale.res_partner_address_3
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
I confirm the Sale Order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
-
I create a Sale Order for products Slider Mobile and LG Viewty Smart for qty 100 having order_policy manual.
-
!record {model: sale.order, id: sale_order_so4}:
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO004
order_line:
- name: Slider Mobile
price_unit: 200.0
product_uom: product.product_uom_unit
product_uom_qty: 100.0
state: draft
delay: 7.0
product_id: sale.product_product_slidermobile0
product_uos_qty: 100.0
type: make_to_order
- name: LG Viewty Smart
price_unit: 170.0
product_uom: product.product_uom_unit
product_uom_qty: 100.0
state: draft
delay: 7.0
product_id: sale.product_product_lgviewtysmart0
product_uos_qty: 100.0
th_weight: 0.0
type: make_to_order
order_policy: manual
partner_id: sale.res_partner_cleartrail0
partner_invoice_id: sale.res_partner_address_2
partner_order_id: sale.res_partner_address_1
partner_shipping_id: sale.res_partner_address_3
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
I confirm the Sale Order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so4}
-
Then I click on the "Make Invoices" button
-
!record {model: sale.make.invoice, id: sale_make_invoice_1}:
grouped: 1
invoice_date: !eval time.strftime('%Y-%m-%d')
-
Then I click on the "Create Invoices" button of wizard
-
!python {model: sale.make.invoice}: |
self.make_invoices(cr, uid, [ref("sale_make_invoice_1")], {"lang": 'en_US', "search_default_user_id":
1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("sale_order_so4"),ref("sale_order_so3")], "active_id":
ref("sale_order_so4")})
-
I verify that an invoice has been created
-
!python {model: account.invoice}: |
inv = self.search(cr, uid, [('origin','=','Test_SO004|Test_SO003|')])
assert inv, "Invoices has not been generated"
-
I verify that an account invoice line with origin 'Test_SO004' is created
-
!python {model: account.invoice.line}: |
sale_order_obj = self.pool.get('sale.order')
acc_inv_obj = self.pool.get('account.invoice')
inv = acc_inv_obj.search(cr, uid, [('origin','=','Test_SO004|Test_SO003|')])
so = sale_order_obj.browse(cr, uid, ref("sale_order_so4"))
inv_line = self.search(cr, uid, [('origin','=',so.name),('name','=','Slider Mobile'),('invoice_id','=',inv)])
assert inv_line, "Account invoice line has not been created"
-
I verify that an account invoice line with origin 'Test_SO003' is created
-
!python {model: account.invoice.line}: |
sale_order_obj = self.pool.get('sale.order')
acc_inv_obj = self.pool.get('account.invoice')
inv = acc_inv_obj.search(cr, uid, [('origin','=','Test_SO004|Test_SO003|')])
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
inv_line = self.search(cr, uid, [('origin','=',so.name),('name','=','Slider Mobile'),('invoice_id','=',inv)])
assert inv_line, "Account invoice line has not been created"
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
import netsvc
wf_service = netsvc.LocalService("workflow")
inv = self.search(cr, uid, [('origin','=','Test_SO004|Test_SO003|')])
for id in inv:
wf_service.trg_validate(uid, 'account.invoice',id,'invoice_open', cr)
-
I assign an analytic journal to the bank journal
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
I pay the invoice
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
invoice_id = self.search(cr, uid, [('origin','=',so.name),('state','=','open')])
self.pay_and_reconcile(cr, uid, invoice_id,
40000.0, ref('account.cash'), ref('account.period_5'),
ref('sale.account_journal_bankjournal0'), ref('account.cash'),
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='tst')
-
I verify the invoice is in Paid state
-
!python {model: account.invoice}: |
invoice_id = self.search(cr, uid, [('origin','=','Test_SO004|Test_SO003|'),('state','=','paid')])
assert invoice_id, "Invoice for SO is not in done state."
@@ -0,0 +1,30 @@
-
In order to test the pay invoices in advance wizard of sale module in the Open-ERP,
I take a Sale order and create invoice.
-
I create a record for pay advance invoice.
-
!record {model: sale.advance.payment.inv, id: sale_make_invoice_adv}:
product_id: product.product_product_pc1
amount: 100.0
-
Then I click on the "Advance Invoices" button.
-
!python {model: sale.advance.payment.inv}: |
context = {"lang": 'en_US', "search_default_user_id":1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("order5")], "active_id":ref("order5")}
self.create_invoices(cr, uid, [ref("sale_make_invoice_adv")], context)
self.pool.get('sale.open.invoice').open_invoice(cr, uid, [ref("sale_make_invoice_adv")], context)
-
I verify that an invoice has been created
-
!python {model: sale.order}: |
inv = self.browse(cr, uid, ref('order5')).invoice_ids
assert inv, "Invoices has not been generated"
-
I verify that an account invoice line with origin 'SO003' is created
-
!python {model: sale.order}: |
acc_inv_line = self.pool.get('account.invoice.line')
inv = self.browse(cr, uid, ref('order5')).invoice_ids
for line in inv:
assert line.invoice_line, "Account invoice line has not been created for order"
+11
View File
@@ -0,0 +1,11 @@
-
In order to test the 'Make Invoices' of sale oreder line wizard in the Open-ERP,
I take a Sale order line and create invoice.
-
I click on the "Make Invoices" button.
-
!python {model: sale.order.line.make.invoice}: |
context = {"lang": 'en_US', "search_default_user_id":1, "tz": False, "active_model": 'sale.order.line', "active_ids": [ref("order6_line1")], "active_id":ref("order6_line1")}
order_line = self.pool.get('sale.order.line').browse(cr, uid, ref('order6_line1'))
if order_line.invoiced == False:
self.make_invoices(cr, uid, [ref("order6_line1")], context)
@@ -10,13 +10,13 @@
-
!workflow {model: sale.order, action: order_confirm, ref: order5}
-
Then I click on the "Make Invoices" button
Then I create a record for make invoice.
-
!record {model: sale.make.invoice, id: sale_make_invoice_1}:
grouped: 1
invoice_date: !eval time.strftime('%Y-%m-%d')
-
Then I click on the "Create Invoices" button of wizard
Then I click on button of wizard for make invoice.
-
!python {model: sale.make.invoice}: |
context = {"lang": 'en_US', "search_default_user_id":1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("order3"),ref("order5")], "active_id":ref("order3")}
@@ -30,7 +30,7 @@
assert inv, "Invoices has not been generated"
assert inv1, "Invoices has not been generated"
-
I verify that an account invoice line with origin 'SO003' is created
I verify that an account invoice line is created.
-
!python {model: sale.order}: |
acc_inv_line = self.pool.get('account.invoice.line')
@@ -40,3 +40,4 @@
assert line.invoice_line, "Account invoice line has not been created for order3"
for line in inv1:
assert line.invoice_line, "Account invoice line has not been created for order5"