本文整理汇总了Python中stoqlib.domain.payment.payment.Payment.get_temporary_identifier方法的典型用法代码示例。如果您正苦于以下问题:Python Payment.get_temporary_identifier方法的具体用法?Python Payment.get_temporary_identifier怎么用?Python Payment.get_temporary_identifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.payment.payment.Payment
的用法示例。
在下文中一共展示了Payment.get_temporary_identifier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_confirm
# 需要导入模块: from stoqlib.domain.payment.payment import Payment [as 别名]
# 或者: from stoqlib.domain.payment.payment.Payment import get_temporary_identifier [as 别名]
def on_confirm(self):
self.model.base_value = self.model.value
facet = self.person.read()
if facet and facet is not ValueUnset:
setattr(self.model.group,
self.person_attribute,
facet.person)
self.model.attachment = self.fields['attachment'].attachment
# We can only change the identifier if the object is branch new (not edit_mode). If the
# object is being edited and the identifier is not temporary, it has already being synced
# with the destination branch and the identifier should no longer change.
# XXX: We can probably remove the temporary identifiers now that we have the station_id as
# part of the key in the identifiable domain.
other_branch = self._is_for_another_branch()
if other_branch and not self.edit_mode:
self.model.identifier = Payment.get_temporary_identifier(self.store)
self.store.add(self.model.group)
self.store.add(self.model)
if self.repeat.get_selected() != _ONCE:
Payment.create_repeated(self.store, self.model,
self.repeat.get_selected(),
self.model.due_date.date(),
self.end_date.get_date(),
temporary_identifiers=other_branch)