Submitting Production Order Activity Type Error

I’m getting an error “Error: Value missing for: Activity Type” when trying to submit a Production Order. I can’t find anywhere to enter an Activity Type in the Production Order, BOM, or Item. I’m not sure where this error is coming from.

ERPNext: v6.16.3
Frappe Framework: v6.17.4

Thanks,
Adam

@agerken, can you replicate it in demo.erpnext.com?

Not without a lot of effort. I think it’s got something to do with the operations. Operations are the only thing I could think of that could have anything to do with Activity Type, but I thought that was all for project related stuff? I don’t see Activity Type anywhere in Item, BOM or Production Order.

Thanks,
Adam

I’m still having this issue. Any Production Order I try to create gets kicked back saying “Error: Value missing for: Activity Type”

I’ve gone back through everything and I can’t find Activity Type anywhere that has anything to do with this. All my Items save just fine, all Operations look fine. Where is this coming from?! This is getting unbelievably irritating, there are so many small issues with this software that we have to work around.

HELP!

Nothing? Why is it that silly small things get updated constantly but fundamental issues with the system get completely ignored?

Besides the fact, the whole flow of this software makes no sense for normal (American) business. I’ve been using it for a while now and the Manufacturing, Project, Stock and HR modules are complete disasters, so I’m getting no benefit beyond just having Quickbooks. I just don’t understand why this has to be such a pain to use.

I’ll be looking around to replace ERPnext as fast as I can, and I’m definitely not recommending it anymore. I wish the project luck, but for those of us with real businesses to run, it isn’t worth the hassle.

I am having the same issue with this. According to my console, it looks like the issue is related to creating Time Logs for the production order (which occurs when there are BOM Operations that need to be scheduled).

Specifically, it can’t create the Time Logs because Activity Type and Notes are required to create a Time Log, but there’s no way of specifying which ones to use from the Production Order screen.

Here is my traceback:

    Traceback (innermost last):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call
    return fn(*args, **newargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 18, in savedocs
    doc.save()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 255, in save
    self.run_post_save_methods()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 634, in run_post_save_methods
    self.run_method("on_submit")
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 575, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 731, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 714, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 569, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py", line 157, in on_submit
    self.make_time_logs()
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py", line 250, in make_time_logs
    time_log.save()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in save
    self.insert()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 194, in insert
    self._validate()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 337, in _validate
    self._validate_mandatory()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 528, in _validate_mandatory
    raise frappe.MandatoryError(", ".join((each[0] for each in missing)))
 MandatoryError: activity_type, notes

Good catch. I had an issue previously with Operations and Activity Types not getting along. I’ll try to dig up the thread. Looks like more fundamental issues not fixed!

Now my question is why is this thing creating Time Logs for a Production Order when I make it… before any work has been done? Why doesn’t the operator create time logs based on what they actually work? Again, another example of the Manufacturing module being totally screwed up.

Further:

  • Why can’t I tie Time Logs back to paying hourly employees?
  • Why can’t Projects/Tasks be tied into Sales Orders, and also use Time Logs pay hourly employees?

How am I supposed to keep track of job profitability?

Seems like this system is set up for how Indian companies work (I’m guessing?) and the rest of us be damned.

So tracing back through the workflow, I see where this may be coming from.

Production Order comes from BOM
BOM needs Operations (this looks to be what’s causing the issue)
Operation pulls in Workstation but there is nothing pulled into Hour Rate (maybe this is where Activity Type is needed… how else would it get Hour Rate)
So I go to Operation, nothing about Activity Type… just Workstation
go to Workstation… no Activity Type.

So, I think Activity Type should be in there somewhere to put a cost to an Operation, but it isn’t anywhere. Am I missing something?

I tried adding Activity Type to the Operation form but as expected, nothing changed.

So I can clear up a couple things for you:

  1. The time log is created by the system in order to schedule production. The logs aren’t submitted until a person has set themselves as the User and submitted them, but they are needed in advance to tell you WHEN to create the parts (so that you know when things have to get made in order to meet your deadlines). Only when they get submitted do they actually count towards anyone’s time log. This is (in my view) a better system than having your operators create time logs because your operators shouldn’t be required to see the big picture regarding when each assembly (and how many of each assembly) needs to get made. Even with the created time logs, your operators could change the times to match what they actually worked as needed.

  2. When you create BOM Operations for a BOM, you plug in the time in mins, and the hour rate is controlled by the Workstation and Operation that are selected. This is what determines the cost. The issue is that when the time logs are created, the Activity Type and Notes are not entered (because it isn’t being pulled from anywhere by the code). My guess is that Activity Type and Notes weren’t always mandatory and the time logs would get created without these being entered.

  3. Adding a custom field to the Operations, BOM Operation or Workstation won’t resolve the issue because there is nothing in the code that pulls the Activity Type from those fields to the Time Log.

So I’ve done a bit more investigation and found what I think to be the issue.

The Activity Type field is set to Mandatory, except that the permission for setting requires that for_manufacturing =0. Because this is a manufacturing option, the for_manufacturing = 1 and the Activity Type doesn’t get set (It is supposed to be set to “Manufacturing” by the make_time_log command).

@rmehta: To summarize, the issue is that the validate function doesn’t correctly check to see if the permissions for the field before deciding if a field is mandatory. Is there a way to fix this?

1)I see how this can work but it still doesn’t make sense to me. What if I have 5 different operators working on an Production Order/Operation? What if an operator doesn’t complete the job and needs to pick it back up the next day?

