[POS-commit] r3265 - in stoq/trunk: stoq/gui/pos

Evandro Vale Miquelito evandro at async.com.br
Sat Apr 8 12:48:25 BRT 2006


Author: evandro
Date: Sat Apr  8 12:48:25 2006
New Revision: 3265

Modified:
   stoq/trunk/data/NewOrderEditor.glade
   stoq/trunk/stoq/gui/pos/neworder.py

Log:
Refactoring the NewOrderEditor layout, setting a client in the combo after
creating a new person and removing the salesperson combo since the
salesperson should be changed only after logging out.


Modified: stoq/trunk/data/NewOrderEditor.glade
==============================================================================
--- stoq/trunk/data/NewOrderEditor.glade	(original)
+++ stoq/trunk/data/NewOrderEditor.glade	Sat Apr  8 12:48:25 2006
@@ -1,145 +1,266 @@
 <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
 <!DOCTYPE glade-interface SYSTEM "http://gazpacho.sicem.biz/gazpacho-0.1.dtd">
-<glade-interface domain="stoq">
+<glade-interface>
     <widget class="GtkWindow" id="NewOrderEditor">
         <property name="default_height">250</property>
         <property name="default_width">440</property>
         <child>
-            <widget class="GtkTable" id="table1">
+            <widget class="GtkVBox" id="vbox1">
                 <property name="border_width">6</property>
-                <property name="column_spacing">6</property>
-                <property name="n_columns">6</property>
-                <property name="n_rows">2</property>
-                <property name="row_spacing">6</property>
                 <property name="visible">True</property>
                 <child>
-                    <placeholder/>
-                </child>
-                <child>
-                    <widget class="ProxyLabel" id="kiwilabel2">
-                        <property name="label" context="yes" translatable="yes">Salesperson:</property>
-                        <property name="visible">True</property>
-                        <property name="xalign">1.0</property>
-                    </widget>
-                    <packing>
-                        <property name="right_attach">3</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="ProxyLabel" id="kiwilabel1">
-                        <property name="label" context="yes" translatable="yes">Client:</property>
-                        <property name="visible">True</property>
-                        <property name="xalign">1.0</property>
-                    </widget>
-                    <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="top_attach">1</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="GtkRadioButton" id="anonymous_check">
-                        <property name="is_focus">True</property>
-                        <property name="label" context="yes" translatable="yes">Anonymous</property>
-                        <property name="visible">True</property>
-                    </widget>
-                    <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                    </packing>
-                </child>
-                <child>
-                    <placeholder/>
-                    <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="GtkRadioButton" id="client_check">
-                        <property name="active">False</property>
-                        <property name="group">anonymous_check</property>
-                        <property name="visible">True</property>
-                    </widget>
-                    <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">1</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="ProxyComboEntry" id="salesperson">
-                        <property name="data_type">object</property>
-                        <property name="model_attribute">salesperson</property>
-                        <property name="visible">True</property>
-                    </widget>
-                    <packing>
-                        <property name="left_attach">3</property>
-                        <property name="right_attach">4</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="ProxyComboEntry" id="client">
-                        <property name="data_type">object</property>
-                        <property name="model_attribute">client</property>
-                        <property name="visible">True</property>
-                    </widget>
-                    <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="left_attach">3</property>
-                        <property name="right_attach">4</property>
-                        <property name="top_attach">1</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="ProxyLabel" id="kiwilabel10">
-                        <property name="label" context="yes" translatable="yes">Order Number:</property>
-                        <property name="visible">True</property>
-                        <property name="xalign">1.0</property>
-                    </widget>
-                    <packing>
-                        <property name="left_attach">4</property>
-                        <property name="right_attach">5</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="GtkButton" id="client_button">
-                        <property name="label" context="yes" translatable="yes">_Add/Edit Client...</property>
-                        <property name="use_underline">True</property>
-                        <property name="visible">True</property>
-                    </widget>
-                    <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="left_attach">4</property>
-                        <property name="right_attach">5</property>
-                        <property name="top_attach">1</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="ProxyLabel" id="order_number">
-                        <property name="data_type">unicode</property>
-                        <property name="model_attribute">order_number_str</property>
-                        <property name="visible">True</property>
-                        <property name="xalign">1.0</property>
-                    </widget>
-                    <packing>
-                        <property name="left_attach">5</property>
-                        <property name="right_attach">6</property>
-                    </packing>
-                </child>
-                <child>
-                    <widget class="GtkButton" id="details_button">
-                        <property name="label" context="yes" translatable="yes">Client _Details</property>
-                        <property name="use_underline">True</property>
+                    <widget class="GtkTable" id="table1">
+                        <property name="column_spacing">6</property>
+                        <property name="n_columns">5</property>
+                        <property name="n_rows">5</property>
+                        <property name="row_spacing">6</property>
                         <property name="visible">True</property>
