← Back to team overview

oerppy-hackers team mailing list archive

[Branch ~oerppy-hackers/oerppy/trunk] Rev 39: * Added missing bin script.

 

------------------------------------------------------------
revno: 39
committer: duncan@xxxxxxxxxx
branch nick: trunk
timestamp: Mon 2011-06-06 10:07:36 -0600
message:
  * Added missing bin script.
  * Renamed a method.
added:
  bin/export_oem_users
modified:
  oerppy/addons/canonical/query.py


--
lp:oerppy
https://code.launchpad.net/~oerppy-hackers/oerppy/trunk

Your team oerppy Hackers is subscribed to branch lp:oerppy.
To unsubscribe from this branch go to https://code.launchpad.net/~oerppy-hackers/oerppy/trunk/+edit-subscription
=== added file 'bin/export_oem_users'
--- bin/export_oem_users	1970-01-01 00:00:00 +0000
+++ bin/export_oem_users	2011-06-06 16:07:36 +0000
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+from oerppy.config import get_config_data
+from oerppy.reg import registry
+
+# XXX we probably want to eventually put these addons in their own project
+from oerppy.addons.canonical import query
+from oerppy.addons.canonical.scripting import export
+
+
+# get configuration; note that option parsing is handled by the script
+# class(es)
+config_data = get_config_data()
+# setup any addons that we want
+registry.add("canonical", query.CanonicalQuery)
+# run the exporter
+monthly_export = export.OEMUsersExport(config_data)
+monthly_export.run()

=== modified file 'oerppy/addons/canonical/query.py'
--- oerppy/addons/canonical/query.py	2011-06-03 22:03:45 +0000
+++ oerppy/addons/canonical/query.py	2011-06-06 16:07:36 +0000
@@ -16,6 +16,9 @@
         """
         A dispatch method that runs the query for the given report name, and
         optionally, domains.
+
+        Note that this is used primarily by the GUI, though since it's here,
+        the command line export scripts use is as well.
         """
         if not domains:
             domains = []
@@ -24,7 +27,7 @@
         if report == const.TIMESHEET_HOURS:
             records = self.timesheet_hours(domains)
         elif report == const.TIMESHEETS_WEEKLY:
-            records = self.weekly_timesheets(domains)
+            records = self.weekly_oem_timesheets(domains)
         else:
             raise OpenERPPyParameterError("Unknown value for 'report.'")
         return records
@@ -51,7 +54,7 @@
         result = model.UserCategoriesSet(raw_results).get_first()
         return result.user_ids
 
-    def weekly_timesheets(self, domains):
+    def weekly_oem_timesheets(self, domains):
         """
         Get the weekly timeentry records, highlighting the missing weeks.
         """