Merge lp:~georgeyk/stoq/start_production into lp:~stoq-dev/stoq/master-old

Proposed by George Kussumoto
Status: Merged
Merged at revision: not available
Proposed branch: lp:~georgeyk/stoq/start_production
Merge into: lp:~stoq-dev/stoq/master-old
Diff against target: None lines
To merge this branch: bzr merge lp:~georgeyk/stoq/start_production
Reviewer Review Type Date Requested Status
Ronaldo Maia Approve
Review via email: mp+11148@code.launchpad.net
To post a comment you must log in.
Revision history for this message
George Kussumoto (georgeyk) wrote :
Revision history for this message
Ronaldo Maia (romaia) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/glade/production.glade'
--- data/glade/production.glade 2009-07-31 14:02:18 +0000
+++ data/glade/production.glade 2009-09-02 19:59:03 +0000
@@ -13,6 +13,14 @@
13 </widget>13 </widget>
14 </child>14 </child>
15 <child>15 <child>
16 <widget class="GtkAction" id="MenuStartProduction">
17 <property name="name">MenuStartProduction</property>
18 <property name="stock_id">stoq-transfer</property>
19 <property name="accelerator">&lt;Control&gt;t</property>
20 <property name="label" translatable="yes">Start Production...</property>
21 </widget>
22 </child>
23 <child>
16 <widget class="GtkAction" id="FinishOrder">24 <widget class="GtkAction" id="FinishOrder">
17 <property name="name">FinishOrder</property>25 <property name="name">FinishOrder</property>
18 <property name="label" translatable="yes">Finish Order...</property>26 <property name="label" translatable="yes">Finish Order...</property>
@@ -74,6 +82,13 @@
74 </widget>82 </widget>
75 </child>83 </child>
76 <child>84 <child>
85 <widget class="GtkAction" id="ToolbarStartProduction">
86 <property name="name">ToolbarStartProduction</property>
87 <property name="label" translatable="yes">Start Production</property>
88 <property name="stock_id">stoq-transfer</property>
89 </widget>
90 </child>
91 <child>
77 <widget class="GtkAction" id="ProductionMenu">92 <widget class="GtkAction" id="ProductionMenu">
78 <property name="name">ProductionMenu</property>93 <property name="name">ProductionMenu</property>
79 <property name="label" translatable="yes">_Production</property>94 <property name="label" translatable="yes">_Production</property>
@@ -123,7 +138,7 @@
123 <property name="label" translatable="yes">Services...</property>138 <property name="label" translatable="yes">Services...</property>
124 <property name="accelerator">&lt;Control&gt;s</property>139 <property name="accelerator">&lt;Control&gt;s</property>
125 </widget>140 </widget>
126 </child> 141 </child>
127 <child>142 <child>
128 <widget class="GtkAction" id="about_menu">143 <widget class="GtkAction" id="about_menu">
129 <property name="name">about_menu</property>144 <property name="name">about_menu</property>
@@ -159,6 +174,7 @@
159 <menubar action="menubar">174 <menubar action="menubar">
160 <menu action="ProductionMenu">175 <menu action="ProductionMenu">
161 <menuitem action="MenuNewProduction"/>176 <menuitem action="MenuNewProduction"/>
177 <menuitem action="MenuStartProduction"/>
162 <separator name="sep"/>178 <separator name="sep"/>
163 <menuitem action="ExportCSV"/>179 <menuitem action="ExportCSV"/>
164 <menuitem action="Quit"/>180 <menuitem action="Quit"/>
@@ -173,6 +189,7 @@
173 </menubar>189 </menubar>
174 <toolbar action="toolbar1">190 <toolbar action="toolbar1">
175 <toolitem action="ToolbarNewProduction"/>191 <toolitem action="ToolbarNewProduction"/>
192 <toolitem action="ToolbarStartProduction"/>
176 </toolbar>193 </toolbar>
177 </ui>]]></ui>194 </ui>]]></ui>
178 </widget>195 </widget>
179196
=== modified file 'stoq/gui/production/production.py'
--- stoq/gui/production/production.py 2009-07-31 14:02:18 +0000
+++ stoq/gui/production/production.py 2009-09-03 18:48:23 +0000
@@ -33,6 +33,7 @@
3333
34from stoqlib.database.runtime import new_transaction, finish_transaction34from stoqlib.database.runtime import new_transaction, finish_transaction
35from stoqlib.domain.production import ProductionOrder35from stoqlib.domain.production import ProductionOrder
36from stoqlib.gui.dialogs.startproduction import StartProductionDialog
36from stoqlib.gui.search.productionsearch import ProductionProductSearch37from stoqlib.gui.search.productionsearch import ProductionProductSearch
37from stoqlib.gui.search.servicesearch import ServiceSearch38from stoqlib.gui.search.servicesearch import ServiceSearch
38from stoqlib.gui.wizards.productionwizard import ProductionWizard39from stoqlib.gui.wizards.productionwizard import ProductionWizard
@@ -57,11 +58,15 @@
57 def _update_widgets(self):58 def _update_widgets(self):
58 selection = self.results.get_selected_rows()59 selection = self.results.get_selected_rows()
59 can_edit = False60 can_edit = False
61 can_start = False
60 if len(selection) == 1:62 if len(selection) == 1:
61 selected = selection[0]63 selected = selection[0]
62 can_edit = (selected.status == ProductionOrder.ORDER_OPENED or64 can_edit = (selected.status == ProductionOrder.ORDER_OPENED or
63 selected.status == ProductionOrder.ORDER_WAITING)65 selected.status == ProductionOrder.ORDER_WAITING)
66 can_start = can_edit
64 self.edit_button.set_sensitive(can_edit)67 self.edit_button.set_sensitive(can_edit)
68 self.MenuStartProduction.set_sensitive(can_start)
69 self.ToolbarStartProduction.set_sensitive(can_start)
6570
66 def _get_status_values(self):71 def _get_status_values(self):
67 items = [(text, value)72 items = [(text, value)
@@ -75,6 +80,17 @@
75 retval = self.run_dialog(ProductionWizard, trans, order)80 retval = self.run_dialog(ProductionWizard, trans, order)
76 finish_transaction(trans, retval)81 finish_transaction(trans, retval)
77 trans.close()82 trans.close()
83 self.refresh()
84
85 def _start_production_order(self):
86 trans = new_transaction()
87 order = trans.get(self.results.get_selected_rows()[0])
88 assert order is not None
89
90 retval = self.run_dialog(StartProductionDialog, trans, order)
91 finish_transaction(trans, retval)
92 trans.close()
93 self.refresh()
7894
79 #95 #
80 # SearchableAppWindow96 # SearchableAppWindow
@@ -95,7 +111,7 @@
95 data_type=str, expand=True),111 data_type=str, expand=True),
96 SearchColumn('open_date', title=_(u'Opened'),112 SearchColumn('open_date', title=_(u'Opened'),
97 data_type=datetime.date),113 data_type=datetime.date),
98 SearchColumn('closed_date', title=_(u'Closed'),114 SearchColumn('close_date', title=_(u'Closed'),
99 data_type=datetime.date),]115 data_type=datetime.date),]
100116
101 #117 #
@@ -111,9 +127,15 @@
111 def on_MenuNewProduction__activate(self, action):127 def on_MenuNewProduction__activate(self, action):
112 self._open_production_order()128 self._open_production_order()
113129
130 def on_MenuStartProduction__activate(self, action):
131 self._start_production_order()
132
114 def on_ToolbarNewProduction__activate(self, action):133 def on_ToolbarNewProduction__activate(self, action):
115 self._open_production_order()134 self._open_production_order()
116135
136 def on_ToolbarStartProduction__activate(self, action):
137 self._start_production_order()
138
117 def on_edit_button__clicked(self, widget):139 def on_edit_button__clicked(self, widget):
118 order = self.results.get_selected_rows()[0]140 order = self.results.get_selected_rows()[0]
119 assert order is not None141 assert order is not None

Subscribers

People subscribed via source and target branches