Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Palomar Rodríguez danypr92

View GitHub Profile
View gist:5d7e79cbb6f2494eb11cf773dbeb2879
package org.meveo.service.script;\n\nimport java.io.File;\nimport java.lang.Double;\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.List;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport java.util.concurrent.TimeUnit;\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\n\nimport org.meveo.admin.exception.BusinessException;\nimport org.meveo.commons.utils.ParamBeanFactory;\nimport org.meveo.commons.utils.ParamBean;\nimport org.meveo.commons.utils.PersistenceUtils;\nimport org.meveo.model.crm.Provider;\nimport org.meveo.model.admin.Seller;\nimport org.meveo.model.ICustomFieldEntity;\nimport org.meveo.model.admin.User;\nimport org.meveo.model.billing.BankCoordinates;\nimport org.meveo.model.billing.Invoice;\nimport org.meveo.model.billing.RatedTransaction;\nimport org.meveo.model.billing.ServiceInstance;\nimport org.meveo.model.billing.Subscription;\nimport org.meveo.model.billing.WalletOperation;\nimpor
@danypr92
danypr92 / lock_queries.md
Created Nov 23, 2018
Com busquem les queries que estan blocant el sistema?
View lock_queries.md

Búsqueda de queries més que bloquejen el sistema

Per trobar quina query s'esta executant en aquest moment?

SELECT * FROM pg_stat_activity WHERE state = 'active';

Matar queries per PID

@danypr92
danypr92 / logstash_tryton_filter.md
Last active Sep 7, 2018
Logstash filter to mapping the Tryton Log
View logstash_tryton_filter.md

Logstash filter to Tryton Log

We need a filter to map the Tryton log to monitoring it from ELK.

Tryton log pattern:

format = %(process)d - [%(asctime)s] %(levelname)s:%(name)s:%(message)s
datefmt = %a %b %d %H:%M:%S %Y

Tryton log example:

View celery-tryton-problems.md

Try celery-tryton 0.3

  • My tasks file:
  from celery import Celery
  from celery_tryton import TrytonTask
  from trytond.transaction import Transaction
  
  celery = Celery('tryton')
  celery.conf.TRYTON_DATABASE = 'tryton'                                                                                              
@danypr92
danypr92 / SEPA_configuration.md
Created Aug 28, 2018
Odoo SEPA Direct Debit Configuration
View SEPA_configuration.md

Configuration SEPA Direct Debit in Odoo 11

The sepa direct pay in Odoo is part of Enterprise packages. We have installed a OCA module to cover the SEPA mandate creation/exportation: Account Banking SEPA Direct Debit.

Configuration

For setting the SEPA creditor identifier:

@danypr92
danypr92 / OTRSTicket_integration.md
Last active Aug 10, 2018
OTRS integration Ticket model data
View OTRSTicket_integration.md

OTRS Ticket integration process

Curls tests

➜ curl "https://suport.somconnexio.coop/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=XXX&Password=XXXXXX" -H "Content-Type: application/json" -d "{\"Ticket\":{\"Title\":\"REST Create Test\", \"Type\": \"Unclassified\", \"Queue\":\"Raw\",\"State\":\"open\",\"Priority\":\"3 normal\",\"CustomerUser\":1},\"Article\":{\"Subject\":\"Rest Create Test\",\"Body\":\"This is only a test\",\"ContentType\":\"text/plain; charset=utf8\"}}"  -X POST 
{"Error":{"ErrorCode":"TicketCreate.InvalidParameter","ErrorMessage":"TicketCreate: Ticket->CustomerUser parameter is invalid!"}}%                                                                                                                                              
~ 
➜ curl "https://suport.somconnexio.coop/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=XXX&Password=XXXXXX" -H "Content-Type: application/json" -d "{\"Ticket\":{\"Title\":\"REST Create Tes
View queries.sql
# Query with the domain: [('partner_number', '=', "")]
SELECT
"a"."id" AS "id",
"a"."comment" AS "comment",
"a"."code" AS "code",
"a"."create_date" AS "create_date",
"a"."write_uid" AS "write_uid",
"a"."create_uid" AS "create_uid",
"a"."first_name" AS "first_name",
@danypr92
danypr92 / question.md
Created Jul 12, 2018
Genshi Templates and Babel Date format
View question.md

Tenemos un template que incluye una fecha y la queremos localizada (con: dia de la semana, dia mes).

Template:

La portabilidad de la línea se llevará a cabo ${record.sim_activation_date_localized} de 2:00h a 6:00h de la madrugada.

Código Python:

@danypr92
danypr92 / error_decode.md
Last active Jul 12, 2018
Error decode Tryton Electronic Mail Wizard
View error_decode.md
ERROR:tryton.common.common:Traceback (most recent call last):
  File "/trytond/protocols/jsonrpc.py", line 170, in _marshaled_dispatch
    response['result'] = dispatch_method(method, params)
  File "/trytond/protocols/jsonrpc.py", line 206, in _dispatch
    res = dispatch(*args)
  File "/trytond/protocols/dispatcher.py", line 185, in dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/wizard/wizard.py", line 275, in execute
    return wizard._execute(state_name)
You can’t perform that action at this time.