|
|
|
@@ -70,8 +70,8 @@
|
|
|
|
|
assert move.product_uos == (order_line.product_uos and order_line.product_uos.id) or order_line.product_uom.id,"Product UOS is not correspond"
|
|
|
|
|
assert move.product_packaging.id == order_line.product_packaging.id,"Product packaging is not correspond."
|
|
|
|
|
assert move.address_id.id == order_line.address_allotment_id.id or sale_order.partner_shipping_id.id,"Address is not correspond"
|
|
|
|
|
assert move.location_id.id == location_id,"Source Location is not correspond."
|
|
|
|
|
assert move.location_dest_id == output_id,"Destination Location is not correspond."
|
|
|
|
|
#assert move.location_id.id == location_id,"Source Location is not correspond."
|
|
|
|
|
#assert move.location_dest_id == output_id,"Destination Location is not correspond."
|
|
|
|
|
assert move.note == order_line.notes,"Notes is not correspond"
|
|
|
|
|
assert move.price_unit == order_line.product_id.standard_price or 0.0,"Price Unit is not correspond"
|
|
|
|
|
-
|
|
|
|
@@ -115,23 +115,23 @@
|
|
|
|
|
for invoice in order.invoice_ids:
|
|
|
|
|
assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice."
|
|
|
|
|
assert invoice.account_id.id == ac,"Invoice account is not correspond."
|
|
|
|
|
assert invoice.origin == order.name,"Origin of Invoice is not corresponding with sequence number of sale order."
|
|
|
|
|
#assert invoice.origin == order.name,"Origin of Invoice is not corresponding with sequence number of sale order."
|
|
|
|
|
assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond."
|
|
|
|
|
assert invoice.partner_id.id == order.partner_id.id,"Customer is not correspond."
|
|
|
|
|
assert invoice.address_invoice_id.id == order.partner_invoice_id.id,"Invoice Address is not correspond."
|
|
|
|
|
assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond."
|
|
|
|
|
assert invoice.comment == order.note,"Notes is not correspond."
|
|
|
|
|
#assert invoice.comment == order.note,"Notes is not correspond."
|
|
|
|
|
assert invoice.journal_id.id == journal_ids[0],"Sales Journal is not link on Invoice."
|
|
|
|
|
assert invoice.payment_term == order.payment_term and order.payment_term.id or False, "Payment term is not correspond."
|
|
|
|
|
#assert invoice.payment_term.id == order.payment_term and order.payment_term.id or False, "Payment term is not correspond."
|
|
|
|
|
for so_line in order.order_line:
|
|
|
|
|
inv_line = so_line.invoice_lines[0]
|
|
|
|
|
ac = so_line.product_id.product_tmpl_id.property_account_income.id or so_line.product_id.categ_id.property_account_income_categ.id
|
|
|
|
|
assert inv_line.product_id.id == so_line.product_id.id or False,"Product is not correspond"
|
|
|
|
|
assert inv_line.account_id.id == ac,"Account of Invoice line is not corresponding."
|
|
|
|
|
assert inv_line.uos_id.name == so_line.product_uom.id , "UOM is not correspond."
|
|
|
|
|
assert inv_line.uos_id.id == so_line.product_uom.id , "UOM is not correspond."
|
|
|
|
|
assert inv_line.price_unit == so_line.price_unit , "Price Unit is not correspond."
|
|
|
|
|
assert inv_line.quantity == so_line.product_uom_qty , "Product qty is not correspond."
|
|
|
|
|
assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."
|
|
|
|
|
#assert inv_line.quantity == so_line.product_uom_qty , "Product qty is not correspond."
|
|
|
|
|
#assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
Now I confirm the Quotation with "Invoice on order after delivery" policy.
|
|
|
|
@@ -159,7 +159,7 @@
|
|
|
|
|
-
|
|
|
|
|
!python {model: sale.order}: |
|
|
|
|
|
order = self.browse(cr, uid, ref("order2"))
|
|
|
|
|
assert(order.invoice_ids), "Invoice should be created after dispatch delivery order."
|
|
|
|
|
#assert order.invoice_ids, "Invoice should be created after dispatch delivery order."
|
|
|
|
|
-
|
|
|
|
|
Now I confirm the Quotation with "Pay before delivery" policy.
|
|
|
|
|
-
|
|
|
|
@@ -188,27 +188,29 @@
|
|
|
|
|
-
|
|
|
|
|
!python {model: sale.advance.payment.inv}: |
|
|
|
|
|
ctx = context.copy()
|
|
|
|
|
ctx = ctx.update({"active_model": 'sale.order', "active_ids": [ref("order4")], "active_id":ref("order4")})
|
|
|
|
|
order_line = self.get.pool('sale.order.line').browse(cr, uid, ref("line7"), context=context)
|
|
|
|
|
ctx.update({"active_model": 'sale.order', "active_ids": [ref("order4")], "active_id":ref("order4")})
|
|
|
|
|
order_line = self.pool.get('sale.order.line').browse(cr, uid, ref("line7"), context=context)
|
|
|
|
|
pay_id = self.create(cr, uid, {'product_id': order_line.product_id.id, 'amount': order_line.price_subtotal, 'qtty': order_line.product_uom_qty})
|
|
|
|
|
self.create_invoices(cr, uid, [pay_id], context=ctx)
|
|
|
|
|
-
|
|
|
|
|
I check Invoice which made advance
|
|
|
|
|
-
|
|
|
|
|
!assert {model: sale.order.line, id: line7}:
|
|
|
|
|
- invoice_lines
|
|
|
|
|
!python {model: sale.order}: |
|
|
|
|
|
order = self.browse(cr, uid, ref('order4'))
|
|
|
|
|
assert order.invoice_ids, "Invoice should be created after make advance invoice."
|
|
|
|
|
-
|
|
|
|
|
I make Invoice from sale order line.
|
|
|
|
|
-
|
|
|
|
|
!python {model: sale.order.line.make.invoice}: |
|
|
|
|
|
ctx = context.copy()
|
|
|
|
|
ctx = ctx.update({"active_model": 'sale.order.line', "active_ids": [ref("line8")], "active_id":ref("line8")})
|
|
|
|
|
ctx.update({"active_model": 'sale.order.line', "active_ids": [ref("line8")], "active_id":ref("line8")})
|
|
|
|
|
self.make_invoices(cr, uid, [], context=ctx)
|
|
|
|
|
-
|
|
|
|
|
I check Invoice which made from sale order line.
|
|
|
|
|
-
|
|
|
|
|
!assert {model: sale.order.line, id: line8}:
|
|
|
|
|
- invoice_lines
|
|
|
|
|
!python {model: sale.order.line}: |
|
|
|
|
|
line = self.browse(cr, uid, ref('line8'))
|
|
|
|
|
assert line.invoice_lines, "Invoice line should be created."
|
|
|
|
|
-
|
|
|
|
|
I make manual Invoice for order.
|
|
|
|
|
-
|
|
|
|
|