# How to make a Plugin?

**URL:** https://discuss.tryton.org/t/how-to-make-a-plugin/7892
**Category:** Developer
**Created:** [September 25, 2024, 4:09am UTC](https://discuss.tryton.org/t/how-to-make-a-plugin/7892 "2024-09-25T04:09:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Siobhan](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@Siobhan](https://discuss.tryton.org/u/Siobhan)
#### Post date: [September 25, 2024, 4:09am UTC](https://discuss.tryton.org/t/how-to-make-a-plugin/7892/1 "2024-09-25T04:09:15Z")

</div>

Is there any tutorial how you make a plugin? I want to make a geolocator and geofencing plugin.

---

<div class="post-metadata">

### Author: ![dotbit](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dotbit/32/2093_2.png) [@dotbit](https://discuss.tryton.org/u/dotbit)
#### Post date: [September 25, 2024, 5:29am UTC](https://discuss.tryton.org/t/how-to-make-a-plugin/7892/2 "2024-09-25T05:29:42Z")

</div>

There is an [official tutorial how to make a module](https://docs.tryton.org/latest/server/tutorial/module/index.html#tutorial-module) (running inside trytond).  
This tutorial teaches general concepts how to program using the tryton framework.

It sounds like what you want to make is something that runs outside of tryton.  
For this I think you need to interact with tryton.  
The following options for interacting with tryton are used:

1. By [proteus](https://docs.tryton.org/latest/client-library/index.html) scripting client
2. By [User application](https://docs.tryton.org/latest/server/topics/user_application.html)

You can even communicate with trytond using rpc (the same way the client communicates with tryton) or you can make a web-app using [Flask](https://discuss.tryton.org/t/flask-tryton-module/737)

[Chronos](https://foss.heptapod.net/tryton/chronos) is a plug-in for web-browsers, probably not what you need, but maybe you can get some examples for communication.

I might be the wrong person to answer your question as I have not created any major tryton development project. I know you need to shorten your list of options, not make it longer.  
I think sharing more specific details about how you want the geo-locator to run.

Who should run it? An employee of Company? What language do you want the plug-in to run?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 25, 2024, 6:44am UTC](https://discuss.tryton.org/t/how-to-make-a-plugin/7892/3 "2024-09-25T06:44:21Z")

</div>

I guess you are talking about the client plugin.

For tryton, it should be a Python module put in the `plugins` directory that have a method `get_plugins(model)` that must return a sequence of tuple composed of the name of the plugin and the plugin function. The function takes a dictionary argument with the `model`, `model_context`, `id`, `ids` and `paths`.  
In Python typing::

```auto
class Data(TypedDict):
    model: str
    model_context: str
    id: int
    ids: Sequence[int]
    paths: Sequence[Tuple[int]]

Sequence[Tuple[str, Callable[Data]]

```

In sao the custom Javascript must push in `Sao.Plugins` an object with the methods `get_plugins` which must return the same kind of list.
