Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ambiguous column error while submitting stock entry (backport #36209) #36222

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 20, 2023

This is an automatic backport of pull request #36209 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Stock Entry Type=Manufacture

request.js:457 Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 94, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1610, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 28, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 327, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 259, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1045, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 914, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1264, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1246, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 911, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 122, in validate
    self.validate_qty()
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 433, in validate_qty
    transferred_materials = frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 220, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1052, "Column 'qty' in field list is ambiguous")

(cherry picked from commit c21fd45)
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jul 20, 2023
@s-aga-r s-aga-r merged commit 844ec58 into version-14-hotfix Jul 20, 2023
@mergify mergify bot deleted the mergify/bp/version-14-hotfix/pr-36209 branch July 20, 2023 14:46
deepeshgarg007 added a commit that referenced this pull request Jul 21, 2023
* fix: broken overallocation validation in payment entry

In a multi term payment schedule, overallocation logic broke. Fixing
it using individual term outstanding amount in references. this should
work for the simple, one term payment schedule as well

(cherry picked from commit f8d4b19)

* refactor: payment term outstanding in party account currency

(cherry picked from commit ee83f94)

* fix: Default fiscal year in accounting, buying and sellingcharts

(cherry picked from commit 3759a41)

* fix: Trial Balance report considering cancelled entries

(cherry picked from commit fd58bbf)

* fix: made item or warehouse filter mandatory (backport #36208) (#36215)

fix: made item or warehouse filter mandatory

(cherry picked from commit 1649862)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>

* fix: Ambiguous column error while submitting stock entry (backport #36209) (#36222)

fix: Ambiguous column error while submitting stock entry

Stock Entry Type=Manufacture

request.js:457 Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 94, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1610, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 28, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 327, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 259, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1045, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 914, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1264, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1246, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 911, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 122, in validate
    self.validate_qty()
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 433, in validate_qty
    transferred_materials = frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 220, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1052, "Column 'qty' in field list is ambiguous")

(cherry picked from commit c21fd45)

Co-authored-by: MohsinAli <mmatiyailol@gmail.com>

* fix: Ignore permissions while submitting account closing balance record (#35536)

(cherry picked from commit f11d9b0)

* fix: FY in naming series variable for orders

(cherry picked from commit 7a7d32d)

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: MohsinAli <mmatiyailol@gmail.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Jul 26, 2023
# [14.32.0](v14.31.3...v14.32.0) (2023-07-26)

### Bug Fixes

* added missing option Partially Received in the status dropdown field ([4fa93b0](4fa93b0))
* allocation logic on 'Get Outstanding Invoices' btn in PE ([14600fa](14600fa))
* allow both custodian and location while creating asset ([#36263](#36263)) ([2b47f58](2b47f58))
* Ambiguous column error while submitting stock entry (backport [#36209](#36209)) ([#36222](#36222)) ([844ec58](844ec58))
* apply discount on item after applying price list ([#36316](#36316)) ([cff6e72](cff6e72))
* apply terms validaton only in Sales/Purchase documents ([8f24292](8f24292))
* broken overallocation validation in payment entry ([e1d31aa](e1d31aa))
* clear accounting dimension value when based on field changes ([1fe6d4e](1fe6d4e))
* customer filter in process soa ([5938af9](5938af9))
* Default fiscal year in accounting, buying and sellingcharts ([8ca3d6b](8ca3d6b))
* fetch acc dimension fieldname ([542c804](542c804))
* FY in naming series variable for orders ([6a6a3ae](6a6a3ae))
* group by in fixed asset register ([#36310](#36310)) ([6cca18e](6cca18e))
* Ignore permissions while submitting account closing balance record ([#35536](#35536)) ([c2976ef](c2976ef))
* itemised tax breakup ([6f2e639](6f2e639))
* made item or warehouse filter mandatory (backport [#36208](#36208)) ([#36215](#36215)) ([57cf3c2](57cf3c2))
* no default email account causing reposting issue ([026f9f5](026f9f5))
* **regional:** set `frappe.flags.company` temporarily, where required ([73e9b38](73e9b38))
* set new purchase_receipt_amount on asset split ([#36272](#36272)) ([e867fe7](e867fe7))
* timeout error while cancelling the Purchase Receipt ([0575005](0575005))
* Trial Balance report considering cancelled entries ([ca4f86d](ca4f86d))

### Features

* filter based on accounting dimension in profitability analysis ([ba95df2](ba95df2))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-tests This PR needs automated unit-tests. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants