# Add employee on sale purchase and invoice models

**URL:** https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789
**Category:** Ideas
**Created:** [September 30, 2019, 8:36am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789 "2019-09-30T08:36:35Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [September 30, 2019, 8:36am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/1 "2019-09-30T08:36:35Z")

</div>

Continuing the discussion from [Default agent per party](https://discuss.tryton.org/t/default-agent-per-party/1747/4):

> [@Default agent per party](https://discuss.tryton.org/t/default-agent-per-party/1747/4):
>
> The problem is that we do not have on the sale the employee who fill it. So it may be complicate to understand later the choice of the agent without this information.
> 
> I always though that we should add such fields on the sale, purchase and invoice like we did on [shipment](https://bugs.tryton.org/issue6183) but that’s another topic.

I agree that we should add this fields like we did on shipment but for each model we should use diferent kind of fields as we use diferent Workflow. So here is my proposal for every model:

**Sale**

I think we should add two employee fields:

- One named _Employee_ that will be set on draft state and will represent the employee responsible of the sale works
- Another named _Confirmed by_ to denote the employee responsbile of confirming the sale. The field should be set when confirming the sale if empty.

I think the employee should be set by the default with the following values:

- With the current employee when the sale is manually created
- With the opportunity employee when the sale is created from an opoprtunity.

**Purchase**

The behaviour should be very similar to sale on but the default value should be a little bit diferent:

- The current employee should be used when the purchase is manually created
- When creating a purchase from a purchase request the Wizard should ask for an employee to assign the newly created purchases. By default this field can be set with the current employee.

**Invoice**

I think only one employee field should be added to the invoices and it should be named _Posted by_. This field will set when posting the invoice if empty.

---

<div class="post-metadata">

### Author: ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)
#### Post date: [September 30, 2019, 10:06am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/2 "2019-09-30T10:06:21Z")

</div>

> [@pokoli](#):
>
> Another named _Confirmed by_ to denote the employee responsbile of confirming the sale. The field should be set when confirming the sale if empty.

I see it as a part of a workflow, not as another field by default.

> [@pokoli](#):
>
> **Invoice**
> 
> I think only one employee field should be added to the invoices and it should be named _Posted by_ . This field will set when posting the invoice if empty.

I would set employee in invoice since the draft state as you propose for sale and purchase.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [September 30, 2019, 12:49pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/3 "2019-09-30T12:49:05Z")

</div>

> [@josesalvador](#):
>
> > Another named _Confirmed by_ to denote the employee responsbile of confirming the sale. The field should be set when confirming the sale if empty.
> 
> I see it as a part of a workflow, not as another field by default.

I think we should support that quoting and confirming the same sale is managed by diferent employees.

> [@josesalvador](#):
>
> I would set employee in invoice since the draft state as you propose for sale and purchase.

Probably but only for manual created invoices.

---

<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 30, 2019, 3:25pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/4 "2019-09-30T15:25:06Z")

</div>

> [@pokoli](#):
>
> One named _Employee_ that will be set on draft state and will represent the employee responsible of the sale works

For me, it is not clear what means “responsible”. I think this should be thought a little bit more deeper. The design of the opportunity should not be taken as example as it was not really though at that time.

By the way, I think I would prefer to know “who did what”.  
So it would be: _Quoted by_ and _Validated by_. The _Quoted by_ will be updated if the sale is reset to draft and quoted again.

> [@pokoli](#):
>
> When creating a purchase from a purchase request the Wizard should ask for an employee to assign the newly created purchases.

I do not think it is workable. I would prefer to have no value so the purchase is free to be taken. But then we need a way to take it.  
Maybe this _responsible_ thing should not be in base module but only the unambiguous workflow fields.

> [@pokoli](#):
>
> I think only one employee field should be added to the invoices and it should be named _Posted by_ .

I think it may be useful to also have _Validated by_ even if it is not always filled.

---

<div class="post-metadata">

### Author: ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)
#### Post date: [October 1, 2019, 8:01am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/5 "2019-10-01T08:01:51Z")

</div>

Should we consider Employees or Groups/teams of Employees, to manage Employees who move inside the company ?

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [October 4, 2019, 8:44am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/6 "2019-10-04T08:44:25Z")

</div>

We are interested in such feature.  
How to keep employee who did the opportunity when the sale is created ? As i follow your suggestions Cédric, “quoted by” would be filled by the current employee quoting the sale… so you’ll loose the employee at the beginning of the sale.

---

<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: [October 4, 2019, 9:08am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/7 "2019-10-04T09:08:10Z")

</div>

> [@maxx](#):
>
> How to keep employee who did the opportunity when the sale is created ?

Well I guess we should have also some employee fields on the opportunity like “Converted By”.

> [@maxx](#):
>
> so you’ll loose the employee at the beginning of the sale.

Well what is the purpose of having this employee?

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [October 4, 2019, 9:40am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/8 "2019-10-04T09:40:04Z")

</div>

> [@ced](#):
>
> Well what is the purpose of having this employee?

To have commercial statistics we need to keep the employee linked to the opportunity at the beginning of the sale, not the employee responsible of the action on the sale (quoting, …) that could be a “backoffice” employee…

---

<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: [October 4, 2019, 10:31am UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/9 "2019-10-04T10:31:16Z")

</div>

Well on the sale you will have the link to the opportunity and so the information about each step of the opportunity. I do not think it will be good to duplicate that information.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 4, 2019, 8:05pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/10 "2019-10-04T20:05:12Z")

</div>

> [@ced](#):
>
> For me, it is not clear what means “responsible”. I think this should be thought a little bit more deeper. The design of the opportunity should not be taken as example as it was not really though at that time.
> 
> By the way, I think I would prefer to know “who did what”.

For me responsible is “who has to do the next step”.  
Having the employee who did something is good for to have the full history but user should be able to know what has to do and which records are done by another employee.

Then we can have a wizard to assign task like described in:

> [@Generic assignation of document](https://discuss.tryton.org/t/generic-assignation-of-document/280):
>
> Rational There are documents in the system that are waiting for action from the user. But the problem is when the number of users is large enough, they will often compete to work on the same document (if there are no physical constraints which prevent it). So an usual design is to assign the document to an employee but the process is manual and there are still a competition for the assignation (but at least it is earlier). Proposal The idea is to see all those documents as part of a queue and…

---

<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: [October 4, 2019, 8:11pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/11 "2019-10-04T20:11:20Z")

</div>

> [@pokoli](#):
>
> For me responsible is “who has to do the next step”.

In the case of a sale order, it is not clear for me.  
At best it is only when the sale order is in draft because after that point, the management is about reacting to external even.

Also I think that in this case it is more about user than employee. Only users can make action on a document not employee.  
So in such case the create\_uid or write\_uid for draft sale gives usually the proper information.

> [@pokoli](#):
>
> Then we can have a wizard to assign task like described in:

For me, it does not apply on sale order because it is about choosing what next to do and not about postponed action.

---

<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: [October 4, 2019, 8:18pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/12 "2019-10-04T20:18:04Z")

</div>

> [@ced](#):
>
> So in such case the create\_uid or write\_uid for draft sale gives usually the proper information.

I find that this seems quite similar to the subscription process described in [Chat functionnality on resources](https://discuss.tryton.org/t/chat-functionnality-on-resources/646)  
I think what will be useful is to allow user to subscribe to document (and automatically subscribe them when they do changes) and unsubscribe if they want. Than we should have a menu entry or a tab or a filter which allow users to see only the document he is subscribed to.

---

<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: [January 3, 2020, 5:07pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/13 "2020-01-03T17:07:00Z")

</div>

I submitted [Add employee on some documents (#8969) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8969)  
I added employee for major state transition for which the employee may be accountable/responsible.  
I did it only on document for which the employee may not be linked to a specific user (through external interface). So this excludes, I think, all the accounting document (for which it is more an audit feature that may be needed).  
Also I did not include “cancel” state because I think it is not relevant and it may also prevent employee to acknowledge failure if they may be taken as responsible. So I think it is better to store only positive information (with the exception of the rejection of purchase request because the author may want to contact the rejecting employee).

Other points, I considered:

- Adding employee on production work but I think with the timesheet the information may be stored differently
- Adding invoice posting employee but indeed it is more about the user and auditing

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [January 3, 2020, 5:36pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/14 "2020-01-03T17:36:47Z")

</div>

> [@ced](#):
>
> Adding employee on production work but I think with the timesheet the information may be stored differently

What if the work does not have any timesheet information? This is possible when the work is mostly done by a machine so the employee only takes care of staring and ending the works. In this case it makes sense to store who started the process and who ending the process.

Not sure if we should store the employee per cycle so we have the full details in case of multiple cycles.

---

<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: [January 3, 2020, 9:16pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/15 "2020-01-03T21:16:05Z")

</div>

> [@pokoli](#):
>
> the work is mostly done by a machine so the employee only takes care of staring and ending the works

Well there are still a little bit of time spend by an employee, otherwise there is nobody at all.

---

<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: [April 24, 2020, 4:00pm UTC](https://discuss.tryton.org/t/add-employee-on-sale-purchase-and-invoice-models/1789/16 "2020-04-24T16:00:01Z")

</div>

This topic was automatically closed after 13 days. New replies are no longer allowed.
