SHARE
TWEET

Untitled

a guest Sep 19th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class shipment_by_line(models.Model):
  2.     _name = 'shipment.by.line'
  3.     _auto = False
  4.     _columns = {
  5.  
  6.     'container' : fields.char('Container', readonly=True),
  7.     'name' : fields.char('Name', readonly=True),
  8.     'product_id' : fields.integer('Product_id', readonly=True),
  9.     'date' : fields.datetime('Date', readonly=True),
  10.     'date_expected' : fields.datetime('Date_expected', readonly=True),
  11.     'receipt'  : fields.char('Receipt', readonly=True),
  12.     'quantity' : fields.integer('Quantity', readonly=True),
  13.     'quantity_received' : fields.float('Quantity_received', readonly=True)
  14.     }
  15.  
  16.     def init(self,cr):
  17.         tools.drop_view_if_exists(cr, 'shipment_by_line')
  18.         cr.execute("""
  19.            CREATE OR REPLACE VIEW shipment_by_line AS(
  20.  
  21.                    select
  22.                        purchase_order.partner_ref as container,
  23.                        stock_move.name as name,
  24.                        purchase_order.name as receipt,
  25.                        stock_move.product_id as product_id,
  26.                        stock_move.date as date,  
  27.                        stock_move.date_expected as date_expected,
  28.                        purchase_order_line.product_qty as quantity,
  29.                        purchase_order_line.qty_received as quantity_received,
  30.                        stock_move.id as id
  31.                    from
  32.                        purchase_order,
  33.                        procurement_group,
  34.                        stock_picking,
  35.                        stock_move,
  36.                        purchase_order_line
  37.                    where
  38.                        purchase_order.group_id = procurement_group.id
  39.                        and stock_picking.group_id = procurement_group.id
  40.                        and stock_move.picking_id = stock_picking.id    
  41.                        and purchase_order.partner_ref is not null                    
  42.  
  43.                    )
  44.  
  45.    """)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top