跳至内容
菜单
此问题已终结
2 回复
9144 查看

Hi,

I am using OpenOffice Designer to do my Invoices report. Do anyone know what is the code for the customer reference because i try to use [[ o.client_order_ref ]] but seem like not working

形象
丢弃
最佳答案

In invoice name field holds the customer reference. so you can use [[ o.name ]] to get the customer reference

形象
丢弃
编写者

hi i use the [[ o.name ]] but not working

最佳答案

You can not directly get client_order_ref, it is sale order field.

def _get_client_order_ref(self, data):

    ref = ''
    sale_obj = self.pool.get('sale.order')
    sale_ids = sale_obj.search(cr, uid, [('origin', '=', data.origin)]
    if sale_ids:
        ref = sale_obj.browse(cr, uid, sale_ids[0]).client_order_ref
    return ref

you have to do something like this

形象
丢弃
编写者

can i know this code put under python file?

I'm actually interested in something similar. I would like to display the customer reference on a task associated with the sales order. thanks!

相关帖文 回复 查看 活动
6
1月 24
58440
1
5月 16
3788
0
1月 25
1301
3
11月 24
4593
0
10月 24
1299