+                        <child>
+                            <widget class="ProxyLabel" id="kiwilabel2">
+                                <property name="label" context="yes" translatable="yes">Order Number:</property>
+                                <property name="visible">True</property>
+                                <property name="xalign">1.0</property>
+                            </widget>
+                        </child>
+                        <child>
+                            <widget class="ProxyLabel" id="kiwilabel1">
+                                <property name="label" context="yes" translatable="yes">Salesperson:</property>
+                                <property name="visible">True</property>
+                                <property name="xalign">1.0</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">2</property>
+                                <property name="top_attach">1</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="ProxyLabel" id="kiwilabel3">
+                                <property name="label" context="yes" translatable="yes">Client:</property>
+                                <property name="visible">True</property>
+                                <property name="xalign">1.0</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">4</property>
+                                <property name="top_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="ProxyLabel" id="order_number">
+                                <property name="data_type">unicode</property>
+                                <property name="model_attribute">order_number_str</property>
+                                <property name="visible">True</property>
+                                <property name="xalign">0.0</property>
+                            </widget>
+                            <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="ProxyLabel" id="salesperson">
+                                <property name="data_type">unicode</property>
+                                <property name="model_attribute">salesperson_name</property>
+                                <property name="visible">True</property>
+                                <property name="xalign">0.0</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">2</property>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">1</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="GtkRadioButton" id="client_check">
+                                <property name="label" context="yes" translatable="yes">Select:</property>
+                                <property name="visible">True</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">4</property>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="GtkRadioButton" id="anonymous_check">
+                                <property name="active">False</property>
+                                <property name="group">client_check</property>
+                                <property name="label" context="yes" translatable="yes">Not Specified</property>
+                                <property name="visible">True</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">5</property>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">4</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="ProxyComboEntry" id="client">
+                                <property name="data_type">object</property>
+                                <property name="model_attribute">client</property>
+                                <property name="visible">True</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">4</property>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="top_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">3</property>
+                                <property name="right_attach">4</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">3</property>
+                                <property name="right_attach">4</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">3</property>
+                                <property name="right_attach">4</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="GtkButton" id="client_button">
+                                <property name="label" context="yes" translatable="yes">Add/Edit...</property>
+                                <property name="visible">True</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">4</property>
+                                <property name="left_attach">3</property>
+                                <property name="right_attach">4</property>
+                                <property name="top_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">3</property>
+                                <property name="right_attach">4</property>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">4</property>
+                                <property name="right_attach">5</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">4</property>
+                                <property name="right_attach">5</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">4</property>
+                                <property name="right_attach">5</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <widget class="GtkButton" id="details_button">
+                                <property name="label" context="yes" translatable="yes">Details</property>
+                                <property name="visible">True</property>
+                            </widget>
+                            <packing>
+                                <property name="bottom_attach">4</property>
+                                <property name="left_attach">4</property>
+                                <property name="right_attach">5</property>
+                                <property name="top_attach">3</property>
+                            </packing>
+                        </child>
+                        <child>
+                            <placeholder/>
+                            <packing>
+                                <property name="left_attach">4</property>
+                                <property name="right_attach">5</property>
+                                <property name="top_attach">4</property>
+                                <property name="bottom_attach">5</property>
+                            </packing>
+                        </child>
                     </widget>
                     <packing>
-                        <property name="bottom_attach">2</property>
-                        <property name="left_attach">5</property>
-                        <property name="right_attach">6</property>
-                        <property name="top_attach">1</property>
+                        <property name="expand">False</property>
                     </packing>
                 </child>
             </widget>

Modified: stoq/trunk/stoq/gui/pos/neworder.py
==============================================================================
--- stoq/trunk/stoq/gui/pos/neworder.py	(original)
+++ stoq/trunk/stoq/gui/pos/neworder.py	Sat Apr  8 12:48:25 2006
@@ -57,9 +57,6 @@
         # Waiting for bug 2319
         self.details_button.set_sensitive(False)
         self._setup_client_entry()
-        salespersons = Person.iselect(ISalesPerson, connection=self.conn)
-        items = [(s.get_adapted().name, s) for s in salespersons]
-        self.salesperson.prefill(items)
         self._update_client_widgets()
 
     def _update_client_widgets(self):
@@ -89,13 +86,16 @@
     #
 
     def on_client_button__clicked(self, *args):
-        if run_person_role_dialog(ClientEditor, self, self.conn,
-                                  self.model.client):
+        client = run_person_role_dialog(ClientEditor, self, self.conn,
+                                        self.model.client)
+        if client:
             self.conn.commit()
             # FIXME waiting for entry completion bug fix in kiwi. This part
             # doesn't work properly when editing a client previously set in
             # POS interface
             self._setup_client_entry()
+            self.model.client = client
+            self.proxy.update('client')
 
     def on_client_check__toggled(self, *args):
         self._update_client_widgets()


More information about the POS-commit mailing list