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


Python XferCompLabelForm.set_value_center方法代码示例

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


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

示例1: _entryline_editor

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
 def _entryline_editor(self, xfer, serial_vals, debit_rest, credit_rest):
     last_row = xfer.get_max_row() + 5
     lbl = XferCompLabelForm('sep1')
     lbl.set_location(0, last_row, 6)
     lbl.set_value("{[center]}{[hr/]}{[/center]}")
     xfer.add_component(lbl)
     lbl = XferCompLabelForm('sep2')
     lbl.set_location(1, last_row + 1, 5)
     lbl.set_value_center(_("Add a entry line"))
     xfer.add_component(lbl)
     entry_line = EntryLineAccount()
     entry_line.editor.edit_line(xfer, 0, last_row + 2, debit_rest, credit_rest)
     if entry_line.has_account:
         btn = XferCompButton('entrybtn')
         btn.set_location(3, last_row + 5)
         btn.set_action(xfer.request, ActionsManage.get_action_url(
             'accounting.EntryLineAccount', 'Add', xfer), close=CLOSE_YES)
         xfer.add_component(btn)
     self.item.editor.show(xfer)
     grid_lines = xfer.get_components('entrylineaccount')
     xfer.remove_component('entrylineaccount')
     new_grid_lines = XferCompGrid('entrylineaccount_serial')
     new_grid_lines.set_model(self.item.get_entrylineaccounts(serial_vals), None, xfer)
     new_grid_lines.set_location(grid_lines.col, grid_lines.row, grid_lines.colspan + 2, grid_lines.rowspan)
     new_grid_lines.add_action_notified(xfer, EntryLineAccount)
     xfer.add_component(new_grid_lines)
     nb_lines = len(new_grid_lines.record_ids)
     return nb_lines
开发者ID:Diacamma2,项目名称:financial,代码行数:30,代码来源:editors.py

