- First find the PID of the main process:
$ps faux
postgres 10980 35.3 6.9 297584 141476 ? Ss 14:45 5:17 \_ postgres: 9.6/main: danypr92 staging [local] idle in transaction
- We can use the table
pg_stat_activity
searching by the PID:
test-readonly=# EXPLAIN ANALYZE(select * from party_materialized_view); | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------------------------------- | |
Seq Scan on party_materialized_view (cost=0.00..138.04 rows=1904 width=473) (actual time=0.018..1.022 rows=5235 loops=1) | |
Planning time: 0.131 ms | |
Execution time: 1.271 ms | |
(3 rows) | |
test-readonly=# EXPLAIN ANALYZE(select * from party_materialized_view where identifier_code = 'ESX640B'); | |
QUERY PLAN |
Queremos un trigger que al cambiar un contrato de estado activation_scheduled
a requested
ejecute una acción determinada.
Se define el triguer con los siguientes parametros:
id | 10
create_uid | 34
on_create | f
create_date | 2018-03-28 09:29:31.938303
name | Trigger A
on_delete | f
Table "public.product_template"
Column | Type | Modifiers | Storage | Stats target | Description
------------------------+--------------------------------+---------------------------------------------------------------+----------+--------------+-------------------------
id | integer | not null default nextval('product_template_id_seq'::regclass) | plain | |
category | integer | | plain | | Category
create_uid | integer | | plain | | Create User
create_date | timestamp(6) without time zone |
class Contract: | |
""" | |
This overwrite of class Contract extend functionality of Contract | |
vanilla model. | |
Add the necessary functions to represent a ISP Contract. | |
""" | |
__metaclass__ = PoolMeta | |
__name__ = 'contract' |
Trabajamos con la versión 3.8 de Tryton (sabemos que ya no tiene soporte, pero no podemos hacer la migracion a una versión más reciente en estos momentos.)
Tenemos el modelo Contract
con los siguientes atributos:
class Contract:
__metaclass__ = PoolMeta
__name__ = 'contract'
# Then copy this service in the `/etc/systemd/system/ara.local.service` | |
# Run your service with: | |
# # systemctl start ara.local.service | |
# Visit your ARA app in http://127.0.0.1:9191/ | |
# ----------------------------------- | |
# ARA systemd service | |
[Unit] | |
Description=ARA server |
You can use this instructions without
virtualenvwrapper
making changes in service unit.
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)