frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.78k stars 7.31k forks source link

Field do_not_use_batchwise_valuation does not exist on Stock Settings #42610

Closed MartinFulgueiras closed 3 months ago

MartinFulgueiras commented 3 months ago

Information about bug

Tried to create a Stock Reconciliation for opening stock for an item. Completed the fields and upon submission, the following error pops up:

Screenshot from 2024-08-03 10-09-08

Tried to then change the stock settings to disable serial and batch item in stock settings. Then the following message appears:

Screenshot from 2024-08-03 10-44-07

Attached the complete error log from the message...

Module

stock

Version

ERPNext: v15.29.3

Frappe Framework: v15.34.1

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
    "crm": "1.18.0",
    "erpnext": "15.29.3",
    "frappe": "15.34.1",
    "hrms": "15.23.1",
    "lms": "2.0.0",
    "payments": "0.0.1",
    "woocommerce_fusion": "1.7.1"
}

Route

Form/Stock Settings/Stock Settings

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, 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 1768, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 337, in save
    return self._save(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 373, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1091, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py", line 102, in validate
    self.validate_use_batch_wise_valuation()
  File "apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py", line 105, in validate_use_batch_wise_valuation
    if not self.do_not_use_batchwise_valuation:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StockSettings' object has no attribute 'do_not_use_batchwise_valuation'

Request Data

{
    "type": "POST",
    "args": {
        "doc": "{\"name\":\"Stock Settings\",\"owner\":\"Administrator\",\"modified\":\"2024-07-14 15:17:03.919376\",\"modified_by\":\"test@puentedigital.net\",\"docstatus\":0,\"idx\":\"0\",\"item_naming_by\":\"Item Code\",\"valuation_method\":\"FIFO\",\"default_warehouse\":\"Showroom - TCD\",\"stock_uom\":\"Nos.\",\"auto_insert_price_list_rate_if_missing\":1,\"update_existing_price_list_rate\":0,\"allow_to_edit_stock_uom_qty_for_sales\":0,\"allow_to_edit_stock_uom_qty_for_purchase\":0,\"over_delivery_receipt_allowance\":0,\"mr_qty_allowance\":0,\"allow_negative_stock\":0,\"show_barcode_field\":1,\"clean_description_html\":1,\"action_if_quality_inspection_is_not_submitted\":\"Stop\",\"action_if_quality_inspection_is_rejected\":\"Stop\",\"enable_stock_reservation\":0,\"allow_partial_reservation\":1,\"auto_reserve_stock_for_sales_order_on_purchase\":0,\"auto_reserve_serial_and_batch\":1,\"auto_create_serial_and_batch_bundle_for_outward\":0,\"pick_serial_and_batch_based_on\":\"FIFO\",\"disable_serial_no_and_batch_selector\":1,\"use_naming_series\":0,\"naming_series_prefix\":\"BATCH-\",\"use_serial_batch_fields\":0,\"do_not_update_serial_batch_on_creation_of_auto_bundle\":1,\"auto_indent\":1,\"reorder_email_notify\":0,\"allow_from_dn\":0,\"allow_from_pr\":0,\"stock_frozen_upto_days\":0,\"doctype\":\"Stock Settings\",\"__last_sync_on\":\"2024-08-03T16:35:30.237Z\",\"__unsaved\":1,\"item_group\":\"Productos\"}",
        "action": "Save"
    },
    "btn": {
        "jQuery3700076453362794551731": {
            "events": {
                "click": [
                    {
                        "type": "click",
                        "origType": "click",
                        "guid": 7640,
                        "namespace": ""
                    }
                ]
            }
        }
    },
    "freeze": true,
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.form.save.savedocs",
    "request_id": null
}

Response Data

{
    "exception": "AttributeError: 'StockSettings' object has no attribute 'do_not_use_batchwise_valuation'",
    "exc_type": "AttributeError",
    "_exc_source": "erpnext (app)"
}
Nihantra-Patel commented 3 months ago

It's fixed: https://github.com/frappe/erpnext/pull/42186

Kindly upgrade your version 15 and check it.

MartinFulgueiras commented 3 months ago

Thanks