Skip to Content
Menu
This question has been flagged

We have a butcher that needs to prep the meat orders for picking, at the moment he prints the picking operations pdf but that means he gets ALL products in the order not just his. I've duplicated the picking operations doc and updated this line


<table class="table table-sm" name="table_outgoing" t-if="o.move_line_ids and o.move_ids_without_package and o.picking_type_id.code == 'outgoing' t-if="ml.product_category_name == 'BUTCHERY / Chicken' ">


but it's not filtering the picking list to only products that contain the category 'BUTCHERY / Chicken', ideally, I'd like BUTCHERY* as we have butchery as the primary category and several sub categories (chicken, beef, pork etc).

Below is the table code from the original picking operations file, which line should I be changing and what's the correct code? I'm also ok with having to list each individual category if needed.


        <table class="table table-sm" name="table_outgoing" t-if="o.move_line_ids and o.move_ids_without_package and o.picking_type_id.code == 'outgoing'">

            <t t-set="has_barcode" t-value="any(move_line.product_id and move_line.product_id.sudo().barcode or move_line.package_id for move_line in o.move_line_ids)"/>

            <t t-set="has_serial_number" t-value="any(move_line.lot_id or move_line.lot_name for move_line in o.move_line_ids)" groups="stock.group_production_lot"/>

            <thead>

                <tr>

                    <th name="th_from" t-if="o.picking_type_id.code != 'incoming'" align="left" groups="stock.group_stock_multi_locations" width="10%">

                        <strong>From</strong>

                    </th>

                    <th name="th_product" width="30%">

                        <strong>Product</strong>

                    </th>

                    <th name="th_quantity" width="15%">

                        <strong>Quantity To Pick(Uom)</strong>

                    </th>

                    <th name="th_uom" width="10%">

                        <strong>Uom</strong>

                    </th>

                    <th name="th_packaging" width="15%">

                        <strong>Packaging Quantity</strong>

                    </th>

                    <th name="th_picked" width="10%">

                        <strong>Picked</strong>

                    </th>

                    <th name="th_used_by_date" width="10%">

                        <strong>Used By Date</strong>

                    </th>

                </tr>

            </thead>

            <tbody>

                <!-- In case you come across duplicated lines, ask NIM or LAP -->

                <tr t-foreach="o.move_line_ids_without_package.sorted(lambda ml: (ml.location_id.complete_name, ml.location_dest_id.complete_name))" t-as="ml">

                    <td name="td_from">

                        <span t-esc="ml.location_id.name">WH/Stock</span>

                        <t t-if="ml.package_id">

                            <span t-field="ml.package_id">Package A</span>

                        </t>

                    </td>

                    <td name="td_product">

                        <span t-field="ml.product_id.display_name">Customizable Desk</span><br/>

                        <span t-if="ml.product_id.description_picking" t-field="ml.product_id.description_picking">Description on transfer</span>

                    </td>

                    <td name="td_quantity">

                        <span t-field="ml.quantity">3.00</span>

                    </td>

                    <td name="td_uom">

                        <span t-field="ml.product_uom_id" groups="uom.group_uom">units</span>

                    </td>

                    <td name="td_packaging">

                        <span t-if="ml.move_id.product_packaging_id and ml.product_packaging_qty &gt;= 1">

                            <span t-if="o.state != 'done'">

                                <span t-field="ml.product_packaging_qty" t-options="{&quot;widget&quot;: &quot;integer&quot;}"/> <span t-field="ml.move_id.product_packaging_id.name"/>

                            </span>

                            <span t-if="o.state == 'done'">

                                <span t-field="ml.product_packaging_qty" t-options="{&quot;widget&quot;: &quot;integer&quot;}"/> <span t-field="ml.move_id.product_packaging_id.name"/>

                            </span>

                        </span>

                    </td>

                    <td name="th_picked" align="right">

                        <span t-if="ml.product_uom_id.name == 'kg'">

                            <span t-field="ml.product_uom_id" groups="uom.group_uom"/>

                        </span>

                    </td>

                    <td name="th_used_by_date"/>

                </tr>

              </tbody>

        </table>


Many thanks

Alex

Avatar
Discard
Related Posts Replies Views Activity
1
Oct 25
279
1
May 25
1761
1
Dec 22
1109
4
Dec 18
5495
2
Oct 15
14054