Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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...

Awatar
Odrzuć
Autor

Something like states="approved,done"

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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"/>

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 22
4295
1
cze 21
4053
3
lip 25
5570
1
lis 18
5091
1
mar 15
4841