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


Python Pool.round方法代码示例

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


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

示例1: get_total_amount

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import round [as 别名]
 def get_total_amount(self, ids, name):
     currency_obj = Pool().get('currency.currency')
     res = {}
     for invoice in self.browse(ids):
         if not invoice.service_fee:
             invoice.service_fee = Decimal('0.0')
         if not invoice.discount:
             invoice.discount = Decimal('0.0')
         res[invoice.id] = currency_obj.round(invoice.currency,
                 invoice.untaxed_amount + invoice.tax_amount + invoice.service_fee - invoice.discount)
     return res
开发者ID:russelmahmud,项目名称:IDSHealth,代码行数:13,代码来源:health.py

示例2: _on_change_lines_taxes

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import round [as 别名]
 def _on_change_lines_taxes(self, vals):
     res = super(HealthInvoice, self)._on_change_lines_taxes(vals)
     currency_obj = Pool().get('currency.currency')
     currency = None
     
     if vals.get('currency'):
         currency = currency_obj.browse(vals['currency'])
         res['discount'] = vals.get('discount', Decimal('0.0'))
         res['service_fee'] = vals.get('service_fee', Decimal('0.0'))
         res['total_amount'] = currency_obj.round(currency,
                     res['untaxed_amount'] + res['tax_amount'] + res['service_fee'] - res['discount'])
     return res
开发者ID:russelmahmud,项目名称:IDSHealth,代码行数:14,代码来源:health.py

示例3: compute_quantity

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import round [as 别名]
 def compute_quantity(self, factor):
     Uom = Pool().get("product.uom")
     return Uom.round(self.quantity * factor, self.uom.rounding)
开发者ID:silpol,项目名称:tryton-bef,代码行数:5,代码来源:bom.py

示例4: calcular_total

# 需要导入模块: from trytond.pool import Pool [as 别名]
# 或者: from trytond.pool.Pool import round [as 别名]
 def calcular_total(self, sale, cantidad, utilidad):
     Currency = Pool().get('currency.currency')
     gastos = self._calcular_gastos(sale, cantidad, lambda x: True)
     return Currency.round(sale.currency, gastos * (100 + utilidad) / 100)
开发者ID:gcoop-libre,项目名称:sale_printery_budget,代码行数:6,代码来源:sale.py


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