Production Order should create a “demand” for labor that can be used for scheduling. Operators should then log time based against that demand. This way job efficiencies can be tracked, billed and employees paid hourly (huge gripe of mine.)

  1. I don’t get this… I still can’t get it to fill in. Why does Workstation matter for how much an operation costs? I can see adding in the Electricity Cost, etc. if needed but that’s a bit extreme. The base price of an Operation should come from what the Operation actually is.

  2. I know, I just figured I would try.

So essentially what I’m trying to say, is that the Sales, Accounting, invoicing type workflows seem to work fine but when it comes to actually tracking the company’s functions this software just plain doesn’t work. I still can’t figure out how Project relates to anything… There’s no way for me to track the profit/loss of projects smoothly, there’s no good way to track user’s time and pay them accordingly, Time Logs are for too manual and clunky for the average users. The Production Order/Manufacturing seems completely useless, the Material/Stock controls are really difficult. etc etc.

I come from a background of implementing very smooth software systems, between ERP systems and shop floor software so ERPnext being so clunky is really frustrating. I really want to like this software, and it’s so close to being really good, but it just isn’t.

  1. If you don’t like the system creating Time Logs, you can disable it in the Manufacturing Settings page.

  2. There is a bug preventing the Production Orders from being submitted. I’ve created an Issue in GitHub for it and hopefully it gets addressed soon. I’m not comfortable enough with the coding to fix it myself or I’d give it a shot.

In most of the manufacturing I’ve been involved with, the Workstation plays a bigger factor in Operation cost than labor, because the overheads can be huge, depending on what type of operation you’re doing (think Robotic welding, High-tonnage stamping). That’s why the workstation matters so much. Also, you typically have operators qualified to work at a specific workstation, and you might pay them (or charge them out) at a rate depending on what that workstation is, not what they are doing there. At the end of the day, you can create a different workstation for every operation if that fits your needs better, so I don’t see why this is an issue.

You can tie a Project to Time Logs, Purchased Items and Expensse and calculate all the costs from there.

When your employees create time logs, they can create them against Projects and Activity Types. If you make each of your jobs a project, then they can charge their hours to a specific project. You can set up Activity Types to have costing rates and billing rates (by employee if needed), then you just go into the project and it will break down all the costs for you, showing a Gross Margin.

I think you are right in that this is an area that could be improved upon, as it doesn’t look like there is a way to use Sales Orders for tracking revenue for the project, but this is an open source software and there’s constantly new features being added. If you’ve got specific suggestions for how the system can be improved, try to give clear direction on what is lacking and how it can be changed. Just complaining doesn’t really help move the software forward, and at the end of the day, this is a free software that a lot of people are donating their time to improve.

Is there any progress on fixing this bug? This prevents Production Orders for BOMs with Operations. The bug is still present in v7:

Error: Value missing for: Activity Type Error: Value missing for: Notes Did not save

1 Like