diff options
| author | jam-openerp <jam@tinyerp.com> | 2011-01-03 11:06:08 +0530 |
|---|---|---|
| committer | jam-openerp <jam@tinyerp.com> | 2011-01-03 11:06:08 +0530 |
| commit | ac0383a75e034ba00a05718e58164dc1189bfc1f (patch) | |
| tree | 59d49ffa1bf30d6bae8ec40d159c14f3a353a432 /addons/project_long_term | |
| parent | cb836a0746fa1da235a8ead0a608321e24b3990e (diff) | |
| parent | e1a001b64e3dbf1b355557fea7839e5f04125c78 (diff) | |
[MERGE] with lp:~openerp-dev/openobject-addons/trunk-dev-addons1
bzr revid: jam@tinyerp.com-20101231135456-xcktbmwckrnljpxp
bzr revid: jam@tinyerp.com-20110103053608-jhnrh5eq2q05k7ca
Diffstat (limited to 'addons/project_long_term')
| -rw-r--r-- | addons/project_long_term/i18n/de.po | 12 | ||||
| -rw-r--r-- | addons/project_long_term/i18n/es.po | 17 | ||||
| -rw-r--r-- | addons/project_long_term/i18n/fr.po | 12 | ||||
| -rw-r--r-- | addons/project_long_term/i18n/lv.po | 24 | ||||
| -rw-r--r-- | addons/project_long_term/i18n/pl.po | 22 | ||||
| -rw-r--r-- | addons/project_long_term/i18n/pt.po | 14 | ||||
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 14 |
7 files changed, 78 insertions, 37 deletions
diff --git a/addons/project_long_term/i18n/de.po b/addons/project_long_term/i18n/de.po index d61ad1f0227..9c4a72f7a7c 100644 --- a/addons/project_long_term/i18n/de.po +++ b/addons/project_long_term/i18n/de.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-12-30 23:18+0000\n" +"PO-Revision-Date: 2010-12-31 14:22+0000\n" "Last-Translator: Thorsten Vocks (OpenBig.org) <thorsten.vocks@big-" "consulting.net>\n" "Language-Team: German <de@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-31 05:28+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -187,7 +187,8 @@ msgstr "Ende Datum" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "It's computed by the scheduler according to the start date and the duration. +msgid "" +"It's computed by the scheduler according to the start date and the duration." msgstr "Ende Datum d. Phase" #. module: project_long_term @@ -540,7 +541,10 @@ msgstr "Phase" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "It's computed according to the phases order : the start date of the 1st phase is set by you while the other start dates depend on the end date of their previous phases" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" msgstr "Beginn der Phase" #. module: project_long_term diff --git a/addons/project_long_term/i18n/es.po b/addons/project_long_term/i18n/es.po index 2e961b5d93f..97294142262 100644 --- a/addons/project_long_term/i18n/es.po +++ b/addons/project_long_term/i18n/es.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-12-29 09:54+0000\n" +"PO-Revision-Date: 2010-12-31 10:23+0000\n" "Last-Translator: Borja López Soilán <borjalopezsoilan@gmail.com>\n" "Language-Team: Spanish <es@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-31 05:28+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -167,8 +167,9 @@ msgstr "Fecha de fin" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "Ending Date of the phase" -msgstr "Fecha de fin de la fase" +msgid "" +"It's computed by the scheduler according to the start date and the duration." +msgstr "" #. module: project_long_term #: view:project.phase:0 @@ -507,7 +508,10 @@ msgstr "Fase" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "Starting Date of the phase" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" msgstr "" #. module: project_long_term @@ -614,3 +618,6 @@ msgstr "Por defecto en días" #: field:project.phase,duration:0 msgid "Duration" msgstr "Duración" + +#~ msgid "Ending Date of the phase" +#~ msgstr "Fecha de fin de la fase" diff --git a/addons/project_long_term/i18n/fr.po b/addons/project_long_term/i18n/fr.po index b66650adf71..3b7d111daac 100644 --- a/addons/project_long_term/i18n/fr.po +++ b/addons/project_long_term/i18n/fr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-12-24 22:25+0000\n" +"PO-Revision-Date: 2010-12-31 11:08+0000\n" "Last-Translator: lolivier <olivier.lenoir@free.fr>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-25 04:52+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -164,7 +164,8 @@ msgstr "Date de fin" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "It's computed by the scheduler according to the start date and the duration." +msgid "" +"It's computed by the scheduler according to the start date and the duration." msgstr "Date de fin de la phase" #. module: project_long_term @@ -518,7 +519,10 @@ msgstr "Phase" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "It's computed according to the phases order : the start date of the 1st phase is set by you while the other start dates depend on the end date of their previous phases" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" msgstr "Date de début de la phase" #. module: project_long_term diff --git a/addons/project_long_term/i18n/lv.po b/addons/project_long_term/i18n/lv.po index 276527c2e23..508efda1634 100644 --- a/addons/project_long_term/i18n/lv.po +++ b/addons/project_long_term/i18n/lv.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-12-30 22:20+0000\n" -"Last-Translator: Vladimirs Kuzmins <Unknown>\n" +"PO-Revision-Date: 2010-12-31 10:24+0000\n" +"Last-Translator: OpenERP Administrators <Unknown>\n" "Language-Team: Latvian <lv@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-31 05:28+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -165,8 +165,9 @@ msgstr "Beigu Datums" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "Ending Date of the phase" -msgstr "Fāzes beigu datums" +msgid "" +"It's computed by the scheduler according to the start date and the duration." +msgstr "" #. module: project_long_term #: view:project.phase:0 @@ -504,8 +505,11 @@ msgstr "Fāze" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "Starting Date of the phase" -msgstr "Fāzes sākuma datums" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" +msgstr "" #. module: project_long_term #: help:project.phase,state:0 @@ -611,3 +615,9 @@ msgstr "Pēc noklusējuma dienās" #: field:project.phase,duration:0 msgid "Duration" msgstr "Ilgums" + +#~ msgid "Ending Date of the phase" +#~ msgstr "Fāzes beigu datums" + +#~ msgid "Starting Date of the phase" +#~ msgstr "Fāzes sākuma datums" diff --git a/addons/project_long_term/i18n/pl.po b/addons/project_long_term/i18n/pl.po index 85f801f47ec..7f9ba5b37ef 100644 --- a/addons/project_long_term/i18n/pl.po +++ b/addons/project_long_term/i18n/pl.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-11-05 09:42+0000\n" -"Last-Translator: OpenERP Administrators <Unknown>\n" +"PO-Revision-Date: 2010-12-31 11:08+0000\n" +"Last-Translator: Sbh (Open ERP) <sbh@tinyerp.com>\n" "Language-Team: Polish <pl@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-24 05:57+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -165,7 +165,8 @@ msgstr "Data końcowa" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "It's computed by the scheduler according to the start date and the duration." +msgid "" +"It's computed by the scheduler according to the start date and the duration." msgstr "Końcowa data fazy" #. module: project_long_term @@ -505,8 +506,11 @@ msgstr "Faza" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "It's computed according to the phases order : the start date of the 1st phase is set by you while the other start dates depend on the end date of their previous phasesStarting Date of the phase" -msgstr "Data rozpoczęcia fazy" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" +msgstr "" #. module: project_long_term #: help:project.phase,state:0 @@ -641,3 +645,9 @@ msgstr "Czas trwania" #~ msgstr "" #~ "Nazwa obiektu musi zaczynać się od x_ oraz nie może zawierać znaków " #~ "specjalnych !" + +#~ msgid "" +#~ "It's computed according to the phases order : the start date of the 1st " +#~ "phase is set by you while the other start dates depend on the end date of " +#~ "their previous phasesStarting Date of the phase" +#~ msgstr "Data rozpoczęcia fazy" diff --git a/addons/project_long_term/i18n/pt.po b/addons/project_long_term/i18n/pt.po index 3ca11d8d557..2d24cac1e7a 100644 --- a/addons/project_long_term/i18n/pt.po +++ b/addons/project_long_term/i18n/pt.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2010-12-21 19:44+0000\n" -"PO-Revision-Date: 2010-12-12 09:19+0000\n" -"Last-Translator: OpenERP Administrators <Unknown>\n" +"PO-Revision-Date: 2010-12-31 11:07+0000\n" +"Last-Translator: Sbh (Open ERP) <sbh@tinyerp.com>\n" "Language-Team: Portuguese <pt@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-12-24 05:57+0000\n" +"X-Launchpad-Export-Date: 2011-01-01 05:05+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_long_term @@ -165,7 +165,8 @@ msgstr "Data de fim" #. module: project_long_term #: help:project.phase,date_end:0 -msgid "It's computed by the scheduler according to the start date and the duration." +msgid "" +"It's computed by the scheduler according to the start date and the duration." msgstr "Data de fim da fase" #. module: project_long_term @@ -504,7 +505,10 @@ msgstr "Fase" #. module: project_long_term #: help:project.phase,date_start:0 -msgid "It's computed according to the phases order : the start date of the 1st phase is set by you while the other start dates depend on the end date of their previous phases" +msgid "" +"It's computed according to the phases order : the start date of the 1st " +"phase is set by you while the other start dates depend on the end date of " +"their previous phases" msgstr "Data de início da fase" #. module: project_long_term diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index c8dbcdf0dcd..45d75b16b05 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -19,7 +19,7 @@ # ############################################################################## -from datetime import datetime +from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from tools.translate import _ from osv import fields, osv @@ -246,8 +246,10 @@ class project_phase(osv.osv): if not start_date: start_date = phase.project_id.date_start or phase.date_start or datetime.now().strftime("%Y-%m-%d") start_date = datetime.strftime((datetime.strptime(start_date, "%Y-%m-%d")), "%Y-%m-%d") - phase_resource_obj = resource_pool.generate_resources(cr, uid, [phase.responsible_id.id], calendar_id, context=context) + phase_resource_obj = self.generate_resources(cr, uid, [phase.id], context=context)[phase.id] avg_days = uom_pool._compute_qty(cr, uid, phase.product_uom.id, phase.duration, day_uom_id) + if not phase_resource_obj: #TOCHECK: why need this ? + avg_days = avg_days - 1 duration = str(avg_days) + 'd' # Create a new project for each phase def Project(): @@ -295,10 +297,10 @@ class project_phase(osv.osv): 'date_end': end_date.strftime('%Y-%m-%d') }, context=ctx) # Recursive call till all the next phases scheduled - for phase in phase.next_phase_ids: - if phase.state in ['draft', 'open', 'pending']: - id_cal = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False - self.generate_schedule(cr, uid, [phase.id], date_start, id_cal, context=context) + for next_phase in phase.next_phase_ids: + if next_phase.state in ['draft', 'open', 'pending']: + id_cal = next_phase.project_id.resource_calendar_id and next_phase.project_id.resource_calendar_id.id or False + self.generate_schedule(cr, uid, [next_phase.id], date_start+timedelta(days=1), id_cal, context=context) else: continue return True |
