当前位置: 首页>>代码示例>>Python>>正文


Python Pool.default_channel方法代码示例

本文整理汇总了Python中trytond.pool.Pool.default_channel方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.default_channel方法的具体用法?Python Pool.default_channel怎么用?Python Pool.default_channel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trytond.pool.Pool的用法示例。


在下文中一共展示了Pool.default_channel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: default_payment_term

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_channel [as 别名]
    def default_payment_term():
        Sale = Pool().get('sale.sale')
        Channel = Pool().get('sale.channel')

        channel_id = Sale.default_channel()
        if channel_id:
            return Channel(channel_id).payment_term.id
        return None  # pragma: nocover
开发者ID:fulfilio,项目名称:trytond-sale-channel,代码行数:10,代码来源:sale.py

示例2: default_price_list

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_channel [as 别名]
    def default_price_list():
        Sale = Pool().get('sale.sale')
        Channel = Pool().get('sale.channel')

        channel_id = Sale.default_channel()
        if channel_id:
            return Channel(channel_id).price_list.id
        return None  # pragma: nocover
开发者ID:fulfilio,项目名称:trytond-sale-channel,代码行数:10,代码来源:sale.py

示例3: default_company

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_channel [as 别名]
    def default_company():
        Sale = Pool().get('sale.sale')
        Channel = Pool().get('sale.channel')

        channel_id = Sale.default_channel()
        if channel_id:
            return Channel(channel_id).company.id

        return Transaction().context.get('company')  # pragma: nocover
开发者ID:fulfilio,项目名称:trytond-sale-channel,代码行数:11,代码来源:sale.py

示例4: default_warehouse

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_channel [as 别名]
    def default_warehouse():
        Sale = Pool().get('sale.sale')
        Channel = Pool().get('sale.channel')
        Location = Pool().get('stock.location')

        channel_id = Sale.default_channel()
        if not channel_id:  # pragma: nocover
            return Location.search([('type', '=', 'warehouse')], limit=1)[0].id
        else:
            return Channel(channel_id).warehouse.id
开发者ID:fulfilio,项目名称:trytond-sale-channel,代码行数:12,代码来源:sale.py

示例5: default_shipment_method

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import default_channel [as 别名]
    def default_shipment_method():
        Sale = Pool().get('sale.sale')
        Channel = Pool().get('sale.channel')
        Config = Pool().get('sale.configuration')

        channel_id = Sale.default_channel()
        if not channel_id:  # pragma: nocover
            config = Config(1)
            return config.sale_invoice_method

        return Channel(channel_id).shipment_method
开发者ID:fulfilio,项目名称:trytond-sale-channel,代码行数:13,代码来源:sale.py


注:本文中的trytond.pool.Pool.default_channel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。