Skip to content

Configuration

Prolong Limeobject

Button that can be used to create a copy of a limeobject (probably deal or assignment) with certain differences.

  • Text can be added to one title field.
  • Fixed values can be set to fields. (None can be used to reset date fields)
  • Two fields can be selected to set new dates. The start date will be set to one month after the original end date and the new end date will be set to equal amount of time after new start as the difference between the old dates.
  • It is configured in Lime admin under Consultancy section.
  • You can also add what many relations that should be copied to the new object.
  • If there is an int-field called "prolongnumber" on the limeobject, this will be set to higher and higher when prolonging.
  • If there is a relation to the limeobject itself called 'parent{limetype}' (for example 'parentdeal'), the new object will get a relation to the original object. If chain-prolonging, all of the prolong-objects will get relation to the first object.

Use in the clients

  • To use it in the web client, just add the web component lwc-limepkg-consultancy-prolong-limeobject on a card.
  • To use it in the Desktop client, add the app from the legacy folder.

Example config

Prolong example

Auto assignment

Used for deals in which you only need one assignment, for example a resource deal.

  • Choose what limetype is the deal (most likely deal or business)
  • Choose what field holds the single relation to assignment, can be created on the deal if not present.
  • Choose many relation to assignment, the single assignment will be auto attached with this relation too.
  • Choose assignment limetype
  • If you want to automatically create an assignment you set a field in "Auto create if this field is equal to". If not wanted, don't set this, remove in code mode if accidentally added.
  • If field above selected you select all statuses that should autocreate.
  • Mapping tells what field value from the deal should be copied to the assignment. Please mind required fields!
  • Fixed values can be used to set the same value for all auto created assignments, for example Status as in the example.

Use in the clients

  • Functionality is all backend but is probably most useful together with Variants in the Web client.

Example config

Prolong example

Accumulated time

Schedule task to calculate the accumulated times, eg once per night, example in task.__init__ -file:

from lime_task.schedule import CronTab, ScheduledTask, TaskSession
from limepkg_consultancy.tasks import accumulatedtime as consultancy_accumulatedtime


def get_task_modules():
    return []


def register_scheduled_tasks():
    return [
        ScheduledTask(
            task=consultancy_accumulatedtime.update_accumulatedtime,
            schedule=CronTab(hour="1", minute="0"),
            args=[],
            session=TaskSession(user_name="accumulatedtime@consultancy", language="sv"),
        ),
    ]

User can be anything you want but dont forget to create it as a type service before deploying. The task can also be triggered via the /start-task endpoint. Then it will be run as the logged in user, eg: {server}/{dbname}/limepkg-consultancy/start-task/?name=accumulatedtime.update_accumulatedtime

if you don't have tasks, run lime-project generate tasks and remove the tasks.py-file

Required fields

Limetype Field Type
accumulatedtime Table
accumulatedtime consultant Relation
accumulatedtime company Relation
accumulatedtime accumulatedmonths Integer
assignment notaccumulated Yes/No
Back to top