Commit 7900ea20 by Damien Moulard

fix merge conflict

parents e928f1f2 76e3127d
COUCHDB_USER=admin
COUCHDB_PASSWORD=123abc
POSTGRES_USER=foodcoops
POSTGRES_PASSWORD=foodcoops
POSTGRES_DB=foodcoops
...@@ -91,4 +91,4 @@ BRINKS_MUST_IDENTIFY = True ...@@ -91,4 +91,4 @@ BRINKS_MUST_IDENTIFY = True
ENTRANCE_FTOP_BUTTON_DISPLAY = False ENTRANCE_FTOP_BUTTON_DISPLAY = False
CUSTOM_CSS_FILES = {'all': ['common_lgds.css'], CUSTOM_CSS_FILES = {'all': ['common_lgds.css'],
'members': ['inscription_lgds.css']} 'members': ['inscription_lgds.css','member_lgds.css']}
{
"views": {
"by_fp": {
"map": "function(doc){emit(doc.fingerprint);}"
},
"by_completed": {
"map": "function(doc){emit(doc.completed);}"
},
"by_odoo_id": {
"map": "function(doc){emit(doc.odoo_id);}"
}
}
}
{
"views": {
"by_type": {
"map": "function(doc){emit(doc.type);}"
}
}
}
#!/usr/bin/env sh
sleep 3
curl -X PUT http://admin:123abc@couchdb:5984/coops
curl -X PUT http://admin:123abc@couchdb:5984/inventory
curl -X PUT http://admin:123abc@couchdb:5984/envelop
curl -X PUT http://admin:123abc@couchdb:5984/shopping_carts
curl -X PUT http://admin:123abc@couchdb:5984/coops/_design/index \
-d @couchdb-coops-init.json
curl -X PUT http://admin:123abc@couchdb:5984/envelop/_design/index \
-d @couchdb-envelop-init.json
version: '3'
services:
app:
build:
context: .
dockerfile: dockerfiles/Dockerfile
env_file: .env
restart: always
ports:
- "8080:8080"
links:
- "couchdb:couchdb"
- "odoo:odoo"
volumes:
- "./:/home/app/"
couchdb:
build:
context: .
dockerfile: dockerfiles/Dockerfile.couchdb
env_file: .env
restart: always
ports:
- "5984:5984" # Expose port because it's used by the frontend
volumes:
- "couchdb-data:/opt/couchdb/data"
initializer:
image: curlimages/curl
deploy:
restart_policy:
condition: on-failure
depends_on:
- couchdb
command: ["sh", "-c", "cd /tmp && ./couchdb-setup.sh"]
volumes:
- "./:/tmp"
database:
image: "postgres:10"
env_file: .env
restart: always
volumes:
- "odoo-pg-data:/var/lib/postgresql/data"
odoo:
image: "registry.gitlab.com/lgds/foodcoops:9.0-cooperatic-2021-04-02"
env_file: .env
restart: always
ports:
- "8069:8069"
links:
- "database:database"
volumes:
- "odoo-shared-data:/home/app/.local/share/Odoo"
volumes:
odoo-shared-data:
odoo-pg-data:
couchdb-data:
FROM python:3-slim
# Virtual env:
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR /home/app
# Install dependencies:
COPY requirements.txt /home/app/
RUN pip install -r requirements.txt
# Setup volume to be able to dev application locally
VOLUME /home/app
# Run the application:
EXPOSE 8080
CMD ["./launch.sh", "0.0.0.0", "8080"]
FROM couchdb:3
COPY dockerfiles/local.ini /opt/couchdb/etc/
[couchdb]
single_node=true
[httpd]
enable_cors = true
[cors]
credentials = true
origins = http://127.0.0.1:8080
[replicator]
db = _replicator
[admins]
;admin = 123abc
admin = -pbkdf2-c5101d6618dfa702b4fb72b1ea0f335e1d1d84f9,506213b6a001da088296f40327cc2e86,10
...@@ -220,4 +220,6 @@ LOGGING = { ...@@ -220,4 +220,6 @@ LOGGING = {
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
CORS_ORIGIN_ALLOW_ALL = True # Needed to make dev test with different IP and ports CORS_ORIGIN_ALLOW_ALL = True # Needed to make dev test with different IP and ports
\ No newline at end of file
ADMIN_IDS = [1]
"""Secret data for DB connexion .""" """Secret data for DB connexion ."""
ODOO = { ODOO = {
'url': 'http://127.0.0.1:8069' 'url': 'http://odoo:8069',
'user': 'api', 'user': 'api',
'passwd': 'xxxxxxxxxxxx', 'passwd': 'foodcoops',
'db': 'bd_test', 'db': 'foodcoops',
} }
COUCHDB = { COUCHDB = {
...@@ -17,7 +17,7 @@ COUCHDB = { ...@@ -17,7 +17,7 @@ COUCHDB = {
} }
} }
""" To ignore """
SQL_OFF = { SQL_OFF = {
'db': 'open_food_facts', 'db': 'open_food_facts',
'user': 'off_user', 'user': 'off_user',
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"eslint": "^7.16.0" "eslint": "^7.24.0"
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* Ecran de rechreche d'un article sur le nom et sur le code barre */ * Ecran de rechreche d'un article sur le nom et sur le code barre */
var table_article; var table_article = null;
var dataSet =[]; var dataSet =[];
var csrftoken; var csrftoken = '';
// lance la recherche sur le nom des l'article // lance la recherche sur le nom des l'article
function search_table_article() { function search_table_article() {
...@@ -30,7 +30,7 @@ $(document).ready(function() { ...@@ -30,7 +30,7 @@ $(document).ready(function() {
{ {
data:"image_small", data:"image_small",
"title":"Photo", "title":"Photo",
"render": function (data, type, full, meta) { "render": function (data, type, full) {
debut = '<button id="page1" type="button" data-toggle="modal" data-target=".modal" data-remote=' + full.id + ' class="btn btn-primary">'; debut = '<button id="page1" type="button" data-toggle="modal" data-target=".modal" data-remote=' + full.id + ' class="btn btn-primary">';
fin = "</button>"; fin = "</button>";
...@@ -41,14 +41,14 @@ $(document).ready(function() { ...@@ -41,14 +41,14 @@ $(document).ready(function() {
{data:"name", "title":"Article", "width": "50%"}, {data:"name", "title":"Article", "width": "50%"},
{data:"qty_available", "title":"En Stock", "width": "10%"}, {data:"qty_available", "title":"En Stock", "width": "10%"},
{data:"uom_id", {data:"uom_id",
"render":function (data, type, row) { "render":function (data) {
return data[1]; return data[1];
}, },
"title":"Unité", "width":"5%"}, "title":"Unité", "width":"5%"},
{data:"reception_status", {data:"reception_status",
"title":"Rupture", "className":"dt-body-center", "title":"Rupture", "className":"dt-body-center",
"render": function (data, type, full, meta) { "render": function (data, type, full) {
if (full.qty_available > 0) { if (full.qty_available > 0) {
return "<div><button id='bt_change' href='#'>Rupture</button></div>"; return "<div><button id='bt_change' href='#'>Rupture</button></div>";
} else { } else {
...@@ -135,7 +135,7 @@ $(document).ready(function() { ...@@ -135,7 +135,7 @@ $(document).ready(function() {
}); });
// Lancement de la rupture sur l'article choisie // Lancement de la rupture sur l'article choisie
function ruptureArticle(test) { function ruptureArticle() {
var jIdArcticle = { 'idArticle': selArctileData.id, 'uom_id' : selArctileData.uom_id[0] }; var jIdArcticle = { 'idArticle': selArctileData.id, 'uom_id' : selArctileData.uom_id[0] };
...@@ -148,7 +148,7 @@ function ruptureArticle(test) { ...@@ -148,7 +148,7 @@ function ruptureArticle(test) {
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
data: JSON.stringify(jIdArcticle), data: JSON.stringify(jIdArcticle),
success: function(data) { success: function() {
document.location.href = "/stock/listArticleBreaking"; document.location.href = "/stock/listArticleBreaking";
}, },
...@@ -159,7 +159,7 @@ function ruptureArticle(test) { ...@@ -159,7 +159,7 @@ function ruptureArticle(test) {
}); });
} }
var selArctileData; var selArctileData = null;
// Fenetre de validation sur l'article // Fenetre de validation sur l'article
......
...@@ -64,7 +64,7 @@ $(document).on('click', '#dp_Search', function() { ...@@ -64,7 +64,7 @@ $(document).on('click', '#dp_Search', function() {
search_table_article(); search_table_article();
}); });
var csrftoken; var csrftoken = '';
$(document).ready(function() { $(document).ready(function() {
csrftoken = getCookie('csrftoken'); csrftoken = getCookie('csrftoken');
...@@ -98,7 +98,7 @@ function actionButton (vUrl, jIdArcticle, followPage) { ...@@ -98,7 +98,7 @@ function actionButton (vUrl, jIdArcticle, followPage) {
traditional: true, traditional: true,
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
data: JSON.stringify(jIdArcticle), data: JSON.stringify(jIdArcticle),
success: function(data) { success: function() {
document.location.href = followPage; document.location.href = followPage;
}, },
error: function(resultat, statut, erreur) { error: function(resultat, statut, erreur) {
...@@ -108,7 +108,7 @@ function actionButton (vUrl, jIdArcticle, followPage) { ...@@ -108,7 +108,7 @@ function actionButton (vUrl, jIdArcticle, followPage) {
}); });
} }
var selArctileData; var selArctileData = null;
// Fenetre de validation sur l'article // Fenetre de validation sur l'article
......
...@@ -15,7 +15,7 @@ $(document).ready(function() { ...@@ -15,7 +15,7 @@ $(document).ready(function() {
{data:"name", "title":"Article", "width": "50%"}, {data:"name", "title":"Article", "width": "50%"},
{data:"maxdate", {data:"maxdate",
"render":function (data, type, row) { "render":function (data) {
my = new Date(data); my = new Date(data);
return my.toLocaleDateString() +" " + my.toLocaleTimeString(); return my.toLocaleDateString() +" " + my.toLocaleTimeString();
...@@ -23,7 +23,7 @@ $(document).ready(function() { ...@@ -23,7 +23,7 @@ $(document).ready(function() {
"title":"Date", "width":"15%"}, "title":"Date", "width":"15%"},
{data:"maxdate", {data:"maxdate",
"render":function (data, type, row) { "render":function (data) {
my = new Date(data); my = new Date(data);
var today = new Date(); var today = new Date();
...@@ -37,7 +37,7 @@ $(document).ready(function() { ...@@ -37,7 +37,7 @@ $(document).ready(function() {
{data:"purchase_ok", "width":"5%", {data:"purchase_ok", "width":"5%",
"title":"Achetable", "className":"dt-body-center", "title":"Achetable", "className":"dt-body-center",
"render": function (data, type, full, meta) { "render": function (data) {
if (data == true) { if (data == true) {
return '<div><input type="checkbox" id="bt_dontPurchase" checked><div>'; return '<div><input type="checkbox" id="bt_dontPurchase" checked><div>';
...@@ -48,14 +48,14 @@ $(document).ready(function() { ...@@ -48,14 +48,14 @@ $(document).ready(function() {
}, },
{data:"reception_status", "width":"5%", {data:"reception_status", "width":"5%",
"title":"Rupture", "className":"dt-body-center", "title":"Rupture", "className":"dt-body-center",
"render": function (data, type, full, meta) { "render": function () {
return "<div><button id='bt_change' href='#'>Stock à 0</button></div>"; return "<div><button id='bt_change' href='#'>Stock à 0</button></div>";
} }
}, },
{data:"reception_status", "width":"5%", {data:"reception_status", "width":"5%",
"title":"Archive", "className":"dt-body-center", "title":"Archive", "className":"dt-body-center",
"render": function (data, type, full, meta) { "render": function () {
return "<div><button id='bt_archive' href='#'>Archive</button></div>"; return "<div><button id='bt_archive' href='#'>Archive</button></div>";
} }
} }
...@@ -103,7 +103,7 @@ $(document).on('click', '#dp_Search', function() { ...@@ -103,7 +103,7 @@ $(document).on('click', '#dp_Search', function() {
search_table_article(); search_table_article();
}); });
var csrftoken; var csrftoken ='';
$(document).ready(function() { $(document).ready(function() {
csrftoken = getCookie('csrftoken'); csrftoken = getCookie('csrftoken');
...@@ -137,7 +137,7 @@ function actionButton (vUrl, jIdArcticle, followPage) { ...@@ -137,7 +137,7 @@ function actionButton (vUrl, jIdArcticle, followPage) {
traditional: true, traditional: true,
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
data: JSON.stringify(jIdArcticle), data: JSON.stringify(jIdArcticle),
success: function(data) { success: function() {
document.location.href = followPage; document.location.href = followPage;
}, },
error: function(resultat, statut, erreur) { error: function(resultat, statut, erreur) {
...@@ -147,7 +147,7 @@ function actionButton (vUrl, jIdArcticle, followPage) { ...@@ -147,7 +147,7 @@ function actionButton (vUrl, jIdArcticle, followPage) {
}); });
} }
var selArctileData; var selArctileData = null;
// Fenetre de validation sur l'article // Fenetre de validation sur l'article
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment