Advertisement
nagyv

OpenERP set context from query in act_window definition

Jan 30th, 2012
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.93 KB | None | 0 0
  1.         <record id="purchase_urgent_filter" model="ir.ui.view">
  2.             <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
  3.             <field name="name">aperam.purchase.urgent.filter</field>                       
  4.             <field name="model">purchase.order</field>
  5.             <field name="type">search</field>
  6.             <field name="arch" type="xml">     
  7.           <filter name="approved" position="after">                
  8.             <filter string="Urgent" name="urgent" domain="[('urgent', '=', True)]"
  9.                     help="Show only urgent requests."/>
  10.             <filter string="To Order" name="to_order" domain="[('minimum_planned_date', '&lt;', context{'order_date'})]"
  11.                help="Requests to be ordered before the next sheduled date" />
  12.                 </filter>
  13.             </field>
  14.         </record>
  15.  
  16.         <record id="purchase.purchase_rfq" model="ir.actions.act_window">
  17.             <field name="name">Requests for Quotation</field>
  18.             <field name="type">ir.actions.act_window</field>
  19.             <field name="res_model">purchase.order</field>
  20.             <field name="view_type">form</field>
  21.             <field name="context" eval="{'search_default_draft': 1, 'order_date': self.pool.get('res.company').get_value(cr, uid, 'order_date', context)}" />
  22.             <field name="view_mode">tree,form,graph,calendar</field>
  23.             <field name="search_view_id" ref="purchase.view_purchase_order_filter"/>
  24.             <field name="help">You can create a request for quotation when you want to buy products to a supplier but the purchase is not confirmed yet. Use also this menu to review requests for quotation created automatically based on your logistic rules (minimum stock, MTO, etc). You can convert the request for quotation into a purchase order once the order is confirmed. If you use the extended interface (from user's preferences), you can select the way to control your supplier invoices: based on the order, based on the receptions or manual encoding.</field>
  25.         </record>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement