stock_move_description.yml 1.27 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-
    In order to test picking_line_description,
    I assign group_use_product_description_per_picking_line group to the admin user
-
  !python {model: res.users}: |
    self.write(
      cr, uid, [ref("base.user_root")],
      {'groups_id': [(4, ref("stock_move_description.group_use_product_description_per_stock_move"))]})
-
    I set the description field on the product 'USB Adapter'
-
  !python {model: product.product}: |
    self.write(
      cr, uid, [ref("product.product_product_48")], {'description': 'Wi-Fi Adapter'})
-
    Now i create an outgoing picking order that uses my product
-
    !record {model: stock.picking, id: stock_picking_out0}:
        partner_id: base.res_partner_2
        picking_type_id: stock.picking_type_out
        move_lines:
            - product_id: product.product_product_48
              product_uom_qty: 10
              location_id: stock.stock_location_stock
              location_dest_id: stock.stock_location_customers
-
    I verify that the onchange of product on move line was correctly triggered
-
    !assert {model: stock.picking, id: stock_picking_out0, string: The onchange function of product was not correctly triggered}:
        - move_lines[0].name == move_lines[0].product_id.description
        - move_lines[0].name == u'Wi-Fi Adapter'