-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Install Odoo module * Add initializer * Lint file
- Loading branch information
Showing
7 changed files
with
97 additions
and
8 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
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
Decidim::Odoo.configure do |config| | ||
# Configure api credentials | ||
config.api = { | ||
base_url: ENV["ODOO_API_BASE_URL"].presence, | ||
api_key: ENV["ODOO_API_API_KEY"].presence | ||
} | ||
|
||
# Configure omniauth secrets | ||
config.keycloak_omniauth = { | ||
enabled: ENV["OMNIAUTH_ODOO_KEYCLOAK_CLIENT_ID"].present?, | ||
client_id: ENV["OMNIAUTH_ODOO_KEYCLOAK_CLIENT_ID"].presence, | ||
client_secret: ENV["OMNIAUTH_ODOO_KEYCLOAK_CLIENT_SECRET"].presence, | ||
client_options: { | ||
site: ENV["OMNIAUTH_ODOO_KEYCLOAK_SITE"].presence, | ||
realm: ENV["OMNIAUTH_ODOO_KEYCLOAK_REALM"].presence | ||
}, | ||
icon_path: ENV["OMNIAUTH_ODOO_KEYCLOAK_ICON_PATH"].presence || "media/images/odoo_logo.svg" | ||
} | ||
end |
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
21 changes: 21 additions & 0 deletions
21
db/migrate/20231005094634_create_decidim_odoo_users.decidim_odoo.rb
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,21 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_odoo (originally 20230713143501) | ||
|
||
class CreateDecidimOdooUsers < ActiveRecord::Migration[6.0] | ||
def change | ||
create_table :decidim_odoo_users do |t| | ||
t.references :decidim_organization, null: false, foreign_key: { to_table: :decidim_organizations }, index: { name: :index_odoo_users_on_decidim_organization_id } | ||
t.references :decidim_user, null: false, foreign_key: { to_table: :decidim_users }, index: { name: :index_odoo_users_on_decidim_user_id } | ||
|
||
t.integer :odoo_user_id | ||
t.string :ref | ||
t.boolean :coop_candidate, default: false | ||
t.boolean :member, default: false | ||
|
||
t.timestamps | ||
|
||
t.index %w(decidim_organization_id odoo_user_id), name: "index_unique_odoo_user_and_organization", unique: true | ||
t.index %w(decidim_organization_id ref), name: "index_unique_ref_and_organization", unique: true | ||
end | ||
end | ||
end |
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