You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

484 lines
19 KiB

[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[IMP] website_shift: Refactor and fix bugs (s0030g) [IMP] website_shift: Next shifts for regular Refactor the generation of the next shift for regular worker. Fix: no next shifts shown when the worker is a new worker and doesn't have any past shift Fix: no next shifts shown when the next shift of the worker is not generated yet. [ADD] website_shift: Help texts [FIX] website_shift: Help texts Fix help text for the status based on the input from the members office [IMP] website_shift: Help texts translation Add translation for the help texts. [IMP] website_shift: Future alert date The future alert date has moved to beesdoo_shift module. So we use this one instead of re-compute it in the controller. [IMP] website_shift: Update manifest [FIX] website_shift: Better position for help text On a small screen help texts appear on the top of the page leaving useful info on the bottom. Now help texts is moved on the bottom of the page. [ADD] website_shift: Feedback when subscribing Add a feedback to the user about the successfulness of the subscription. [FIX] website_shift: Super-cooperator info modal The modal showing the super-cooperator information didn't work for the 'fictive' shift generated for regular workers. It's due to the fact that a 'fictive' shift doesn't have an id. So we should not use it to generate xml ids. Instead we use the index of the foreach loop. [FIX] website_shift: Wrong time when crossing DST The issue: There was a time difference of one hour when the fictive shifts cross the DST (Daylight Saving Time). Explanation: Python works with two types of datetime. The datetime without a timezone called *naive* and the one with a timezone called *non-naive*. `timedelta()` is used to add a number of day to a datetime. However, changing a non-naive datetime with `timedelta` just change the date but leave the timezone unchanged. That's no correct because the new date may not be in the same timezone because of the DST. If the new date is after a change of time, due to DST, the timezone of the non-naive datetime should be updated. Python don't do that because `timedelta` doesn't realy add days but add the corresponding hours ! So when adding hours it's consistent to not change the timezone (you can use `normalize()` to get your datetime in the right timezone after a cross of DST). To fix this, after adding a `timedelta` the timezone of the datetime should be set to none and the relocalized with the `localize()` function of the `pytz` corresponding timezone. [FIX] website_shift: Translations
6 years ago
[ADD] website_shift: Personal page for working information (#33) * [ADD] website_shift: Add configuration irregular_shift_limit: Maximum shift that will be shown highlight_rule: Treshold of available space in a shift that trigger the highlight of the shift hide_rule: Treshold ((available space)/(max space)) in percentage of available space under wich the shift is hidden The last one replaces the old hide filter. * [FIX] website_shift: Wrong mail on regular shift Fix the wrong email address that is shown on the public page that show available shift for irregular worker. * [ADD] website_shift: Irregular personal work page Add personal shift page for irregular worker that allows you to subscribe to a shift. * [ADD] website_shift: Personal page for non-worker Add a personal page for non-worker that shows a simple message telling them that they don't have to do a shift. * [ADD] website_shift: Regular personal work page Add personal shift page for regular worker. * [ADD] website_shift: Exempted personal work page Add personal shift page for exempted worker. * [IMP] website_shift: Shopping status personal page This add a label that shows the shopping status of a user. If the label is green the user can shop. If the label is red the user cannot shop. There is also icons for disambiguation. * [ADD] website_shift: Config en & dis shift sign up This add a configuration boolean that enable or disable the shift sign up for irregular worker. * [IMP] website_shift: Status on personal pages Show dates properly. Hide what's useless. Give meaningful name. * [IMP] website_shift: Design of personal pages * Lower size of h2 title. * Add top margin to h1. * Change highlight color. * Change position of explanation test. * [IMP] website_shift: Refactor templates Refactor templates to avoid dupplicate code. Refactor the controller to match with new templates. Add license. * [ADD] website_shift: Past shifts on personal page Add a list of the previous shifts for a worker. * [ADD] website_shift: Super Coop info Add a button to show email and phone of the super cooperator of a shift. Tell you if you are a Super Co-operator * [IMP] website_shift: Next shifts regular worker Add configuration to specify how many next shifts for regular worker must be shown to them on their personal web page. This config is called `regular_next_shift_limit`. Improve the view that shows the next shifts on the personal page for a regular worker regarding to the `regular_next_shift_limit`. Because all the next shifts are not created in the database, we need to create 'fictive' one that are not stored. * [ADD] website_shift: Warning about holidays Add a warning message on the personal page for a regular worker that tells that public holidays are not taken into account for the moment. * [IMP] website_theme: colors for warnings * [FIX] website_shift: 403 when subscribing Fix the case when an irregular worker that doesn't have write access to beesdoo.shift.shift try to subscribe to a shift and got a 403 error. * [FIX] website_theme: Theme must be an application As wrote in this document : https://www.odoo.com/documentation/9.0/howtos/themes.html#create-a-theme-module a theme module must be an application. * [FIX] webs_shift: Wrong display of date last shift Fix the case when an irregular worker is in alert and that the date before last shift is displayed. The `date_before_last_shift` is renamed in `future_alert_start_time`. This name better represent what this variable contains. It also explains why this information does not have to be displayed when the worker is already in alert mode as this date is the date in the future on which the worker will be in alert. * [FIX] website_shift: Co-operator -> Cooperator * [FIX] website_shift: Past shifts not ordered desc The past shift was not properly ordered. This fix by ordering the past shifts from the newest to the oldest. * [FIX] website_shift: Holiday shown after end of it Before: The holiday is shown even if the holiday is in the past. After: The holiday is shown only if the holiday is now or in the future.
6 years ago
  1. # -*- coding: utf8 -*-
  2. # Copyright 2017-2018 Rémy Taymans <remytaymans@gmail.com>
  3. # Copyright 2017-2018 Thibault François
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from ast import literal_eval
  6. from datetime import datetime, timedelta
  7. from itertools import groupby
  8. from pytz import timezone, utc
  9. from openerp import http, fields
  10. from openerp.http import request
  11. from openerp.addons.beesdoo_shift.models.planning import float_to_time
  12. from openerp.addons.beesdoo_shift.models.cooperative_status import PERIOD
  13. class WebsiteShiftController(http.Controller):
  14. def is_user_worker(self):
  15. user = request.env['res.users'].browse(request.uid)
  16. return user.partner_id.is_worker
  17. def is_user_irregular(self):
  18. user = request.env['res.users'].browse(request.uid)
  19. working_mode = user.partner_id.working_mode
  20. return working_mode == 'irregular'
  21. def is_user_regular(self):
  22. user = request.env['res.users'].browse(request.uid)
  23. working_mode = user.partner_id.working_mode
  24. return working_mode == 'regular'
  25. def is_user_regular_without_shift(self):
  26. user = request.env['res.users'].browse(request.uid)
  27. return (not user.partner_id.subscribed_shift_ids.id
  28. and self.is_user_regular())
  29. def is_user_exempted(self):
  30. user = request.env['res.users'].browse(request.uid)
  31. working_mode = user.partner_id.working_mode
  32. return working_mode == 'exempt'
  33. def user_can_subscribe(self, user=None):
  34. """Return True if a user can subscribe to a shift. A user can
  35. subiscribe if:
  36. * the user is an irregular worker
  37. * the user is not unsubscribed
  38. * the user is not resigning
  39. """
  40. if not user:
  41. user = request.env['res.users'].browse(request.uid)
  42. return (user.partner_id.working_mode == 'irregular'
  43. and user.partner_id.state != 'unsubscribed'
  44. and user.partner_id.state != 'resigning')
  45. def add_days(self, datetime, days):
  46. """
  47. Add the number of days to datetime. This take the DST in
  48. account, meaning that the UTC time will be correct even if the
  49. new datetime has cross the DST boundary.
  50. :param datetime: a naive datetime expressed in UTC
  51. :return: a naive datetime expressed in UTC with the added days
  52. """
  53. # Ensure that the datetime given is without a timezone
  54. assert datetime.tzinfo is None
  55. # Get current user and user timezone
  56. # Take user tz, if empty use context tz, if empty use UTC
  57. cur_user = request.env['res.users'].browse(request.uid)
  58. user_tz = utc
  59. if cur_user.tz:
  60. user_tz = timezone(cur_user.tz)
  61. elif request.env.context['tz']:
  62. user_tz = timezone(request.env.context['tz'])
  63. # Convert to UTC
  64. dt_utc = utc.localize(datetime, is_dst=False)
  65. # Convert to user TZ
  66. dt_local = dt_utc.astimezone(user_tz)
  67. # Add the number of days
  68. newdt_local = dt_local + timedelta(days=days)
  69. # If the newdt_local has cross the DST boundary, its tzinfo is
  70. # no longer correct. So it will be replaced by the correct one.
  71. newdt_local = user_tz.localize(newdt_local.replace(tzinfo=None))
  72. # Now the newdt_local has the right DST so it can be converted
  73. # to UTC.
  74. newdt_utc = newdt_local.astimezone(utc)
  75. return newdt_utc.replace(tzinfo=None)
  76. @http.route('/my/shift', auth='user', website=True)
  77. def my_shift(self, **kw):
  78. """
  79. Personal page for managing your shifts
  80. """
  81. if self.is_user_irregular():
  82. return request.render(
  83. 'beesdoo_website_shift.my_shift_irregular_worker',
  84. self.my_shift_irregular_worker(nexturl='/my/shift')
  85. )
  86. if self.is_user_regular_without_shift():
  87. return request.render(
  88. 'beesdoo_website_shift.my_shift_regular_worker_without_shift',
  89. self.my_shift_regular_worker_without_shift()
  90. )
  91. if self.is_user_regular():
  92. return request.render(
  93. 'beesdoo_website_shift.my_shift_regular_worker',
  94. self.my_shift_regular_worker()
  95. )
  96. if self.is_user_exempted():
  97. return request.render(
  98. 'beesdoo_website_shift.my_shift_exempted_worker',
  99. self.my_shift_exempted_worker()
  100. )
  101. if self.is_user_worker():
  102. return request.render(
  103. 'beesdoo_website_shift.my_shift_new_worker',
  104. {}
  105. )
  106. return request.render(
  107. 'beesdoo_website_shift.my_shift_non_worker',
  108. {}
  109. )
  110. @http.route('/shift/<int:shift_id>/subscribe', auth='user', website=True)
  111. def subscribe_to_shift(self, shift_id=-1, **kw):
  112. """
  113. Subscribe the current connected user into the given shift
  114. This is done only if :
  115. * shift sign up is authorised via configuration panel
  116. * the user can subscribe
  117. * the given shift exist
  118. * the shift status is open
  119. * the shift is free for subscription
  120. * the shift is starting after the time interval
  121. for attendance sheet generation defined in beesdoo_shift settings
  122. """
  123. # Get current user
  124. cur_user = request.env['res.users'].browse(request.uid)
  125. # Get the shift
  126. shift = request.env['beesdoo.shift.shift'].sudo().browse(shift_id)
  127. # Get config
  128. irregular_enable_sign_up = literal_eval(request.env['ir.config_parameter'].get_param(
  129. 'beesdoo_website_shift.irregular_enable_sign_up'))
  130. # Set start time limit as defined in beesdoo_shift settings
  131. setting = int(
  132. request.env["ir.config_parameter"].get_param(
  133. "beesdoo_shift.attendance_sheet_generation_interval"
  134. )
  135. )
  136. start_time_limit = datetime.now() + timedelta(minutes=setting)
  137. shift_start_time = fields.Datetime.from_string(shift.start_time)
  138. request.session['success'] = False
  139. if (irregular_enable_sign_up
  140. and self.user_can_subscribe()
  141. and shift
  142. and shift.state == "open"
  143. and shift_start_time > start_time_limit
  144. and not shift.worker_id):
  145. shift.worker_id = cur_user.partner_id
  146. request.session['success'] = True
  147. return request.redirect(kw['nexturl'])
  148. @http.route('/shift_irregular_worker', auth='public', website=True)
  149. def public_shift_irregular_worker(self, **kw):
  150. """
  151. Show a public access page that show all the available shifts for irregular worker.
  152. """
  153. nexturl = '/shift_irregular_worker'
  154. irregular_enable_sign_up = False
  155. # Create template context
  156. template_context = {}
  157. template_context.update(self.available_shift_irregular_worker(
  158. irregular_enable_sign_up, nexturl
  159. ))
  160. return request.render(
  161. 'beesdoo_website_shift.public_shift_irregular_worker',
  162. template_context
  163. )
  164. @http.route('/shift_template_regular_worker', auth='public', website=True)
  165. def public_shift_template_regular_worker(self, **kw):
  166. """
  167. Show a public access page that show all the available shift templates for regular worker.
  168. """
  169. # Get all the task template
  170. template = request.env['beesdoo.shift.template']
  171. task_templates = template.sudo().search([], order="planning_id, day_nb_id, start_time")
  172. # Get config
  173. regular_highlight_rule = literal_eval(
  174. request.env['ir.config_parameter'].get_param(
  175. 'beesdoo_website_shift.regular_highlight_rule'
  176. )
  177. )
  178. task_tpls_data = []
  179. for task_tpl in task_templates:
  180. has_enough_workers = (
  181. task_tpl.remaining_worker <= (
  182. task_tpl.worker_nb * regular_highlight_rule / 100
  183. )
  184. )
  185. task_tpls_data.append((task_tpl, has_enough_workers))
  186. return request.render(
  187. 'beesdoo_website_shift.public_shift_template_regular_worker',
  188. {
  189. 'task_tpls_data': task_tpls_data,
  190. 'float_to_time': float_to_time,
  191. }
  192. )
  193. def my_shift_irregular_worker(self, nexturl=""):
  194. """
  195. Return template variables for 'beesdoo_website_shift.my_shift_irregular_worker' template
  196. """
  197. # Get config
  198. irregular_enable_sign_up = literal_eval(request.env['ir.config_parameter'].get_param(
  199. 'beesdoo_website_shift.irregular_enable_sign_up'))
  200. # Create template context
  201. template_context = {}
  202. template_context.update(self.my_shift_worker_status())
  203. template_context.update(self.my_shift_next_shifts())
  204. template_context.update(self.my_shift_past_shifts())
  205. template_context.update(self.available_shift_irregular_worker(
  206. irregular_enable_sign_up and self.user_can_subscribe(), nexturl
  207. ))
  208. # Add feedback about the success or the fail of the subscription
  209. template_context['back_from_subscription'] = False
  210. if 'success' in request.session:
  211. template_context['back_from_subscription'] = True
  212. template_context['success'] = request.session.get('success')
  213. del request.session['success']
  214. # Add setting for subscription allowed time
  215. subscription_time_limit = int(
  216. request.env["ir.config_parameter"].get_param(
  217. "beesdoo_shift.attendance_sheet_generation_interval"
  218. )
  219. )
  220. template_context['subscription_time_limit'] = subscription_time_limit
  221. return template_context
  222. def my_shift_regular_worker_without_shift(self):
  223. """
  224. Return template variables for 'beesdoo_website_shift.my_shift_regular_worker_without_shift' template
  225. """
  226. return self.my_shift_worker_status()
  227. def my_shift_regular_worker(self):
  228. """
  229. Return template variables for 'beesdoo_website_shift.my_shift_regular_worker' template
  230. """
  231. # Create template context
  232. template_context = {}
  233. # Get all the task template
  234. template = request.env['beesdoo.shift.template']
  235. task_templates = template.sudo().search([], order="planning_id, day_nb_id, start_time")
  236. template_context.update(self.my_shift_worker_status())
  237. template_context.update(self.my_shift_next_shifts())
  238. template_context.update(self.my_shift_past_shifts())
  239. template_context.update(
  240. {
  241. 'task_templates': task_templates,
  242. 'float_to_time': float_to_time,
  243. }
  244. )
  245. return template_context
  246. def my_shift_exempted_worker(self):
  247. """
  248. Return template variables for 'beesdoo_website_shift.my_shift_exempted_worker' template
  249. """
  250. return self.my_shift_worker_status()
  251. def available_shift_irregular_worker(self, irregular_enable_sign_up=False,
  252. nexturl=""):
  253. """
  254. Return template variables for
  255. 'beesdoo_website_shift.available_shift_irregular_worker' template
  256. """
  257. # Get current user
  258. cur_user = request.env['res.users'].browse(request.uid)
  259. # Get all the shifts in the future with no worker
  260. now = datetime.now()
  261. shifts = request.env['beesdoo.shift.shift'].sudo().search(
  262. [('start_time', '>', now.strftime("%Y-%m-%d %H:%M:%S")),
  263. ('worker_id', '=', False),
  264. ('state', '=', 'open')],
  265. order="start_time, task_template_id, task_type_id",
  266. )
  267. # Get shifts where user is subscribed
  268. subscribed_shifts = request.env['beesdoo.shift.shift'].sudo().search(
  269. [('start_time', '>', now.strftime("%Y-%m-%d %H:%M:%S")),
  270. ('worker_id', '=', cur_user.partner_id.id)],
  271. order="start_time, task_template_id, task_type_id",
  272. )
  273. # Get config
  274. irregular_shift_limit = int(
  275. request.env['ir.config_parameter']
  276. .get_param('beesdoo_website_shift.irregular_shift_limit')
  277. )
  278. highlight_rule_pc = int(
  279. request.env['ir.config_parameter']
  280. .get_param('beesdoo_website_shift.highlight_rule_pc')
  281. )
  282. hide_rule = int(
  283. request.env['ir.config_parameter']
  284. .get_param('beesdoo_website_shift.hide_rule')
  285. ) / 100.0
  286. # Grouby task_template_id, if no task_template_id is specified
  287. # then group by start_time, if no start_time specified sort by
  288. # task_type
  289. groupby_iter = groupby(
  290. shifts,
  291. lambda s: (s.task_template_id, s.start_time, s.task_type_id)
  292. )
  293. shifts_count_subscribed = []
  294. nb_displayed_shift = 0 # Number of shift displayed
  295. for (keys, grouped_shifts) in groupby_iter:
  296. (task_template, start_time, task_type) = keys
  297. nb_displayed_shift = nb_displayed_shift + 1
  298. shift_list = list(grouped_shifts)
  299. # Compute available space
  300. free_space = len(shift_list)
  301. # Is the current user subscribed to this task_template
  302. is_subscribed = any(
  303. (sub_shift.task_template_id == task_template and
  304. sub_shift.start_time == start_time and
  305. sub_shift.task_type_id == task_type)
  306. for sub_shift in subscribed_shifts)
  307. # Check the necessary number of worker based on the
  308. # highlight_rule_pc
  309. has_enough_workers = free_space <= (task_template.worker_nb
  310. * highlight_rule_pc) / 100
  311. if free_space >= task_template.worker_nb * hide_rule:
  312. shifts_count_subscribed.append([
  313. shift_list[0],
  314. free_space,
  315. is_subscribed,
  316. has_enough_workers,
  317. ])
  318. # Stop showing shifts if the limit is reached
  319. if irregular_shift_limit > 0 and nb_displayed_shift >= irregular_shift_limit:
  320. break
  321. return {
  322. 'shift_templates': shifts_count_subscribed,
  323. 'nexturl': nexturl,
  324. 'irregular_enable_sign_up': irregular_enable_sign_up,
  325. }
  326. def my_shift_next_shifts(self):
  327. """
  328. Return template variables for 'beesdoo_website_shift.my_shift_next_shifts' template
  329. """
  330. # Get current user
  331. cur_user = request.env['res.users'].browse(request.uid)
  332. # Get shifts where user is subscribed
  333. now = datetime.now()
  334. subscribed_shifts_rec = request.env['beesdoo.shift.shift'].sudo().search(
  335. [('start_time', '>', now.strftime("%Y-%m-%d %H:%M:%S")),
  336. ('worker_id', '=', cur_user.partner_id.id)],
  337. order="start_time, task_template_id, task_type_id",
  338. )
  339. # Create a list of record in order to add new record to it later
  340. subscribed_shifts = []
  341. for rec in subscribed_shifts_rec:
  342. subscribed_shifts.append(rec)
  343. # In case of regular worker, we compute his fictive next shifts
  344. # according to the regular_next_shift_limit
  345. if self.is_user_regular():
  346. # Compute main shift
  347. nb_subscribed_shifts = len(subscribed_shifts)
  348. if nb_subscribed_shifts > 0:
  349. main_shift = subscribed_shifts[-1]
  350. else:
  351. task_template = request.env['beesdoo.shift.template'].sudo().search(
  352. [('worker_ids', 'in', cur_user.partner_id.id)],
  353. limit=1,
  354. )
  355. main_shift = request.env['beesdoo.shift.shift'].sudo().search(
  356. [('task_template_id', '=', task_template[0].id),
  357. ('start_time', '!=', False),
  358. ('end_time', '!=', False)],
  359. order="start_time desc",
  360. limit=1,
  361. )
  362. # Get config
  363. regular_next_shift_limit = int(request.env['ir.config_parameter'].get_param(
  364. 'beesdoo_website_shift.regular_next_shift_limit'))
  365. for i in range(nb_subscribed_shifts, regular_next_shift_limit):
  366. # Create the fictive shift
  367. shift = main_shift.new()
  368. shift.name = main_shift.name
  369. shift.task_template_id = shift.task_template_id
  370. shift.planning_id = main_shift.planning_id
  371. shift.task_type_id = main_shift.task_type_id
  372. shift.worker_id = main_shift.worker_id
  373. shift.state = "draft"
  374. shift.super_coop_id = main_shift.super_coop_id
  375. shift.color = main_shift.color
  376. shift.is_regular = main_shift.is_regular
  377. shift.replaced_id = main_shift.replaced_id
  378. shift.revert_info = main_shift.revert_info
  379. # Set new date
  380. shift.start_time = self.add_days(
  381. fields.Datetime.from_string(main_shift.start_time),
  382. days=i * PERIOD
  383. )
  384. shift.end_time = self.add_days(
  385. fields.Datetime.from_string(main_shift.end_time),
  386. days=i * PERIOD
  387. )
  388. # Add the fictive shift to the list of shift
  389. subscribed_shifts.append(shift)
  390. return {
  391. 'is_regular': self.is_user_regular(),
  392. 'subscribed_shifts': subscribed_shifts,
  393. }
  394. def my_shift_past_shifts(self):
  395. """
  396. Return template variables for 'beesdoo_website_shift.my_shift_past_shifts' template
  397. """
  398. # Get current user
  399. cur_user = request.env['res.users'].browse(request.uid)
  400. # Get config
  401. past_shift_limit = 0
  402. if self.is_user_irregular():
  403. past_shift_limit = int(request.env['ir.config_parameter'].get_param(
  404. 'beesdoo_website_shift.irregular_past_shift_limit'))
  405. if self.is_user_regular():
  406. past_shift_limit = int(request.env['ir.config_parameter'].get_param(
  407. 'beesdoo_website_shift.regular_past_shift_limit'))
  408. # Get shifts where user was subscribed
  409. now = datetime.now()
  410. if past_shift_limit > 0:
  411. past_shifts = request.env['beesdoo.shift.shift'].sudo().search(
  412. [('start_time', '<=', now.strftime("%Y-%m-%d %H:%M:%S")),
  413. ('worker_id', '=', cur_user.partner_id.id)],
  414. order="start_time desc, task_template_id, task_type_id",
  415. limit=past_shift_limit,
  416. )
  417. else:
  418. past_shifts = request.env['beesdoo.shift.shift'].sudo().search(
  419. [('start_time', '<=', now.strftime("%Y-%m-%d %H:%M:%S")),
  420. ('worker_id', '=', cur_user.partner_id.id)],
  421. order="start_time desc, task_template_id, task_type_id",
  422. )
  423. return {
  424. 'past_shifts': past_shifts,
  425. }
  426. def my_shift_worker_status(self):
  427. """
  428. Return template variables for 'beesdoo_website_shift.my_shift_worker_status_*' template
  429. """
  430. cur_user = request.env['res.users'].browse(request.uid)
  431. return {
  432. 'status': cur_user.partner_id.cooperative_status_ids,
  433. }