-
  In order to test the POS in module, To give business owners a convenient way of checking out customers and of recording sales.

-
  I  configure all details for the Customer, Salesman and Product, Account.
- 
  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: '0'
    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: Sale
    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.
- 
  !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
    sequence_id: account.sequence_purchase_journal
    type: purchase
    view_id: account.account_journal_view
- 
  I create Sale Journal.
- 
  !record {model: account.journal, id: account_journal_salejournal0}:
    code: SAJ
    company_id: base.main_company
    default_credit_account_id: account_account_sales0
    default_debit_account_id: account_account_sales0
    name: Sale Journal
    sequence_id: account.sequence_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
    sequence_id: account.sequence_journal
    type: cash
    view_id: account.account_journal_bank_view
- 
  I create 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 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 partner
- 
  !record {model: res.partner, id: res_partner_cleartrail0}:
    category_id:
      - res_partner_category_customers0
    name: Cleartrail
- 
  I create partner address.
- 
  !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 partner  invoice address.
- 
  !record {model: res.partner.address, id: res_partner_address_2}:
    partner_id: res_partner_cleartrail0
    type: invoice
- 
  I create partner delivery address.
- 
  !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
-
  I create product category.    
- 
  !record {model: product.category, id: product_category_allproductssellable0}:
    name: Mobile Products Sellable
-
   I create partner.
- 
  !record {model: res.partner, id: res_partner_microlinktechnologies0}:
    address:
      - street: Kailash Vaibhav, Parksite
    name: Micro Link Technologies
    property_account_payable: account_account_payable1
    property_account_receivable: account_account_receivable0   
    supplier: true        
-
  I create partner address .
- 
  !record {model: res.partner.address, id: res_partner_address_0}:
    country_id: base.in
    partner_id: res_partner_microlinktechnologies0
    street: Ash House, Ash Road
    title: base.res_partner_title_miss
- 
  I create product category .
- 
  !record {model: product.category, id: product_category_services0}:
    name: Mobile Services
- 
  I create product template .
