Odoo 9.0C:我如何访问在发票qweb报表上的sale.order.line模块中创建的many2one字段的值? [英] Odoo 9.0C: How can i access the value of a many2one field (that has been created in sale.order.line module on the invoice qweb report?

查看:135
本文介绍了Odoo 9.0C:我如何访问在发票qweb报表上的sale.order.line模块中创建的many2one字段的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Line出售的模块Sale 由Camptocamp,Eficent,SerpentCS,Odoo社区协会(OCA)针对Odoo 9.0编写. 该模块创建一个新的many2one字段,如下所示:

I have installed module Sale Sourced by Line by Camptocamp, Eficent, SerpentCS, Odoo Community Association (OCA) for Odoo 9.0. The module creates a new many2one field as the code bellow:

class SaleOrderLine(models.Model):
    _inherit = 'sale.order.line'

    warehouse_id = fields.Many2one(
        'stock.warehouse',
        'Source Warehouse',
        readonly=True,
        states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
        help="If a source warehouse is selected, "
             "it will be used to define the route. "
             "Otherwise, it will get the warehouse of "
             "the sale order")

现在,我想访问account_invoice_report qweb上的值Warehouse_id.请告诉我什么是可行的解决方案?谢谢您的宝贵时间,

Now i would like to access the value warehouse_id on account_invoice_report qweb. Please tell me what are posible solutions for my purpose? Thank for your time,

推荐答案

account.invoice.line 中,有一个字段 sale_line_ids ,根据该字段,您可以搜索 sale.order.line 中的> warehouse_id .

In account.invoice.line one field available sale_line_ids, based on that you can search warehouse_id from sale.order.line.

invoice.invoice_line_ids.mapped('sale_line_ids').mapped('warehouse_id')

这可能会对您有所帮助.

This may help you.

这篇关于Odoo 9.0C:我如何访问在发票qweb报表上的sale.order.line模块中创建的many2one字段的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