Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3608 Visualizzazioni

I need a way to create a new FORM view, for displaying the stock picking operations (similar to stock.picking.form), and to group the lines by -purchase_order.partner_ref- but I can't find a way to link my custom module to 2 modules and inherit the values to display.

Also, I'd like the lines of the form to be editable "onclick", like in stock.picking.form.

I'm using 9. Thanks to anybody who can help me find a solution.

I made a SQL tree view, but it's no use for what I'm trying to accomplish.


class shipment_by_line(models.Model):   
 _name = 'shipment.by.line' 
 _auto = False  
 _columns = {
    'container' : fields.char('Container', readonly=True),  
 'name' : fields.char('Name', readonly=True),    
'product_id' : fields.integer('Product_id', readonly=True),  
 'date' : fields.datetime('Date', readonly=True),    
'date_expected' : fields.datetime('Date_expected', readonly=True),    
 'receipt'  : fields.char('Receipt', readonly=True),  
 'quantity' : fields.integer('Quantity', readonly=True),   
 'quantity_received' : fields.float('Quantity_received', readonly=False)    }

    def init(self,cr):       
          tools.drop_view_if_exists(cr, 'shipment_by_line')        
          cr.execute("""            CREATE OR REPLACE VIEW shipment_by_line AS(               
 select                     
 substring(purchase_order.partner_ref,1,40) as container,      
 purchase_order.name as receipt,                    
 purchase_order_line.product_qty as quantity,       
 purchase_order_line.qty_received as quantity_received,   
 stock_move.product_id as product_id,      
 stock_move.name as name,                   
 stock_move.date as date,                     
 stock_move.date_expected as date_expected,       
 stock_move.id as id               
 from                    
 purchase_order,          
 procurement_group,         
 stock_picking,                   
 stock_move,                   
 purchase_order_line             
 where                 
 purchase_order.group_id = procurement_group.id         
 and stock_picking.group_id = procurement_group.id     
 and stock_move.picking_id = stock_picking.id               
 and purchase_order_line.order_id=purchase_order.id         
 and stock_move.purchase_line_id=purchase_order_line.id       
 and purchase_order.partner_ref is not null
            )
    """)


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
apr 21
9236
1
gen 17
18139
1
dic 16
6351
1
nov 16
4223
7
ago 19
6337