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
1=== modified file 'data/glade/production.glade'
2--- data/glade/production.glade 2009-07-31 14:02:18 +0000
3+++ data/glade/production.glade 2009-09-02 19:59:03 +0000
4@@ -13,6 +13,14 @@
5 </widget>
6 </child>
7 <child>
8+ <widget class="GtkAction" id="MenuStartProduction">
9+ <property name="name">MenuStartProduction</property>
10+ <property name="stock_id">stoq-transfer</property>
11+ <property name="accelerator">&lt;Control&gt;t</property>
12+ <property name="label" translatable="yes">Start Production...</property>
13+ </widget>
14+ </child>
15+ <child>
16 <widget class="GtkAction" id="FinishOrder">
17 <property name="name">FinishOrder</property>
18 <property name="label" translatable="yes">Finish Order...</property>
19@@ -74,6 +82,13 @@
20 </widget>
21 </child>
22 <child>
23+ <widget class="GtkAction" id="ToolbarStartProduction">
24+ <property name="name">ToolbarStartProduction</property>
25+ <property name="label" translatable="yes">Start Production</property>
26+ <property name="stock_id">stoq-transfer</property>
27+ </widget>
28+ </child>
29+ <child>
30 <widget class="GtkAction" id="ProductionMenu">
31 <property name="name">ProductionMenu</property>
32 <property name="label" translatable="yes">_Production</property>
33@@ -123,7 +138,7 @@
34 <property name="label" translatable="yes">Services...</property>
35 <property name="accelerator">&lt;Control&gt;s</property>
36 </widget>
37- </child>
38+ </child>
39 <child>
40 <widget class="GtkAction" id="about_menu">
41 <property name="name">about_menu</property>
42@@ -159,6 +174,7 @@
43 <menubar action="menubar">
44 <menu action="ProductionMenu">
45 <menuitem action="MenuNewProduction"/>
46+ <menuitem action="MenuStartProduction"/>
47 <separator name="sep"/>
48 <menuitem action="ExportCSV"/>
49 <menuitem action="Quit"/>
50@@ -173,6 +189,7 @@
51 </menubar>
52 <toolbar action="toolbar1">
53 <toolitem action="ToolbarNewProduction"/>
54+ <toolitem action="ToolbarStartProduction"/>
55 </toolbar>
56 </ui>]]></ui>
57 </widget>
58
59=== modified file 'stoq/gui/production/production.py'
60--- stoq/gui/production/production.py 2009-07-31 14:02:18 +0000
61+++ stoq/gui/production/production.py 2009-09-03 18:48:23 +0000
62@@ -33,6 +33,7 @@
63
64 from stoqlib.database.runtime import new_transaction, finish_transaction
65 from stoqlib.domain.production import ProductionOrder
66+from stoqlib.gui.dialogs.startproduction import StartProductionDialog
67 from stoqlib.gui.search.productionsearch import ProductionProductSearch
68 from stoqlib.gui.search.servicesearch import ServiceSearch
69 from stoqlib.gui.wizards.productionwizard import ProductionWizard
70@@ -57,11 +58,15 @@
71 def _update_widgets(self):
72 selection = self.results.get_selected_rows()
73 can_edit = False
74+ can_start = False
75 if len(selection) == 1:
76 selected = selection[0]
77 can_edit = (selected.status == ProductionOrder.ORDER_OPENED or
78 selected.status == ProductionOrder.ORDER_WAITING)
79+ can_start = can_edit
80 self.edit_button.set_sensitive(can_edit)
81+ self.MenuStartProduction.set_sensitive(can_start)
82+ self.ToolbarStartProduction.set_sensitive(can_start)
83
84 def _get_status_values(self):
85 items = [(text, value)
86@@ -75,6 +80,17 @@
87 retval = self.run_dialog(ProductionWizard, trans, order)
88 finish_transaction(trans, retval)
89 trans.close()
90+ self.refresh()
91+
92+ def _start_production_order(self):
93+ trans = new_transaction()
94+ order = trans.get(self.results.get_selected_rows()[0])
95+ assert order is not None
96+
97+ retval = self.run_dialog(StartProductionDialog, trans, order)
98+ finish_transaction(trans, retval)
99+ trans.close()
100+ self.refresh()
101
102 #
103 # SearchableAppWindow
104@@ -95,7 +111,7 @@
105 data_type=str, expand=True),
106 SearchColumn('open_date', title=_(u'Opened'),
107 data_type=datetime.date),
108- SearchColumn('closed_date', title=_(u'Closed'),
109+ SearchColumn('close_date', title=_(u'Closed'),
110 data_type=datetime.date),]
111
112 #
113@@ -111,9 +127,15 @@
114 def on_MenuNewProduction__activate(self, action):
115 self._open_production_order()
116
117+ def on_MenuStartProduction__activate(self, action):
118+ self._start_production_order()
119+
120 def on_ToolbarNewProduction__activate(self, action):
121 self._open_production_order()
122
123+ def on_ToolbarStartProduction__activate(self, action):
124+ self._start_production_order()
125+
126 def on_edit_button__clicked(self, widget):
127 order = self.results.get_selected_rows()[0]
128 assert order is not None

Subscribers

People subscribed via source and target branches