- 
  !record {model: product.template, id: product_template_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
    standard_price: 160.0
    supply_method: produce
    type: product
    uom_id: product.product_uom_unit
    uom_po_id: product.product_uom_unit
-    
  I create product  LG Viewty Smart.
- 
  !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: account_account_payable1
    property_account_income: account_account_receivable0
    seller_delay: '1'
    standard_price: 160.0
    supply_method: produce
    type: product
    uom_id: product.product_uom_unit
    uom_po_id: product.product_uom_unit
-  
  I create product category .        
-
  !record {model: product.category, id: product_category_computer0}:
    name: Computer
- 
  I create product  HP Pavilion Desktop PCs
- 
  !record {model: product.product, id: product_product_hppaviliondesktoppcs0}:
    categ_id: product_category_computer0
    cost_method: standard
    mes_type: fixed
    list_price: 1000.0    
    name: HP Pavilion Desktop PCs
    procure_method: make_to_stock
    seller_ids:
      - delay: 1
        name: res_partner_microlinktechnologies0
        min_qty: 5.0
    supply_method: buy
    type: product
    uom_id: product.product_uom_unit
    uom_po_id: product.product_uom_unit
    property_account_expense: account_account_payable1
    property_account_income: account_account_receivable0
-  
  I create New Order by adding the details of Salesman and  "Product" as LG Viewty Smart Quantity as 10.
-
  !record {model: pos.order, id: pos_order_pos0}:
    company_id: base.main_company
    date_order: '2010-05-13 15:02:48'
    date_validity: '2010-11-13'
    lines:
      - company_id: base.main_company
        name: Order Line/01
        notice: No Discount
        product_id: product_product_lgviewtysmart0
        qty: 10.0
        qty_rfd: 0.0
    partner_id: base.res_partner_agrolait
    name: POS/001
    price_type: tax_excluded
    pricelist_id: product.list0
    sale_journal: account.sales_journal
    shop_id: sale.shop
    user_salesman_id: base.user_root
- 
  I add discount. 
- 
  !record {model: pos.discount, id: pos_discount_0}:
    discount: 5.0
    discount_notes: More then 5 product
- 
  I Apply the discount. 
- 
  !python {model: pos.discount}: |
    self.apply_discount(cr, uid, [ref("pos_discount_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id":
      ref("pos_order_pos0"), })
- 
  I open the register.
- 
  !record {model: pos.open.statement, id: pos_open_statement_0}:
    {}
- 
  I open the statement.
- 
  !python {model: pos.open.statement}: |
    self.open_statement(cr, uid, [ref("pos_open_statement_0")], {"lang": "en_US", "active_model":
      "ir.ui.menu", "active_ids": [ref("point_of_sale.menu_open_statement")], "tz":
      False, "active_id": ref("point_of_sale.menu_open_statement"), })
-
  I click on the "Make Payment" wizard.  
- 
  !record {model: pos.make.payment, id: pos_make_payment_0}:
    amount: 1615.0
    journal: 7
    payment_date: "2010-05-13"
    payment_name: Payment
    product_id: product_product_hppaviliondesktoppcs0
    pricelist_id: product.list0
    partner_id: base.res_partner_agrolait
- 
  I make the payment.
- 
  !python {model: pos.make.payment}: |
    self.check(cr, uid, [ref("pos_make_payment_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("point_of_sale.pos_order_pos0")], "tz":
      False, "active_id": ref("point_of_sale.pos_order_pos0"), })
-
  I check the Statement lines are created automatically when payment is done.
-
  !python {model: pos.order}: |
   order=self.browse(cr,uid,ref("pos_order_pos0"))
   assert(order.statement_ids!=[]), "Statement lines not created"    
-
  When I click on Return picking button , I get three option.
-
  1. Cancel 2.Return Goods and Exchange 3.Return without Refund
-
  When I click on  Return Goods and Exchange.  
-  
  Then it allows me to define the quantity of products, which will return to the stock. 
- 
  I click on Return Picking button.
- 
  !record {model: pos.return, id: pos_return_0}:
   {}
- 
  I Return the product.
- 
  !python {model: pos.return}: |
    self.create_returns(cr, uid, [ref("pos_return_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("point_of_sale.pos_order_pos0")], "tz":
      False, "active_id": ref("point_of_sale.pos_order_pos0"), })
- 
  Then it allows me to define the quantity of products, which will return to the stock.
-
  I select the  HP Pavilion Desktop PCs for exchange.   
- 
  !record {model: pos.add.product, id: pos_add_product_0}:
    product_id: product_product_hppaviliondesktoppcs0
    quantity: 5.0
-    
  I click on close button.
- 
  !python {model: pos.add.product}: |
    return_obj = self.pool.get('pos.return')
    context['active_ids'] = [ref("pos_order_pos0")] 
    return_obj.view_init(cr, uid, [],context=context)
    self.close_action(cr, uid, [ref("pos_add_product_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"),
      })
-    
  I create payment.
- 
  !record {model: pos.make.payment, id: pos_make_payment_1}:
    amount: 680.0
    journal: 7
    payment_date: "2010-05-13"
    payment_name: Payment
    product_id: product_product_hppaviliondesktoppcs0
    pricelist_id: product.list0
    partner_id: base.res_partner_agrolait
- 
  For payment, I click on  Make Payment. 
- 
  !python {model: pos.make.payment}: |
    self.check(cr, uid, [ref("pos_make_payment_1")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("pos_order_pos0")], "tz":
      False, "active_id": ref("pos_order_pos0"), })    
- 
  To check the Return without Refund . I click button "Return without Refund ".
- 
  !record {model: pos.return, id: pos_return_0}:
   {}
-
  The quantity which is selected in Return lines wizard is refunded.
- 
  !python {model: pos.return}: |
    self.create_returns2(cr, uid, [ref("pos_return_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("pos_order_pos0")], "tz":
      False, "active_id": ref("pos_order_pos0"), })
- 
  To Close order, I use the wizard "Sale Confirm".
- 
  !record {model: pos.confirm, id: pos_confirm_0}:
    {}
- 
  I close this order.
- 
  !python {model: pos.confirm}: |
    self.action_confirm(cr, uid, [ref("pos_confirm_0")], {"lang": "en_US", "active_model":
      "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"),
      })
- 
  I check order state is done.
- 
  !python {model: pos.order}: |
    order=self.browse(cr,uid,ref("pos_order_pos0"))    
    assert(order.state=='done'), "Order is not done"    