示例2: edit

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
 def edit(self, xfer):
     xfer.change_to_readonly('type_of_account')
     code_ed = xfer.get_components('code')
     code_ed.mask = current_system_account().get_general_mask()
     code_ed.set_action(xfer.request, xfer.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
     descript, typeaccount = current_system_account().new_charts_account(self.item.code)
     error_msg = ''
     if typeaccount < 0:
         if typeaccount == -2:
             error_msg = _("Invalid code")
         if self.item.code != '':
             code_ed.set_value(self.item.code + '!')
         if self.item.id is None:
             xfer.get_components('type_of_account').set_value('---')
     elif self.item.id is None:
         field_type = self.item.get_field_by_name('type_of_account')
         xfer.get_components('type_of_account').set_value(
             get_value_if_choices(typeaccount, field_type))
         xfer.get_components('name').set_value(descript)
         xfer.params['type_of_account'] = typeaccount
     elif typeaccount != self.item.type_of_account:
         error_msg = _("Changment not allowed!")
         code_ed.set_value(self.item.code + '!')
     lbl = XferCompLabelForm('error_code')
     lbl.set_location(1, xfer.get_max_row() + 1, 2)
     lbl.set_value_center("{[font color='red']}%s{[/font]}" % error_msg)
     xfer.add_component(lbl)
     return
开发者ID:Diacamma2,项目名称:financial,代码行数:30,代码来源:editors.py

示例3: show

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
 def show(self, xfer):
     xfer.move(0, 0, 5)
     xfer.item = LegalEntity.objects.get(id=1)
     xfer.fill_from_model(1, 0, True, ["name", "address", ("postal_code", "city"), ("tel1", "email")])
     xfer.item = self.item
     lbl = XferCompLabelForm("sep")
     lbl.set_value_center("{[hr/]}")
     lbl.set_location(1, 4, 4)
     xfer.add_component(lbl)
     xfer.remove_component("lbl_depositdetail_set")
     depositdetail = xfer.get_components("depositdetail")
     depositdetail.col = 1
     depositdetail.colspan = 4
开发者ID:Diacamma2,项目名称:financial,代码行数:15,代码来源:editors.py

示例4: summary_documents

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
def summary_documents(xfer):
    if not hasattr(xfer, 'add_component'):
        return WrapAction.is_permission(xfer, 'documents.change_document')
    elif WrapAction.is_permission(xfer.request, 'documents.change_document'):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('documenttitle')
        lab.set_value_as_infocenter(_('Document management'))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        filter_result = Q()
        if notfree_mode_connect():
            filter_result = filter_result & (Q(folder=None) | Q(folder__viewer__in=xfer.request.user.groups.all() if xfer.request.user.id is not None else []))
        nb_doc = len(Document.objects.filter(*[filter_result]))
        lbl_doc = XferCompLabelForm('lbl_nbdocument')
        lbl_doc.set_location(0, row + 1, 4)
        if nb_doc == 0:
            lbl_doc.set_value_center(_("no file currently available"))
        elif nb_doc == 1:
            lbl_doc.set_value_center(_("one file currently available"))
        else:
            lbl_doc.set_value_center(_("%d files currently available") % nb_doc)
        xfer.add_component(lbl_doc)
        lab = XferCompLabelForm('documentend')
        lab.set_value_center('{[hr/]}')
        lab.set_location(0, row + 2, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Lucterios2,项目名称:documents,代码行数:31,代码来源:views.py

示例5: summary_accounting

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
def summary_accounting(xfer):
    if WrapAction.is_permission(xfer.request, 'accounting.change_chartsaccount'):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('accountingtitle')
        lab.set_value_as_infocenter(_("Bookkeeping"))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        try:
            year = FiscalYear.get_current()
            lbl = XferCompLabelForm("accounting_year")
            lbl.set_value_center(six.text_type(year))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
            lbl = XferCompLabelForm("accounting_result")
            lbl.set_value_center(year.total_result_text)
            lbl.set_location(0, row + 2, 4)
            xfer.add_component(lbl)
        except LucteriosException as lerr:
            lbl = XferCompLabelForm("accounting_error")
            lbl.set_value_center(six.text_type(lerr))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
            btn = XferCompButton("accounting_conf")
            btn.set_action(xfer.request, Configuration.get_action(_("conf."), ""), close=CLOSE_NO)
            btn.set_location(0, row + 2, 4)
            xfer.add_component(btn)
        lab = XferCompLabelForm('accountingend')
        lab.set_value_center('{[hr/]}')
        lab.set_location(0, row + 3, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:financial,代码行数:35,代码来源:views.py

示例6: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
    def fillresponse(self):
        XferListEditor.fillresponse(self)
        lbl = XferCompLabelForm("result")
        lbl.set_value_center(self.item.year.total_result_text)
        lbl.set_location(0, 10, 2)
        self.add_component(lbl)

        accompt_returned = []
        all_codes = list(self.item.year.chartsaccount_set.all().values_list('code', flat=True))
        all_codes.append('')
        Signal.call_signal("compte_no_found", all_codes, accompt_returned)
        lbl = XferCompLabelForm("CompteNoFound")
        if len(accompt_returned) > 0:
            lbl.set_value("{[u]}{[b]}%s{[/b]}{[/u]}{[br]}%s" % (_("Using codes unknows in this account chart:"), "{[br/]}".join(accompt_returned)))
        lbl.set_location(0, 11, 2)
        self.add_component(lbl)
开发者ID:Diacamma2,项目名称:financial,代码行数:18,代码来源:views_accounts.py

示例7: summary_contacts

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
def summary_contacts(xfer):
    if not hasattr(xfer, 'add_component'):
        return WrapAction.is_permission(xfer, 'contacts.change_abstractcontact')
    else:
        if WrapAction.is_permission(xfer.request, 'contacts.change_abstractcontact'):
            row = xfer.get_max_row() + 1
            lab = XferCompLabelForm('contactstitle')
            lab.set_value_as_infocenter(_("Addresses and contacts"))
            lab.set_location(0, row, 4)
            xfer.add_component(lab)
            nb_legal_entities = len(LegalEntity.objects.all())
            lbl_doc = XferCompLabelForm('lbl_nblegalentities')
            lbl_doc.set_location(0, row + 1, 4)
            lbl_doc.set_value_center(_("Total number of legal entities: %d") % nb_legal_entities)
            xfer.add_component(lbl_doc)
            nb_individual = len(Individual.objects.all())
            lbl_doc = XferCompLabelForm('lbl_nbindividuals')
            lbl_doc.set_location(0, row + 2, 4)
            lbl_doc.set_value_center(_("Total number of individuals: %d") % nb_individual)
            xfer.add_component(lbl_doc)
            lab = XferCompLabelForm('contactsend')
            lab.set_value_center('{[hr/]}')
            lab.set_location(0, row + 3, 4)
            xfer.add_component(lab)
            return True
        else:
            return False
开发者ID:Lucterios2,项目名称:contacts,代码行数:29,代码来源:views_contacts.py

示例8: situation_contacts

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
def situation_contacts(xfer):
    if not hasattr(xfer, 'add_component'):
        try:
            Individual.objects.get(user=xfer.user)
            return True
        except Exception:
            return False
    else:
        if not xfer.request.user.is_anonymous:
            try:
                current_individual = Individual.objects.get(user=xfer.request.user)
                row = xfer.get_max_row() + 1
                lab = XferCompLabelForm('contactsidentity')
                lab.set_value_as_header(six.text_type(current_individual))
                lab.set_location(0, row, 4)
                xfer.add_component(lab)
                lab = XferCompLabelForm('contactsend')
                lab.set_value_center('{[hr/]}')
                lab.set_location(0, row + 1, 4)
                xfer.add_component(lab)
                return True
            except Exception:
                return False
开发者ID:Lucterios2,项目名称:contacts,代码行数:25,代码来源:views_contacts.py

示例9: fill_header

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
    def fill_header(self):
        self.item = FiscalYear.get_current(self.getparam("year"))
        new_begin = convert_date(self.getparam("begin"), self.item.begin)
        new_end = convert_date(self.getparam("end"), self.item.end)
        if (new_begin >= self.item.begin) and (new_end <= self.item.end):
            self.item.begin = new_begin
            self.item.end = new_end
        img = XferCompImage('img')
        img.set_value(self.icon_path())
        img.set_location(0, 0, 1, 3)
        self.add_component(img)

        select_year = XferCompSelect(self.field_id)
        select_year.set_location(1, 0, 4)
        select_year.set_select_query(FiscalYear.objects.all())
        select_year.set_value(self.item.id)
        select_year.set_needed(True)
        select_year.set_action(self.request, self.__class__.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
        self.add_component(select_year)
        self.filter = Q(entry__year=self.item)
        if self.item.status != 2:
            self.fill_from_model(1, 1, False, ['begin'])
            self.fill_from_model(3, 1, False, ['end'])
            begin_filter = self.get_components('begin')
            begin_filter.set_action(self.request, self.__class__.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
            end_filter = self.get_components('end')
            end_filter.set_action(self.request, self.__class__.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
            self.filter &= Q(entry__date_value__gte=self.item.begin)
            self.filter &= Q(entry__date_value__lte=self.item.end)
        self.fill_filterCode()
        lbl = XferCompLabelForm("result")
        lbl.set_value_center(self.item.total_result_text)
        lbl.set_location(0, 6, 6)
        self.add_component(lbl)
        self.fill_filterheader()
        self.define_gridheader()
开发者ID:Diacamma2,项目名称:financial,代码行数:38,代码来源:views_reports.py

示例10: summary_member

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
def summary_member(xfer):
    is_right = WrapAction.is_permission(xfer.request, 'member.change_adherent')
    try:
        current_adherent = Adherent.objects.get(user=xfer.request.user)
    except:
        current_adherent = None

    if is_right or (current_adherent is not None):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('membertitle')
        lab.set_value_as_infocenter(_("Adherents"))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if current_adherent is not None:
        ident = []
        if Params.getvalue("member-numero"):
            ident.append("%s %s" % (_('numeros'), current_adherent.num))
        if Params.getvalue("member-licence-enabled"):
            current_license = current_adherent.license
            if current_license is not None:
                ident.append(current_license)
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('membercurrent')
        lab.set_value_as_header("{[br/]}".join(ident))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if is_right:
        row = xfer.get_max_row() + 1
        try:
            current_season = Season.current_season()
            dateref = current_season.date_ref
            lab = XferCompLabelForm('memberseason')
            lab.set_value_as_headername(six.text_type(current_season))
            lab.set_location(0, row + 1, 4)
            xfer.add_component(lab)
            nb_adh = len(Adherent.objects.filter(Q(subscription__begin_date__lte=dateref) & Q(
                subscription__end_date__gte=dateref) & Q(subscription__status=2)))
            lab = XferCompLabelForm('membernb')
            lab.set_value_as_header(_("Active adherents: %d") % nb_adh)
            lab.set_location(0, row + 2, 4)
            xfer.add_component(lab)
            nb_adhcreat = len(Adherent.objects.filter(
                Q(subscription__begin_date__lte=dateref) & Q(subscription__end_date__gte=dateref) & Q(subscription__status=1)))
            if nb_adhcreat > 0:
                lab = XferCompLabelForm('memberadhcreat')
                lab.set_value_as_header(_("No validated adherents: %d") % nb_adhcreat)
                lab.set_location(0, row + 3, 4)
                xfer.add_component(lab)
            nb_adhwait = len(Adherent.objects.filter(
                Q(subscription__begin_date__lte=dateref) & Q(subscription__end_date__gte=dateref) & Q(subscription__status=0)))
            if nb_adhwait > 0:
                lab = XferCompLabelForm('memberadhwait')
                lab.set_value_as_header(_("Adherents waiting moderation: %d") % nb_adhwait)
                lab.set_location(0, row + 4, 4)
                xfer.add_component(lab)
        except LucteriosException as lerr:
            lbl = XferCompLabelForm("member_error")
            lbl.set_value_center(six.text_type(lerr))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
    if is_right or (current_adherent is not None):
        lab = XferCompLabelForm('member')
        lab.set_value_as_infocenter("{[hr/]}")
        lab.set_location(0, row + 5, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:asso,代码行数:70,代码来源:views.py

示例11: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_center [as 别名]
 def fillresponse(self):
     XferListEditor.fillresponse(self)
     lbl = XferCompLabelForm("result")
     lbl.set_value_center(self.item.year.total_result_text)
     lbl.set_location(0, 10, 2)
     self.add_component(lbl)
开发者ID:Diacamma2,项目名称:financial,代码行数:8,代码来源:views_entries.py


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