[FIX] procurement view
authorFabien Pinckaers <fp@openerp.com>
Sun, 4 Aug 2013 13:52:18 +0000 (15:52 +0200)
committerFabien Pinckaers <fp@openerp.com>
Sun, 4 Aug 2013 13:52:18 +0000 (15:52 +0200)
bzr revid: fp@openerp.com-20130804135218-70dnybxxkwrcmyu7

addons/procurement/procurement.py
addons/procurement/procurement_view.xml

index 11d36ae..6282336 100644 (file)
@@ -148,6 +148,10 @@ class procurement_order(osv.osv):
             return {'value': v}
         return {}
 
+    def cancel(self, cr, uid, ids, context=None):
+        self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
+        return True
+
     def run(self, cr, uid, ids, context=None):
         for procurement in self.browse(cr, uid, ids, context=context):
             if self._assign(cr, uid, procurement, context=context):
index ffb3642..e2cd899 100644 (file)
             <field name="arch" type="xml">
                 <form string="Procurement" version="7.0">
                     <header>
-                        <button name="run" states="confirmed,exception" string="Run Procurement" class="oe_highlight"/>
-                        <button name="check" states="running" string="Check Procurement" class="oe_highlight"/>
-                        <button name="cancel" states="exception,confirmed,running" string="Cancel Procurement"/>
+                        <button name="run" states="confirmed,exception" string="Run Procurement" class="oe_highlight" type="object"/>
+                        <button name="check" states="running" string="Check Procurement" class="oe_highlight" type="object"/>
+                        <button name="cancel" states="exception,confirmed,running" string="Cancel Procurement" type="object"/>
                         <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed" />
                     </header>
                     <sheet>
-                    <label for="product_id" class="oe_edit_only"/>
-                    <h1>
-                        <field name="product_id" on_change="onchange_product_id(product_id)"/>
-                    </h1>
-                    <label for="product_qty" class="oe_edit_only"/>
-                    <h2>
-                        <div>
-                            <field name="product_qty" class="oe_inline"/>
-                            <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
-                        </div>
-                    </h2>
-                    <field name="name" placeholder="External note..."/>
                     <group>
                         <group>
+                            <field name="product_id" on_change="onchange_product_id(product_id)"/>
+                            <label for="product_qty" class="oe_edit_only"/>
+                            <div>
+                                <div>
+                                    <field name="product_qty" class="oe_inline"/>
+                                    <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
+                                </div>
+                            </div>
+                            <label for="product_uos_qty" groups="product.group_uos"/>
+                            <div groups="product.group_uos">
+                                <field name="product_uos_qty" class="oe_inline"/>
+                                <field name="product_uos" class="oe_inline"/>
+                            </div>
+                        </group>
+                        <group>
+                            <field name="rule_id"/>
                             <field name="date_planned"/>
                             <field name="priority"/>
+                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                         </group>
                         <group>
-                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                            <field name="group_id"/>
                             <field name="origin" class="oe_inline" placeholder="e.g. SO005"/>
                         </group>
                     </group>
                     <notebook>
                         <page string="Extra Information">
-                            <group>
-                                <label for="product_uos_qty" groups="product.group_uos"/>
-                                <div groups="product.group_uos">
-                                    <field name="product_uos_qty" class="oe_inline"/>
-                                    <field name="product_uos" class="oe_inline"/>
-                                </div>
-                            </group>
+                            <label for="name" class="oe_edit_only"/>
+                            <field name="name" placeholder="External note..."/>
+                            <label for="message" class="oe_edit_only"/>
+                            <field name="message"/>
                         </page>
                     </notebook>
                     </sheet>
         </record>
 
         <record id="procurement_exceptions" model="ir.actions.act_window">
-            <field name="name">Procurement Exceptions</field>
+            <field name="name">Procurements</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">procurement.order</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
-            <field name="context">{'search_default_perm_exceptions':1}</field>
+            <field name="context">{}</field>
             <field name="search_view_id" ref="view_procurement_filter"/>
             <field name="help" type="html">
                 <p>