Skip to Content
Menu
This question has been flagged
3432 Views

I have odoo v13 installed, and after I worked on the sale order process, and revised the stock.picking, stock.move and account.move models, suddenly I find that the Receiving function disappears. There is no place for me to accept delivery of a purchase order. Could anyone helped me? I post the code in stock.picking, as I suspect that is where the problem is. Thank you!!

Stock.picking:

<?xml version="1.0"?>

<form string="Transfer">

                <header>

                    <field name="id" invisible="1"/>

                    <field name="is_locked" invisible="1"/>

                    <field name="show_mark_as_todo" invisible="1"/>

                    <field name="show_check_availability" invisible="1"/>

                    <field name="show_validate" invisible="1"/>

                    <field name="show_lots_text" invisible="1"/>

                    <field name="immediate_transfer" invisible="1"/>

                    <button name="action_confirm" attrs="{'invisible': [('show_mark_as_todo', '=', False)]}" string="Mark as Todo" type="object" class="oe_highlight" groups="base.group_user"/>

                    <button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}" string="Check Availability" type="object" class="oe_highlight" groups="base.group_user"/>

                    <button name="button_validate" attrs="{'invisible': ['|', ('state', 'in', ('waiting','confirmed')), ('show_validate', '=', False)]}" string="Validate" type="object" class="oe_highlight" groups="stock.group_stock_user"/>

                    <button name="button_validate" attrs="{'invisible': ['|', ('state', 'not in', ('waiting', 'confirmed')), ('show_validate', '=', False)]}" string="Validate" type="object" groups="stock.group_stock_user" class="o_btn_validate"/>

                    <button name="do_print_picking" string="Print" groups="stock.group_stock_user" type="object" attrs="{'invisible': ['|', ('state', 'not in', ('assigned', 'partially_available')), ('is_locked', '=', False)]}"/>

                    <button name="278" string="Print" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('is_locked', '=', False)]}" type="action" groups="base.group_user"/>

                    <button name="298" string="Return" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('is_locked', '=', False)]}" type="action" groups="base.group_user"/>

                    <button name="do_unreserve" string="Unreserve" groups="base.group_user" type="object" attrs="{'invisible': ['|', '|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), ('is_locked', '=', False), '&amp;', ('state', 'not in', ('assigned', 'partially_available')), ('move_type', '!=', 'one'), '&amp;', ('state', 'not in', ('assigned', 'partially_available', 'confirmed')), ('move_type', '=', 'one')]}"/>

                    <field name="show_operations" invisible="1" readonly="1"/>

                    <field name="show_reserved" invisible="1" readonly="1"/>

                    <field name="move_line_exist" invisible="1"/>

                    <field name="has_packages" invisible="1"/>

                    <button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', '|', '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&amp;', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done'), ('is_locked', '=', False)]}"/>

                    <button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('state', 'in', ('draft','cancel')), ('is_locked', '=', False)]}" string="Unlock" groups="stock.group_stock_manager" type="object" help="If the picking is unlocked you can edit initial demand (for a draft picking) or done quantities (for a done picking)."/>                    <button name="action_toggle_is_locked" attrs="{'invisible': [('is_locked', '=', True)]}" string="Lock" class="oe_highlight" groups="stock.group_stock_manager" type="object"/>

                    <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done"/>

                    <field name="picking_type_entire_packs" invisible="1"/>

                    <button name="action_cancel" attrs="{'invisible': ['|', ('state', 'not in', ('assigned', 'confirmed', 'partially_available', 'draft', 'waiting')), ('is_locked', '=', False)]}" string="Cancel" groups="base.group_user" type="object"/>

                </header>

                <sheet>

                    <div class="oe_button_box" name="button_box">

                        <field name="has_scrap_move" invisible="True"/>

                        <field name="has_tracking" invisible="True"/>

                        <button name="action_see_move_scrap" string="Scraps" type="object" class="oe_stat_button" icon="fa-arrows-v" attrs="{'invisible': [('has_scrap_move', '=', False)]}"/>

                        <button name="action_see_packages" string="Packages" type="object" class="oe_stat_button" icon="fa-cubes" attrs="{'invisible': [('has_packages', '=', False)]}"/>

                        <button name="274" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('has_tracking', '=', False)]}" groups="stock.group_production_lot"/>

                        <!-- Use the following button to avoid onchange on one2many -->

                        <button name="action_picking_move_tree" class="oe_stat_button" icon="fa-arrows-v" type="object" help="List view of operations" groups="base.group_no_one" attrs="{'invisible': ['|', '&amp;', ('show_operations', '=', True), '|', ('is_locked', '=', True), ('state', '=', 'done'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'picking_type_code': picking_type_code, 'default_picking_id': id, 'form_view_ref':'stock.view_move_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">

                            <div class="o_form_field o_stat_info">

                                <span class="o_stat_text">Operations</span>

                            </div>

                        </button>

                    </div>

                    <h1>

                        <field name="name" attrs="{'invisible': [('name','=','/')]}"/>

                    </h1>

                    <group>

                        <group>

                            <div class="o_td_label">

                                <label for="partner_id" string="Delivery Address" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', '!=', 'outgoing')]}"/>

                                <label for="partner_id" string="Receive From" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', '!=', 'incoming')]}"/>

                                <label for="partner_id" string="Contact" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', 'in', ['incoming', 'outgoing'])]}"/>

                            </div>

                            <field name="partner_id" nolabel="1"/>

                            <field name="picking_type_id" attrs="{'readonly': [('state', '!=', 'draft')]}"/>

                            <field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>

                            <field name="location_dest_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}"/>

                            <field name="backorder_id" attrs="{'invisible': [('backorder_id','=',False)]}"/>

                        </group>

                        <group>

                            <field name="scheduled_date" attrs="{'required': [('id', '!=', False)]}"/>

                            <field name="date_done" string="Effective Date" attrs="{'invisible': [('state', '!=', 'done')]}"/>

                            <field name="origin" placeholder="e.g. PO0032"/>

                            <field name="x_partner_ref"  options="{'no_create': True}" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'outgoing')]}"/>

                            <field name="x_client_order_ref" options="{'no_create': True}" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>

                            <field name="owner_id" groups="stock.group_tracking_owner" attrs="{'invisible': [('picking_type_code', '!=', 'incoming')]}"/>

                        </group>

                    </group>

                    <notebook>

                        <!-- Reservation hidden -->

                        <page string="Detailed Operations" attrs="{'invisible': ['|', ('show_operations', '=', False), ('show_reserved', '=', True)]}">

                            <field name="move_line_nosuggest_ids" attrs="{'readonly': ['|', '|', ('show_operations', '=', False), ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'tree_view_ref': 'stock.view_stock_move_line_detailed_operation_tree', 'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}"/>

                               <field name="package_level_ids_details" context="{'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}" attrs="{'readonly': [('state', '=', 'done')], 'invisible': ['|', ('picking_type_entire_packs', '=', False), ('show_operations', '=', False)]}"/>

                            <button class="oe_highlight" name="put_in_pack" type="object" string="Put in Pack" attrs="{'invisible': [('state', 'in', ('draft', 'done', 'cancel'))]}" groups="stock.group_tracking_lot"/>

                        </page>


                        <!-- Reservation displayed -->

                        <page string="Detailed Operations" attrs="{'invisible': ['|', ('show_operations', '=', False), ('show_reserved', '=', False)]}">

                            <field name="move_line_ids_without_package" attrs="{'readonly': ['|', '|', ('show_operations', '=', False), ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'tree_view_ref': 'stock.view_stock_move_line_detailed_operation_tree', 'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}"/>

                            <field name="package_level_ids_details" context="{'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}" attrs="{'readonly': [('state', '=', 'done')], 'invisible': ['|', ('picking_type_entire_packs', '=', False), ('show_operations', '=', False)]}"/>

                            <button class="oe_highlight" name="put_in_pack" type="object" string="Put in Pack" attrs="{'invisible': [('state', 'in', ('draft', 'done', 'cancel'))]}" groups="stock.group_tracking_lot"/>

                        </page>


                        <page string="Operations">

                            <field name="move_ids_without_package" mode="tree,kanban" attrs="{'readonly': ['&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_company_id': company_id, 'picking_type_code': picking_type_code, 'default_picking_id': id, 'form_view_ref':'stock.view_move_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">

                                <tree decoration-danger="not parent.immediate_transfer and state != 'done' and quantity_done &gt; reserved_availability and show_reserved_availability" decoration-muted="scrapped == True or state == 'cancel' or (state == 'done' and is_locked == True)" string="Stock Moves" editable="bottom">

                                    <field name="company_id" invisible="1"/>

                                    <field name="name" invisible="1"/>

                                    <field name="state" invisible="1" readonly="0"/>

                                    <field name="picking_type_id" invisible="1"/>

                                    <field name="location_id" invisible="1"/>

                                    <field name="location_dest_id" invisible="1"/>

                                    <field name="scrapped" invisible="1"/>

                                    <field name="picking_code" invisible="1"/>

                                    <field name="product_type" invisible="1"/>

                                    <field name="show_details_visible" invisible="1"/>

                                    <field name="show_reserved_availability" invisible="1"/>

                                    <field name="show_operations" invisible="1" readonly="1"/>

                                    <field name="additional" invisible="1"/>

                                    <field name="has_move_lines" invisible="1"/>

                                    <field name="is_locked" invisible="1"/>

                                    <field name="product_uom_category_id" invisible="1"/>

                                    <field name="has_tracking" invisible="1"/>

                                    <field name="display_assign_serial" invisible="1"/>

                                    <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'), ('additional', '=', False), ('has_move_lines', '=', True)]}"/>

                                    <field name="description_picking" string="Description" optional="hide"/>

                                    <field name="date_expected" optional="hide" domain="{'readonly': [('show_operations', '=', True), ('is_locked', '=', True)]}"/>

                                    <field name="is_initial_demand_editable" invisible="1"/>

                                    <field name="is_quantity_done_editable" invisible="1"/>

                                    <field name="product_uom_qty"  attrs="{'column_invisible': [('parent.immediate_transfer', '=', True)], 'readonly': ['|', ('is_initial_demand_editable', '=', False), '&amp;', '&amp;', ('show_operations', '=', True), ('is_locked', '=', True), ('is_initial_demand_editable', '=', False)]}"/>

                                    

                                    <field name="reserved_availability" string="Reserved" attrs="{'readonly': (['|','|', ('parent.state','=', 'done'), ('parent.picking_type_code', '=', 'incoming'), ('parent.immediate_transfer', '=', True)])}"/>

                                    <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=', False)]}"/>

                                    <field name="x_caseqty" string="Case Qty Demand"  />

                                    <field name="x_caseqty_reserved"  />

                                    <field name="x_caseqty_done"  />

                                    

                                    <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>

                                    <button name="action_show_details" string="Register lots, packs, location" type="object" icon="fa-list" width="0.1" attrs="{'invisible': [('show_details_visible', '=', False)]}" options="{&quot;warn&quot;: true}"/>

                                    <button name="action_assign_serial" type="object" icon="fa-plus-square" width="0.1" role="img" title="Assign Serial Numbers" attrs="{'invisible': ['|', ('display_assign_serial', '=', False), ('show_operations', '=', False)]}"/>

                                </tree>

                                <form string="Stock Moves">

                                    <header>

                                        <field name="state" widget="statusbar"/>

                                    </header>

                                    <group>

                                        <field name="product_uom_category_id" invisible="1"/>

                                        <field name="additional" invisible="1"/>

                                        <field name="has_move_lines" invisible="1"/>

                                        <field name="company_id" invisible="1"/>

                                        <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'), ('additional', '=', False), ('has_move_lines', '=', True)]}"/>

                                        <field name="is_initial_demand_editable" invisible="1"/>

                                        <field name="is_quantity_done_editable" invisible="1"/>

                                        <field name="product_uom_qty" string="Initial Demand" optional="show" attrs="{'invisible': [('parent.immediate_transfer', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}"/>

                                        

                                        <field name="reserved_availability" string="Reserved" optional="show" attrs="{'column_invisible': (['|','|', ('parent.state','=', 'done'), ('parent.picking_type_code', '=', 'incoming'), ('parent.immediate_transfer', '=', True)])}"/>

                                        <field name="quantity_done" string="Done" optional="show" attrs="{'readonly': [('is_quantity_done_editable', '=', False)]}"/>

                                        <field name="x_caseqty" string="Case Qty Demand" />

                                        <field name="x_caseqty_reserved"  />

                                        <field name="x_caseqty_done"  />

                                    

                                        <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>

                                        <field name="description_picking" string="Description"/>

                                    </group>

                                </form>

                            </field>

                            <field name="id" invisible="1"/>

                            <field name="package_level_ids" context="{'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}" attrs="{'readonly': [('state', '=', 'done')], 'invisible': ['|', ('picking_type_entire_packs', '=', False), ('show_operations', '=', True)]}"/>

                            <button class="oe_highlight" name="put_in_pack" type="object" string="Put in Pack" attrs="{'invisible': [('state', 'in', ('draft', 'done', 'cancel'))]}" groups="stock.group_tracking_lot"/>

                        </page>

                        <page string="Additional Info" name="extra">

                            <group>

                                <group string="Other Information" name="other_infos">

                                    <field name="picking_type_code" invisible="1"/>

                                    <field name="move_type" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/>

                                    <field name="priority" widget="priority"/>

                                    <field name="user_id"/>

                                    <field name="group_id" groups="base.group_no_one"/>

                                    <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" force_save="1"/>

                                </group>

                            </group>

                        </page>

                        <page string="Note" name="note">

                            <field name="note" string="Note" placeholder="Add an internal note that will be printed on the Picking Operations sheet"/>

                        </page>

                    </notebook>

                </sheet>

                <div class="oe_chatter">

                    <field name="message_follower_ids" widget="mail_followers"/>

                    <field name="activity_ids" widget="mail_activity"/>

                    <field name="message_ids" widget="mail_thread"/>

                </div>

                </form>

            



Avatar
Discard