Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
6856 Lượt xem

The picking report uses:

<span t-field="o.origin"/>

to specify which is the source document of the item.

Is it possible to additionally refer to client_order_ref field of the sales order? If so, how?

Thanks,

Ảnh đại diện
Huỷ bỏ

It is possible only if you create a link (m2o field) from Delivery Order to Sale Oder, which can give you access to all fields of sale order.

Tác giả Câu trả lời hay nhất

Akhil provided a very good and comprehensive example for the form, 

For the PDF report is actually very simple and I found it later here: https://www.odoo.com/forum/help-1/question/solved-how-do-i-add-the-client-order-reference-description-their-po-number-to-a-deliver-order-picking-report-saas-version-82994

Ảnh đại diện
Huỷ bỏ

Sorry, I thought you want to have that in form view and also in report. And if you make changes from front end, it will be effective only in your current database as you may know.

Câu trả lời hay nhất

Hi,

Yes it is possible. But first you need to bring that to the picking form view. Then you can call it in report.

A many2one field relation is already there called "sale_id", so we just need to add a related field in stock.picking

You may try the following:

1. Inherit stock.picking and add a related field

class stock_picking(models.Model):
_inherit="stock.picking"

client_ref = fields.Char(related="sale_id.client_order_ref", string="Client Description")

2. Call that in picking form view

<record id="view_picking_form_inherited" model="ir.ui.view">
<field name="name">view.picking.form.view.inherited</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="client_ref" />
</field>
</field>
</record>

3. call it in picking report by inheriting the template

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_picking_inherited" inherit_id="stock.report_picking">
<xpath expr="//t/div/table[1]/thead/tr/th[1]" position="after">
<th>Client Reference</th>

</xpath>

<xpath expr="//t/div/table[1]/tbody/tr/td[1]" position="after">
<td>
<span t-field="o.client_ref"/>
</td>

</xpath>
</template>
</data>
</openerp>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
A help to Extend the sale.order client_order_ref field to stock.quant.package?
To display it in the report stock.report_package_barcode


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 21
4990
0
thg 9 15
5497
1
thg 8 15
4951
0
thg 12 17
3571
1
thg 9 17
5056