如何在报告中添加life_date?

时间:2019-07-15 16:01:50

标签: odoo odoo-12

我想在odoo的Bon de livraison报告中从批号中添加有效期,但是即使我添加了life_date字段,也没有任何显示。 您能帮我解决这个问题吗?

这是我的代码:

<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'">
                        <t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" />
                        <thead>
                            <tr>
                                <th><strong>Article</strong></th>
                                <th class="text-center"><strong>Quantité</strong></th>
                                <th name="lot_serial" t-if="has_serial_number" groups="stock.group_lot_on_delivery_slip">
                                    Lot/numéro de série
                                </th>
                                <th name="life_date" t-if="life_date" groups="product_expiry.life_date">
                                    Date d'expiration du lot
                                </th>

                            </tr>
                        </thead>
                        <tbody>
                            <tr t-foreach="o.move_line_ids" t-as="move_line">
                                <td>
                                    <span t-field="move_line.product_id"/>
                                    <p t-if="o.picking_type_code == 'outgoing'">
                                        <span t-field="move_line.product_id.sudo().description_pickingout"/>
                                    </p>
                                    <p t-if="o.picking_type_code == 'incoming'">
                                        <span t-field="move_line.product_id.sudo().description_pickingin"/>
                                    </p>
                                </td>
                                <td class="text-center">
                                    <span t-field="move_line.qty_done"/>
                                    <span t-field="move_line.product_uom_id"/>
                                </td>
                                <td t-if="has_serial_number and move_line.lot_name" groups="stock.group_lot_on_delivery_slip">
                                    <span t-field="move_line.lot_name"/>
                                </td>
                                <td t-else="" groups="stock.group_lot_on_delivery_slip">
                                    <span t-field="move_line.lot_id.name"/>
                                </td>
                                <td t-if="life_date and move_line.life_date" groups="product_expiry.life_date">
                                    <span t-field="move_line.life_date"/>
                                </td>

                            </tr>
                        </tbody>
                    </table>

0 个答案:

没有答案