-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simply store the last login timestamp when /sign_in is called.
- Loading branch information
Showing
6 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2022 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo.tools import sql | ||
|
||
|
||
def migrate(cr, version): | ||
if not version or sql.column_exists(cr, "shopinvader_partner", "last_login_time"): | ||
return | ||
# Pre-create new column | ||
sql.create_column(cr, "shopinvader_partner", "last_login_time", "timestamp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
# pylint: disable=consider-merging-classes-inherited,method-required-super | ||
from odoo import _ | ||
from odoo import _, fields | ||
from odoo.exceptions import UserError | ||
|
||
from odoo.addons.component.core import Component | ||
|
@@ -56,6 +56,7 @@ def update(self, _id, **params): | |
return self.get() | ||
|
||
def sign_in(self, **params): | ||
self.invader_partner.last_login_time = fields.Datetime.now() | ||
return self._assign_cart_and_get_store_cache() | ||
|
||
# The following method are 'private' and should be never never NEVER call | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters