Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
6651 Zobrazení

In OpenERP 7.0 i've noticed that in both the Sale Orders and Purchase Orders the button linking to the Shipment/Picking dissapears once the order is complete (In "Done" state, once the shipment has been sent and the invoice paid), and there is no way to see or open the associated Shipment/Picking from the Sale Orders and Purchase Orders, I have to mannually go to the Warehouse module and search there. I find this very counterproductive. 

Is this the normal behaviour? or a bug? I've even created a new  clean database to see if it was a problem with my production database, but I still run into the same problem...

Avatar
Zrušit
Autor

Something like states="approved,done"

Nejlepší odpověď

If you go to /addons/purchase/ there is a file called stock_view.xml and look for the code below in bold.

        <record id="purchase_order_2_stock_picking" model="ir.ui.view">
            <field name="name">Purchase Picking Inherited</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form"/>
            <field name="arch" type="xml">
                 <xpath expr="//div[contains(@class, 'oe_title')]" position="before">
                    <div class="oe_right oe_button_box" name="buttons">
                        <button type="object"
                            name="view_picking"
                            string="Incoming Shipments" states="approved"/>

                        <button type="object"  name="invoice_open"
                            string="Invoices" attrs="{'invisible': [('state', '=', 'draft')]}"/> 
                    </div>
                </xpath>
            </field>
        </record>

You can inherit this view and change the states in which it is shown.

Avatar
Zrušit
Autor Nejlepší odpověď

Just what I was looking for! Thanks Richmond!

For anyone else trying to figure out how to accomplish the same for Sale Orders, you must change the following line in:

model: sale.order

view: sale.order.form

inherit_id: sale_stock.view_order_form_inherit

from: 

<button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight" attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}" groups="base.group_user"/>

to: 

<button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight" attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual','done'))]}" groups="base.group_user"/>

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 22
4297
1
čvn 21
4053
3
čvc 25
5575
1
lis 18
5101
1
bře 15
4841