Skip to content
Permalink
Browse files

Merge pull request #734 from Ommo73/12.0-autostaging_base-porting

12.0 autostaging base, autostaging project task porting
  • Loading branch information...
Ramil-Mukhametzyanov committed May 15, 2019
2 parents 58f3b3d + de94a0d commit 2040f4b184110fcf80e06ac9e5304af515c9b662
@@ -27,7 +27,7 @@ Maintainers

To get a guaranteed support
you are kindly requested to purchase the module
at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/autostaging_base/>`__.
at `odoo apps store <https://apps.odoo.com/apps/modules/12.0/autostaging_base/>`__.

Thank you for understanding!

@@ -36,14 +36,14 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/misc-addons/11.0
Demo: http://runbot.it-projects.info/demo/misc-addons/12.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/autostaging_base/
HTML Description: https://apps.odoo.com/apps/modules/12.0/autostaging_base/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/misc-addons/commits/11.0/autostaging_base.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/misc-addons/commits/11.0/autostaging_base.atom>`_
Notifications on updates: `via Atom <https://github.com/it-projects-llc/misc-addons/commits/12.0/autostaging_base.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/misc-addons/commits/12.0/autostaging_base.atom>`_

Tested on Odoo 11.0 a54b65bbb2f582136b0a358a4a576d3c38b0369e
Tested on Odoo 12.0 1e6f47ae56efe22101aa3db6159cd3cc16b9c120
@@ -6,9 +6,9 @@
"name": """Autostaging (technical core)""",
"summary": """Change stages automatically after a specified time""",
"category": "Hidden",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=11.0",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=12.0",
"images": [],
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Ildar Nasyrov",
@@ -35,7 +35,7 @@
"uninstall_hook": None,

"auto_install": False,
"installable": False,
"installable": True,

# "demo_title": "{MODULE_NAME}",
# "demo_addons": [
@@ -13,13 +13,15 @@

class AutostagingFolder(models.AbstractModel):
_name = 'autostaging.folder'
_description = 'autostaging_folder'
autostaging_enabled = fields.Boolean('Autostaging enabled', default=True)


class AutostagingStage(models.AbstractModel):
_name = 'autostaging.stage'
_card_model = 'define_some_card_model'
_card_stage_id = 'define_some_card_stage_id'
_description = 'autostaging_stage'
autostaging_idle_timeout = fields.Integer('Autostagint idle timeout')
autostaging_enabled = fields.Boolean('Autostaging enabled', default=False)
# should be defined on inherired model:
@@ -47,6 +49,7 @@ class AutostagingCard(models.AbstractModel):
_name = 'autostaging.card'
_field_folder_id = 'define_some_field_folder_id'
_field_stage_id = 'define_some_field_stage_id'
_description = 'autostaging_card'

autostaging_date = fields.Date(string='Autostaging date', readonly=True)
autostaging_days_left = fields.Integer(string='Days left', compute='_compute_autostaging_days_left')
@@ -73,7 +76,7 @@ def _get_autostaging_date(self):
self.ensure_one()
delta = datetime.timedelta(days=getattr(self, self._field_stage_id).autostaging_idle_timeout)
return (datetime.datetime.strptime(
self.write_date, DEFAULT_SERVER_DATETIME_FORMAT) + delta).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
str(self.write_date)[:-7], DEFAULT_SERVER_DATETIME_FORMAT) + delta).strftime(DEFAULT_SERVER_DATETIME_FORMAT)

@api.multi
def _update_autostaging_date(self):
@@ -109,7 +112,7 @@ def _compute_autostaging_days_left(self):
def _compute_autostaging_days_left_one(self):
self.ensure_one()
today = datetime.datetime.now()
date_modifications = datetime.datetime.strptime(self.write_date, DEFAULT_SERVER_DATETIME_FORMAT)
date_modifications = datetime.datetime.strptime(str(self.write_date)[:-7], DEFAULT_SERVER_DATETIME_FORMAT)
delta = today - date_modifications
self.autostaging_days_left = getattr(self, self._field_stage_id).autostaging_idle_timeout - delta.days

@@ -25,7 +25,7 @@ Maintainers

To get a guaranteed support
you are kindly requested to purchase the module
at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/autostaging_project_task/>`__.
at `odoo apps store <https://apps.odoo.com/apps/modules/12.0/autostaging_project_task/>`__.

Thank you for understanding!

@@ -34,14 +34,14 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/misc-addons/11.0
Demo: http://runbot.it-projects.info/demo/misc-addons/12.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/autostaging_project_task/
HTML Description: https://apps.odoo.com/apps/modules/12.0/autostaging_project_task/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/misc-addons/commits/11.0/autostaging_project_task.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/misc-addons/commits/11.0/autostaging_project_task.atom>`_
Notifications on updates: `via Atom <https://github.com/it-projects-llc/misc-addons/commits/12.0/autostaging_project_task.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/misc-addons/commits/12.0/autostaging_project_task.atom>`_

Tested on Odoo 11.0 3819120395fbeb22ccefeb200d498d1bd9ba7d34
Tested on Odoo 12.0 3036dd6f1b7cb7c0a03a66167f001b48533f0c66
@@ -8,7 +8,7 @@
"category": "Project",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=11.0",
"images": ['images/a.png'],
"version": "11.0.1.0.1",
"version": "12.0.1.0.1",
"application": False,

"author": "IT-Projects LLC, Ildar Nasyrov",
@@ -37,7 +37,7 @@
"uninstall_hook": None,

"auto_install": False,
"installable": False,
"installable": True,

# "demo_title": "{MODULE_NAME}",
# "demo_addons": [

0 comments on commit 2040f4b

Please sign in to comment.
You can’t perform that action at this time.