Пример #1
0
    def __init__(self, sale, missing_items):
        self.sale = sale
        self.missing = missing_items
        msg = '<b>%s</b>' % (
            api.escape(_("The following items don't have enough stock to "
                         "confirm the sale")))
        SimpleListDialog.__init__(self, self._get_columns(), missing_items,
                                  hide_cancel_btn=False,
                                  title=_('Missing items'),
                                  header_text=msg)

        if sale.status == Sale.STATUS_QUOTE:
            label = gtk.Label(_('Do you want to order the sale instead?'))
            self.notice.add(label)
            label.show()
            self.set_ok_label(_('Order sale'))
Пример #2
0
 def confirm(self, *args):
     if self._is_sale_quote:
         store = api.new_store()
         sale = store.fetch(self.order)
         self._create_production_order(store)
         sale.order(api.get_current_user(store))
         store.confirm(True)
         store.close()
     return SimpleListDialog.confirm(self, *args)
Пример #3
0
 def confirm(self, *args):
     if self.sale.status == Sale.STATUS_QUOTE:
         store = api.new_store()
         sale = store.fetch(self.sale)
         self._create_production_order(store)
         sale.order()
         store.confirm(True)
         store.close()
     return SimpleListDialog.confirm(self, *args)
Пример #4
0
    def __init__(self, order, missing):
        self.order = order
        self._is_sale_quote = (isinstance(order, Sale) and
                               order.status == Sale.STATUS_QUOTE)
        self.missing = missing
        msg = '<b>%s</b>' % (
            api.escape(_("The following items don't have enough stock to "
                         "confirm.")))
        SimpleListDialog.__init__(self, self._get_columns(), missing,
                                  hide_cancel_btn=not self._is_sale_quote,
                                  title=_('Missing items'),
                                  header_text=msg)

        if self._is_sale_quote:
            label = gtk.Label(_('Do you want to order the sale instead?'))
            self.notice.add(label)
            label.show()
            self.set_ok_label(_('Order sale'))
Пример #5
0
 def confirm(self, *args):
     if self._is_sale_quote:
         store = api.new_store()
         sale = store.fetch(self.order)
         self._create_production_order(store)
         sale.order()
         store.confirm(True)
         store.close()
     return SimpleListDialog.confirm(self, *args)
Пример #6
0
    def __init__(self, order, missing):
        self.order = order
        self._is_sale_quote = (isinstance(order, Sale)
                               and order.status == Sale.STATUS_QUOTE)
        self.missing = missing
        msg = '<b>%s</b>' % (api.escape(
            _("The following items don't have enough stock to "
              "confirm.")))
        SimpleListDialog.__init__(self,
                                  self._get_columns(),
                                  missing,
                                  hide_cancel_btn=not self._is_sale_quote,
                                  title=_('Missing items'),
                                  header_text=msg)

        if self._is_sale_quote:
            label = gtk.Label(_('Do you want to order the sale instead?'))
            self.notice.add(label)
            label.show()
            self.set_ok_label(_('Order sale'))
Пример #7
0
    def _create_dialog(self):
        objs = []
        for i in range(10):
            objs.append(Settable(
                id=i,
                desc="Object %d" % i,
            ))

        columns = [
            Column('id', title='#', data_type=int),
            Column('desc', title='Description', data_type=str, expand=True),
        ]

        return SimpleListDialog(columns=columns, objects=objs)