diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index a081f963215..1f2d07a04ba 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -88,7 +88,6 @@ Dashboard for Sales Manager that includes: 'test': [ 'test/process/postpaid_order_policy.yml', 'test/ui/onchage_events.yml', - #'test/manual_order_policy.yml', #'test/prepaid_order_policy.yml', #'test/picking_order_policy.yml', #'test/advance_invoice.yml', @@ -96,6 +95,7 @@ Dashboard for Sales Manager that includes: #'test/sale_procurement.yml', #'test/invoice_on_ordered_qty.yml', #'test/invoice_on_shipped_qty.yml', + 'test/ui/delete_order.yml', 'test/ui/sale_report.yml', ], 'installable': True, diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index c6b5dd5fa6d..aabb57b6304 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -123,7 +123,6 @@ make_to_order 7 - diff --git a/addons/sale/test/data_test.yml b/addons/sale/test/data_test.yml deleted file mode 100644 index 0be8474754c..00000000000 --- a/addons/sale/test/data_test.yml +++ /dev/null @@ -1,257 +0,0 @@ -- - In order to test the sale module, I need to configure details regarding product,customer and account. -- - I am going to sell my Mobile products to the customer with name Cleartrail -- - I create View Account Type. -- - !record {model: account.account.type, id: account_account_type_view0}: - close_method: none - code: View - name: View - sign: 1 -- - I create Income Account Type. -- - !record {model: account.account.type, id: account_account_type_income0}: - close_method: unreconciled - code: Income - name: Income - sign: 1 -- - I create Expense Account Type. -- - !record {model: account.account.type, id: account_account_type_expense0}: - close_method: unreconciled - code: Expense - name: Expense - sign: 1 -- - I create Cash Account Type. -- - !record {model: account.account.type, id: account_account_type_cash0}: - close_method: balance - code: Cash - name: Cash - sign: 1 -- - I create Minimal Chart Account. -- - !record {model: account.account, id: account_account_minimalchart0}: - code: MC - company_id: base.main_company - currency_mode: current - name: Minimal Chart - parent_left: 1 - parent_right: 12 - type: view - user_type: account_account_type_view0 -- - I create Payable Account. -- - !record {model: account.account, id: account_account_payable1}: - code: AP - company_id: base.main_company - currency_mode: current - name: Payable - parent_id: account_account_minimalchart0 - parent_left: 2 - parent_right: 3 - reconcile: true - type: payable - user_type: account_account_type_expense0 -- - I create Receivable Account. -- - !record {model: account.account, id: account_account_receivable0}: - code: AR - company_id: base.main_company - currency_mode: current - name: Receivable - parent_id: account_account_minimalchart0 - parent_left: 4 - parent_right: 5 - reconcile: true - type: receivable - user_type: account_account_type_income0 -- - I create Cash Account. -- - !record {model: account.account, id: account_account_cash0}: - code: C - company_id: base.main_company - currency_mode: current - name: Cash - parent_id: account_account_minimalchart0 - parent_left: 6 - parent_right: 7 - type: other - user_type: account_account_type_cash0 -- - I create Purchases Account. -- - !record {model: account.account, id: account_account_purchases0}: - code: P - company_id: base.main_company - currency_mode: current - name: Purchases - parent_id: account_account_minimalchart0 - parent_left: 8 - parent_right: 9 - type: other - user_type: account_account_type_expense0 -- - I create Sales Account. -- - !record {model: account.account, id: account_account_sales0}: - code: S - company_id: base.main_company - currency_mode: current - name: Sales - parent_id: account_account_minimalchart0 - parent_left: 10 - parent_right: 11 - type: other - user_type: account_account_type_income0 -- - I create Purchase Journal - (test). -- - !record {model: account.journal, id: account_journal_purchasejournal0}: - code: PUJ - company_id: base.main_company - default_credit_account_id: account_account_purchases0 - default_debit_account_id: account_account_purchases0 - name: Purchase Journal - (test) - type: purchase - view_id: account.account_journal_view -- - I create Sale Journal. -- - !record {model: account.journal, id: account_journal_salejournal0}: - code: SJ - company_id: base.main_company - default_credit_account_id: account_account_sales0 - default_debit_account_id: account_account_sales0 - name: Sale Journal - type: sale - view_id: account.account_journal_view -- - I create Bank Journal. -- - !record {model: account.journal, id: account_journal_bankjournal0}: - code: BNK - company_id: base.main_company - default_credit_account_id: account_account_cash0 - default_debit_account_id: account_account_cash0 - name: Bank Journal - type: cash - view_id: account.account_journal_bank_view -- - I create ir.property for account payable. -- - !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}: - company_id: base.main_company - fields_id: account.field_res_partner_property_account_payable - name: property_account_expense_categ - value_reference: account.account,5 -- - I create ir.property for account receivable. -- - !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}: - company_id: base.main_company - fields_id: account.field_res_partner_property_account_receivable - name: property_account_income_categ - value_reference: account.account,6 -- - I create Partner category Customers. -- - !record {model: res.partner.category, id: res_partner_category_customers0}: - name: Customers -- - I create Cleartrail Customer. -- - !record {model: res.partner, id: res_partner_cleartrail0}: - category_id: - - res_partner_category_customers0 - name: Cleartrail -- - I create contact address for Cleartrail. -- - !record {model: res.partner.address, id: res_partner_address_1}: - partner_id: res_partner_cleartrail0 - street: onam plaza, 14 B palasia A B Road - type: contact -- - I create invoice address for Cleartrail. -- - !record {model: res.partner.address, id: res_partner_address_2}: - partner_id: res_partner_cleartrail0 - street: sarda house 24 B palasia, A B Road - type: invoice -- - I create delivery address for Cleartrail. -- - !record {model: res.partner.address, id: res_partner_address_3}: - partner_id: res_partner_cleartrail0 - street: sangam house 15 B palasia, A B Road - type: delivery -- - Customer Cleartrail has specific instrument requirement regarding the stockable products. -- - I define product category Mobile Products Sellable. -- - !record {model: product.category, id: product_category_allproductssellable0}: - name: Mobile Products Sellable -- - I define product category Mobile Services. -- - !record {model: product.category, id: product_category_services0}: - name: Mobile Services -- - - I define LG Viewty Smart product. -- - !record {model: product.product, id: product_product_lgviewtysmart0}: - categ_id: product_category_allproductssellable0 - cost_method: standard - list_price: 170.0 - mes_type: fixed - name: LG Viewty Smart - procure_method: make_to_order - property_account_expense: sale.account_account_payable1 - property_account_income: sale.account_account_receivable0 - seller_delay: '1' - seller_ids: - - delay: 1 - name: base.res_partner_agrolait - min_qty: 2.0 - qty: 5.0 - standard_price: 160.0 - supply_method: produce - type: product - uom_id: product.product_uom_unit - uom_po_id: product.product_uom_unit - -- - I define Slider Mobile. -- - !record {model: product.product, id: product_product_slidermobile0}: - categ_id: product_category_allproductssellable0 - cost_method: standard - list_price: 200 - mes_type: fixed - name: Slider Mobile - procure_method: make_to_order - property_account_expense: sale.account_account_payable1 - property_account_income: sale.account_account_receivable0 - seller_delay: '1' - seller_ids: - - delay: 1 - name: base.res_partner_agrolait - min_qty: 2.0 - qty: 5.0 - standard_price: 189.0 - supply_method: buy - type: product - uom_id: product.product_uom_unit - uom_po_id: product.product_uom_unit diff --git a/addons/sale/test/process/postpaid_order_policy.yml b/addons/sale/test/process/postpaid_order_policy.yml index 5a38638da52..01f1a997597 100644 --- a/addons/sale/test/process/postpaid_order_policy.yml +++ b/addons/sale/test/process/postpaid_order_policy.yml @@ -26,6 +26,16 @@ I confirm the Quotation4. - !workflow {model: sale.order, action: order_confirm, ref: order4} +- + After confirmed Quotation4, I create the Invoice for it because it's manual policy. +- + !workflow {model: sale.order, action: manual_invoice, ref: order4} +- + I check that Invoice created. +- + !python {model: sale.order}: | + so = self.browse(cr, uid, ref("order4")) + assert so.invoice_ids, "Invoices has not been generated for this sale order" - After confirmed Quotation, I check the Packing as well as Invoice created in related sale orders . - diff --git a/addons/sale/test/ui/delete_order.yml b/addons/sale/test/ui/delete_order.yml new file mode 100644 index 00000000000..9a1d23e0aba --- /dev/null +++ b/addons/sale/test/ui/delete_order.yml @@ -0,0 +1,23 @@ +- + In order to test to delete process on sale order. +- + I try to delete In progress order and check Error Message. +- + !python {model: sale.order}: | + try: + self.unlink(cr, uid, [ref("order7")]) + except Exception,e: + print e +- + I delete draft order. +- + !python {model: sale.order}: | + context.update({'active_id':ref('order')}) + id = self.copy(cr, uid, ref('order'), context) + self.unlink(cr, uid, [id]) +- + I delete cancelled order. +- + !python {model: sale.order}: | + self.action_cancel_draft(cr, uid, [ref("order5")]) + self.unlink(cr, uid, [ref("order5")]) diff --git a/addons/sale/test/ui/onchage_events.yml b/addons/sale/test/ui/onchage_events.yml index e9a3afbaefc..30b2491baef 100644 --- a/addons/sale/test/ui/onchage_events.yml +++ b/addons/sale/test/ui/onchage_events.yml @@ -15,6 +15,30 @@ - !python {model: sale.order}: | self.onchange_pricelist_id(cr, uid, [ref('order')], ref('product.list0'), [ref('line'),ref('line1'),ref('line12'),ref('line13')], context={}) +- + I call onchange event to change the policy of order. +- + !python {model: sale.order}: | + policy = 'picking' + self.shipping_policy_change(cr, uid, [ref('order')], policy, context=None) + +- + I call onchange event to change the UOS of ordered product. +- + !python {model: sale.order.line}: | + self.uos_change(cr, uid, [ref('line'),ref('line1'),ref('line12'),ref('line13')], ref('product.product_uom_unit'), product_uos_qty=0, product_id=None) + +- + I call onchange event to change the packaging of ordered product. +- + !python {model: sale.order.line}: | + self.product_packaging_change(cr, uid, [ref('line1')], ref('product.list0'), ref('product.product_product_pc1'), qty=0, uom=False,partner_id=False, packaging=False, flag=False, context=None) + +- + I call onchange event to change the UOM of ordered product. +- + !python {model: sale.order.line}: | + self.product_uom_change(cr, uid, [ref('line1')], ref('product.list0'), ref('product.product_product_pc1'), 0, ref('product.product_uom_unit'), 0, False, '', ref('base.res_partner_agrolait'), False, True, False, None) - I call onchange event to change the partner of order. - @@ -22,5 +46,3 @@ sale = True deli = False self.onchange_order(cr, uid, [ref('order')], sale, deli, context=None) - -