本文整理汇总了Python中corehq.apps.accounting.models.BillingAccount.billing_admins方法的典型用法代码示例。如果您正苦于以下问题:Python BillingAccount.billing_admins方法的具体用法?Python BillingAccount.billing_admins怎么用?Python BillingAccount.billing_admins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.accounting.models.BillingAccount
的用法示例。
在下文中一共展示了BillingAccount.billing_admins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: billing_account
# 需要导入模块: from corehq.apps.accounting.models import BillingAccount [as 别名]
# 或者: from corehq.apps.accounting.models.BillingAccount import billing_admins [as 别名]
def billing_account(web_user_creator, web_user_contact, currency=None, save=True):
account_name = data_gen.arbitrary_unique_name(prefix="BA")[:40]
currency = currency or Currency.objects.get(code=settings.DEFAULT_CURRENCY)
billing_account = BillingAccount(
name=account_name,
created_by=web_user_creator.username,
currency=currency,
)
if save:
billing_account.save()
billing_contact = BillingContactInfo(
account=billing_account,
first_name=data_gen.arbitrary_firstname(),
last_name=data_gen.arbitrary_lastname(),
emails=web_user_creator.username,
phone_number="+15555555",
company_name="Company Name",
first_line="585 Mass Ave",
city="Cambridge",
state_province_region="MA",
postal_code="02139",
country="US",
)
billing_contact.save()
billing_account.billing_admins =\
[BillingAccountAdmin.objects.get_or_create(web_user=web_user_contact.username)[0]]
billing_account.save()
return billing_account
示例2: billing_account
# 需要导入模块: from corehq.apps.accounting.models import BillingAccount [as 别名]
# 或者: from corehq.apps.accounting.models.BillingAccount import billing_admins [as 别名]
def billing_account(web_user_creator, web_user_contact, currency=None, save=True):
account_name = data_gen.arbitrary_unique_name(prefix="BA")[:40]
currency = currency or Currency.objects.get(code=settings.DEFAULT_CURRENCY)
billing_account = BillingAccount(
name=account_name,
created_by=web_user_creator.username,
currency=currency,
)
if save:
billing_account.save()
billing_account.billing_admins =\
[BillingAccountAdmin.objects.get_or_create(web_user=web_user_contact.username)[0]]
billing_account.save()
return billing_account