frappe / frappe

Low code web framework for real world applications, in Python and Javascript
https://frappeframework.com
MIT License
7.02k stars 3.35k forks source link

Error: Value missing for Opportunity: Company (Contact form, v12) #9078

Closed garyritchie closed 2 years ago

garyritchie commented 4 years ago

Description of the issue

Stock Contact form not working after migrating data from v10 to v12.

Context information (for bug reports)

Output of bench version

erpnext 12.2.2
frappe 12.0.20

Steps to reproduce the issue

  1. Navigate to public website, contact page (form).
  2. Fill out form (dropdown, email, message) and submit.
  3. Receive error message.

Observed result

I get this error when submitting the built-in Contact Us form.

Migration from v10 to v12. Most everything works but this issue I'm unable to solve so far.

Expected result

Contact form submitted with success message.

Stacktrace / full error message

website.js:161 Traceback (most recent call last):
  File "/home/frappe/bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/frappe/bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/bench/apps/frappe/frappe/handler.py", line 61, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/bench/apps/frappe/frappe/__init__.py", line 1042, in call
    return fn(*args, **newargs)
  File "/home/frappe/bench/apps/erpnext/erpnext/templates/utils.py", line 45, in send_message
    opportunity.insert(ignore_permissions=True)
  File "/home/frappe/bench/apps/frappe/frappe/model/document.py", line 230, in insert
    self._validate()
  File "/home/frappe/bench/apps/frappe/frappe/model/document.py", line 460, in _validate
    self._validate_mandatory()
  File "/home/frappe/bench/apps/frappe/frappe/model/document.py", line 740, in _validate_mandatory
    name=self.name))
frappe.exceptions.MandatoryError: [Opportunity, OPTY-00053]: company

process_response @ website.js:161

Additional information

I investigated unchecking the Mandatory setting on the Company field in both the v10 and v12 instances but that isn't allowed.

Docker swarm on Ubuntu 18.04 using https://github.com/pipech/erpnext-docker-debian/blob/master/docs/setup/production_setup.md

using restore script, for example:

cd /home/frappe/bench

bench --force restore \
--with-public-files $FILES_PUBLIC \
--with-private-files $FILES_PRIVATE \
$DATABASE

followed by bench migrate

Really liking v12 improvements!

Komal-Saraf0609 commented 2 years ago

Works with the latest version.

image