resilient-tech / india-compliance

Simple, yet powerful compliance solutions for Indian businesses
https://indiacompliance.app
GNU General Public License v3.0
152 stars 139 forks source link

'POSInvoice' object has no attribute 'is_reverse_charge'" #2388

Closed ljain112 closed 4 months ago

ljain112 commented 4 months ago

Frappe Support Issue: https://support.frappe.io/app/hd-ticket/18556

Error log App Versions

{ "ecommerce_integrations": "1.20.1", "erpnext": "14.70.9", "erpnext_bio_metric": "0.0.1", "erpnext_org_structure": "0.0.1", "frappe": "14.77.5", "hrms": "14.28.1", "india_compliance": "14.29.0", "insights": "2.2.2", "payments": "0.0.1", "rangsutra": "0.0.1", "rangsutra_custom_reports": "0.0.1" }

Route

Form/POS Invoice/new-pos-invoice-sbiogeaatw

Traceback

Traceback (most recent call last): File "apps/frappe/frappe/app.py", line 97, in application response = frappe.api.handle() File "apps/frappe/frappe/api.py", line 55, in handle return frappe.handler.handle() File "apps/frappe/frappe/handler.py", line 48, in handle data = execute_cmd(cmd) File "apps/frappe/frappe/handler.py", line 86, in execute_cmd return frappe.call(method, frappe.form_dict) File "apps/frappe/frappe/init.py", line 1619, in call return fn(*args, *newargs) File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs doc.save() File "apps/frappe/frappe/model/document.py", line 310, in save return self._save(args, kwargs) File "apps/frappe/frappe/model/document.py", line 332, in _save return self.insert() File "apps/frappe/frappe/model/document.py", line 265, in insert self.run_before_save_methods() File "apps/frappe/frappe/model/document.py", line 1061, in run_before_save_methods self.run_method("validate") File "apps/frappe/frappe/model/document.py", line 931, in run_method out = Document.hook(fn)(self, *args, kwargs) File "apps/frappe/frappe/model/document.py", line 1283, in composer return composed(self, method, *args, *kwargs) File "apps/frappe/frappe/model/document.py", line 1267, in runner add_to_return_value(self, f(self, method, args, kwargs)) File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 1552, in validate_transaction validate_sales_reverse_charge(doc) File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 714, in validate_sales_reverse_charge if doc.is_reverse_charge and not doc.billing_address_gstin: AttributeError: 'POSInvoice' object has no attribute 'is_reverse_charge'

Request Data

{ "type": "POST", "args": { "doc": "{\"docstatus\":0,\"doctype\":\"POS Invoice\",\"name\":\"new-pos-invoice-tyqmbvmhvg\",\"islocal\":1,\"unsaved\":1,\"owner\":\"archana@rangsutra.com\",\"naming_series\":\"POS/.financial_year./.custom_naming_series_no.####\",\"is_pos\":1,\"is_return\":0,\"update_billed_amount_in_sales_order\":0,\"update_billed_amount_in_delivery_note\":1,\"company\":\"Rangsutra Crafts India Ltd\",\"posting_date\":\"2024-07-03\",\"set_posting_time\":1,\"currency\":\"INR\",\"selling_price_list\":\"Standard Selling\",\"price_list_currency\":\"INR\",\"ignore_pricing_rule\":0,\"update_stock\":1,\"total_billing_amount\":0,\"redeem_loyalty_points\":0,\"apply_discount_on\":\"Grand Total\",\"allocate_advances_automatically\":0,\"write_off_outstanding_amount_automatically\":0,\"group_same_items\":0,\"is_discounted\":0,\"status\":\"Draft\",\"party_account_currency\":\"INR\",\"is_opening\":\"No\",\"payment_source\":\"\",\"items\":[{\"docstatus\":0,\"doctype\":\"POS Invoice Item\",\"name\":\"new-pos-invoice-item-ttobomahfs\",\"islocal\":1,\"unsaved\":1,\"owner\":\"archana@rangsutra.com\",\"has_item_scanned\":0,\"stock_uom\":\"Nos\",\"margin_type\":\"\",\"is_free_item\":0,\"grant_commission\":1,\"delivered_by_supplier\":0,\"is_fixed_asset\":0,\"enable_deferred_revenue\":0,\"allow_zero_valuation_rate\":0,\"page_break\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"items\",\"parenttype\":\"POS Invoice\",\"idx\":1,\"qty\":1,\"uom\":\"Nos\",\"conversion_factor\":1,\"stock_qty\":1,\"price_list_rate\":1150,\"base_price_list_rate\":1150,\"margin_rate_or_amount\":0,\"rate_with_margin\":0,\"discount_percentage\":0,\"discount_amount\":0,\"base_rate_with_margin\":0,\"rate\":1150,\"amount\":1150,\"base_rate\":1150,\"base_amount\":1150,\"net_rate\":1026.79,\"net_amount\":1026.7857142857142,\"base_net_rate\":1026.79,\"base_net_amount\":1026.79,\"taxable_value\":0,\"igst_rate\":0,\"cgst_rate\":0,\"sgst_rate\":0,\"cess_rate\":0,\"cess_non_advol_rate\":0,\"igst_amount\":0,\"cgst_amount\":0,\"sgst_amount\":0,\"cess_amount\":0,\"cess_non_advol_amount\":0,\"weight_per_unit\":0,\"total_weight\":0,\"actual_batch_qty\":0,\"actual_qty\":2,\"delivered_qty\":0,\"gst_hsn_code\":\"62114210\",\"item_code\":\"RS23MUMNSH02MS-S\",\"weight_uom\":\"Kgs\",\"barcode\":null,\"pricing_rules\":\"\",\"item_name\":\"Musafir Mustard Half Sleeve Shirt\",\"description\":\"

This Mustard Shirt comes with a chest pocket, half sleeves, and a slit hem

\",\"image\":\"\",\"warehouse\":\"Champa Gali Store - RCIL\",\"income_account\":\"Domestic Sales - RCIL\",\"expense_account\":\"Cost of Goods Sold - RCIL\",\"discount_account\":null,\"provisional_expense_account\":null,\"cost_center\":\"Champa Gali Store - RCIL\",\"has_serial_no\":0,\"has_batch_no\":0,\"batch_no\":null,\"min_order_qty\":\"\",\"update_stock\":0,\"last_purchase_rate\":0,\"transaction_date\":\"2024-07-03\",\"against_blanket_order\":null,\"bom_no\":\"BOM-RS23MUMNSH02MS-S-001\",\"item_group\":\"Shirt\",\"brand\":\"Rangsutra\",\"manufacturer\":null,\"manufacturer_part_no\":null,\"item_tax_template\":\"GST - 12% - RCIL\",\"gst_treatment\":\"Taxable\",\"item_tax_rate\":\"{\\"Input CGST - RCIL\\": 6.0, \\"Input SGST - RCIL\\": 6.0, \\"Input IGST - RCIL\\": 12.0, \\"Output CGST - RCIL\\": 6.0, \\"Output SGST - RCIL\\": 6.0, \\"Output IGST - RCIL\\": 12.0, \\"Input CGST RCM - RCIL\\": 6.0, \\"Input SGST RCM - RCIL\\": 6.0, \\"Input IGST RCM - RCIL\\": 12.0, \\"Output CGST RCM - RCIL\\": -6.0, \\"Output SGST RCM - RCIL\\": -6.0, \\"Output IGST RCM - RCIL\\": -12.0}\",\"customer_item_code\":null,\"projected_qty\":2,\"reserved_qty\":0,\"has_margin\":false,\"free_item_data\":[],\"child_docname\":\"new-pos-invoice-item-ttobomahfs\",\"stock_uom_rate\":1150},{\"docstatus\":0,\"doctype\":\"POS Invoice Item\",\"name\":\"new-pos-invoice-item-kyudjnawsc\",\"islocal\":1,\"unsaved\":1,\"owner\":\"archana@rangsutra.com\",\"has_item_scanned\":0,\"stock_uom\":\"Nos\",\"margin_type\":\"\",\"is_free_item\":0,\"grant_commission\":1,\"delivered_by_supplier\":0,\"is_fixed_asset\":0,\"enable_deferred_revenue\":0,\"allow_zero_valuation_rate\":0,\"page_break\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"items\",\"parenttype\":\"POS Invoice\",\"idx\":2,\"unedited\":false,\"warehouse\":\"Champa Gali Store - RCIL\",\"cost_center\":\"Champa Gali Store - RCIL\",\"__checked\":0,\"gst_hsn_code\":\"42022190\",\"item_code\":\"RS23CBACBG02AS-FS\",\"weight_per_unit\":0,\"weight_uom\":null,\"conversion_factor\":1,\"barcode\":null,\"pricing_rules\":\"\",\"item_name\":\"Rangsutra Small Carry Bag-FS-AS\",\"description\":\"Rangsutra Small Carry Bag-FS-AS\",\"image\":\"\",\"income_account\":\"Domestic Sales - RCIL\",\"expense_account\":\"Cost of Goods Sold - RCIL\",\"discount_account\":null,\"provisional_expense_account\":null,\"has_serial_no\":0,\"has_batch_no\":0,\"batch_no\":null,\"uom\":\"Nos\",\"min_order_qty\":\"\",\"qty\":1,\"stock_qty\":1,\"price_list_rate\":0,\"base_price_list_rate\":0,\"rate\":0,\"base_rate\":0,\"amount\":0,\"base_amount\":0,\"net_rate\":0,\"net_amount\":0,\"discount_percentage\":0,\"discount_amount\":0,\"update_stock\":0,\"last_purchase_rate\":0,\"transaction_date\":\"2024-07-03\",\"against_blanket_order\":null,\"bom_no\":null,\"item_group\":\"Bag\",\"brand\":\"Rangsutra\",\"manufacturer\":null,\"manufacturer_part_no\":null,\"item_tax_template\":\"GST - 12% - RCIL\",\"gst_treatment\":\"Taxable\",\"item_tax_rate\":\"{\\"Input CGST - RCIL\\": 6.0, \\"Input SGST - RCIL\\": 6.0, \\"Input IGST - RCIL\\": 12.0, \\"Output CGST - RCIL\\": 6.0, \\"Output SGST - RCIL\\": 6.0, \\"Output IGST - RCIL\\": 12.0, \\"Input CGST RCM - RCIL\\": 6.0, \\"Input SGST RCM - RCIL\\": 6.0, \\"Input IGST RCM - RCIL\\": 12.0, \\"Output CGST RCM - RCIL\\": -6.0, \\"Output SGST RCM - RCIL\\": -6.0, \\"Output IGST RCM - RCIL\\": -12.0}\",\"customer_item_code\":null,\"actual_qty\":12,\"projected_qty\":12,\"reserved_qty\":0,\"has_margin\":false,\"free_item_data\":[],\"child_docname\":\"new-pos-invoice-item-kyudjnawsc\",\"rate_with_margin\":0,\"base_rate_with_margin\":0,\"margin_rate_or_amount\":0,\"base_net_rate\":0,\"base_net_amount\":0,\"taxable_value\":0,\"igst_rate\":0,\"cgst_rate\":0,\"sgst_rate\":0,\"cess_rate\":0,\"cess_non_advol_rate\":0,\"igst_amount\":0,\"cgst_amount\":0,\"sgst_amount\":0,\"cess_amount\":0,\"cess_non_advol_amount\":0,\"total_weight\":0,\"actual_batch_qty\":0,\"delivered_qty\":0,\"stock_uom_rate\":0}],\"pos_profile\":\"Champa Gali Store\",\"financial_year\":\"FY24\",\"posting_time\":\"17:34:34\",\"set_warehouse\":\"Champa Gali Store - RCIL\",\"taxes_and_charges\":\"In State - TI - RCIL\",\"conversion_rate\":1,\"plc_conversion_rate\":1,\"idx\":0,\"cost_center\":\"Champa Gali Store - RCIL\",\"company_address\":\"Rangsutra Crafts India Ltd. Delhi -Billing\",\"total_qty\":2,\"base_total\":1150,\"base_net_total\":1026.79,\"total\":1150,\"net_total\":1026.7857142857142,\"total_net_weight\":0,\"base_total_taxes_and_charges\":123.22,\"total_taxes_and_charges\":123.22,\"loyalty_points\":0,\"loyalty_amount\":0,\"base_discount_amount\":0,\"additional_discount_percentage\":0,\"discount_amount\":0,\"base_grand_total\":1150,\"base_rounding_adjustment\":-0.01,\"base_rounded_total\":1150,\"grand_total\":1150,\"rounding_adjustment\":-0.01,\"rounded_total\":1150,\"total_advance\":0,\"outstanding_amount\":0,\"base_paid_amount\":1150,\"paid_amount\":1150,\"base_change_amount\":0,\"change_amount\":0,\"account_for_change_amount\":\"Cash - RCIL\",\"write_off_amount\":0,\"base_write_off_amount\":0,\"write_off_account\":\"Bad Debts Write off - RCIL\",\"write_off_cost_center\":\"Champa Gali Store - RCIL\",\"debit_to\":\"Customer Receivables - RCIL\",\"amount_eligible_for_commission\":0,\"commission_rate\":0,\"total_commission\":0,\"timesheets\":[],\"sales_team\":[],\"packed_items\":[],\"pricing_rules\":[],\"payment_schedule\":[],\"payments\":[{\"docstatus\":0,\"idx\":1,\"default\":0,\"mode_of_payment\":\"Online - Delhi\",\"amount\":1150,\"account\":\"Axis Bank Delhi Retail (915020047583912) - RCIL\",\"type\":\"Bank\",\"base_amount\":1150,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"payments\",\"parenttype\":\"POS Invoice\",\"doctype\":\"Sales Invoice Payment\",\"islocal\":1,\"name\":\"new-sales-invoice-payment-kmkispwgmy\",\"payment_source\":\"Google Pay\"},{\"docstatus\":0,\"idx\":2,\"default\":1,\"mode_of_payment\":\"Cash\",\"amount\":0,\"account\":\"Cash - RCIL\",\"type\":\"Cash\",\"base_amount\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"payments\",\"parenttype\":\"POS Invoice\",\"doctype\":\"Sales Invoice Payment\",\"islocal\":1,\"name\":\"new-sales-invoice-payment-yycyhgivtj\"},{\"docstatus\":0,\"idx\":3,\"default\":0,\"mode_of_payment\":\"Card - Delhi\",\"amount\":0,\"account\":\"Delhi Card Wallet - RCIL\",\"type\":\"Bank\",\"base_amount\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"payments\",\"parenttype\":\"POS Invoice\",\"doctype\":\"Sales Invoice Payment\",\"islocal\":1,\"name\":\"new-sales-invoice-payment-lrtrpngqyj\"}],\"advances\":[],\"taxes\":[{\"docstatus\":0,\"doctype\":\"Sales Taxes and Charges\",\"name\":\"new-sales-taxes-and-charges-benreuqvda\",\"islocal\":1,\"__unsaved\":1,\"owner\":\"archana@rangsutra.com\",\"charge_type\":\"On Net Total\",\"included_in_print_rate\":1,\"included_in_paid_amount\":0,\"account_currency\":\"INR\",\"dont_recompute_tax\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"taxes\",\"parenttype\":\"POS Invoice\",\"idx\":1,\"row_id\":null,\"account_head\":\"Output CGST - RCIL\",\"description\":\"Output CGST\",\"branch\":null,\"cost_center\":\"Main - RCIL\",\"rate\":0,\"gst_tax_type\":null,\"tax_amount\":61.61,\"total\":1088.4,\"tax_amount_after_discount_amount\":61.61,\"base_tax_amount\":61.61,\"base_total\":1088.4,\"base_tax_amount_after_discount_amount\":61.61,\"item_wise_tax_detail\":\"{\\"RS23MUMNSH02MS-S\\":[6,61.61],\\"RS23CBACBG02AS-FS\\":[6,0]}\"},{\"docstatus\":0,\"doctype\":\"Sales Taxes and Charges\",\"name\":\"new-sales-taxes-and-charges-boryrpvspa\",\"islocal\":1,\"__unsaved\":1,\"owner\":\"archana@rangsutra.com\",\"charge_type\":\"On Net Total\",\"included_in_print_rate\":1,\"included_in_paid_amount\":0,\"account_currency\":\"INR\",\"dont_recompute_tax\":0,\"parent\":\"new-pos-invoice-tyqmbvmhvg\",\"parentfield\":\"taxes\",\"parenttype\":\"POS Invoice\",\"idx\":2,\"row_id\":null,\"account_head\":\"Output SGST - RCIL\",\"description\":\"Output SGST\",\"branch\":null,\"cost_center\":\"Main - RCIL\",\"rate\":0,\"gst_tax_type\":null,\"tax_amount\":61.61,\"total\":1150.01,\"tax_amount_after_discount_amount\":61.61,\"base_tax_amount\":61.61,\"base_total\":1150.01,\"base_tax_amount_after_discount_amount\":61.61,\"item_wise_tax_detail\":\"{\\"RS23MUMNSH02MS-S\\":[6,61.61],\\"RS23CBACBG02AS-FS\\":[6,0]}\"}],\"campaign\":null,\"in_words\":\"\",\"base_in_words\":\"\",\"custom_naming_series_no\":\"01\",\"branch\":\"Delhi\",\"customer_name\":\"Priya\",\"loyalty_program\":null,\"customer\":\"Priya\",\"due_date\":\"2024-07-03\",\"customer_address\":\"Priya-Billing\",\"billing_address_gstin\":null,\"gst_category\":\"Unregistered\",\"address_display\":\"New Delhi
New Delhi
\nDelhi, State Code: 07
India
\n\",\"shipping_address_name\":null,\"shipping_address\":null,\"company_gstin\":\"07AADCR3731P1Z1\",\"tax_category\":null,\"place_of_supply\":\"07-Delhi\",\"contact_person\":\"Priya-Priya\",\"contact_email\":\"\",\"contact_mobile\":\"9650468079\",\"contact_display\":\"Priya\",\"customer_group\":\"Retail Store\",\"territory\":\"All Territories\",\"language\":\"en\",\"payment_terms_template\":null}", "action": "Save" }, "btn": { "jQuery360038900307835238411": { "events": { "click": [ { "type": "click", "origType": "click", "guid": 21381, "namespace": "" } ] } } }, "freeze": true, "headers": {}, "error_handlers": {}, "url": "/api/method/frappe.desk.form.save.savedocs" }

Response Data

{ "exception": "AttributeError: 'POSInvoice' object has no attribute 'is_reverse_charge'" }

india-compliance-bot commented 4 months ago

:tada: This issue has been resolved in version 15.10.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

india-compliance-bot commented 4 months ago

:tada: This issue has been resolved in version 14.29.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

india-compliance-bot commented 4 months ago

:tada: This issue has been resolved in version 15.11.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

india-compliance-bot commented 4 months ago

:tada: This issue has been resolved in version 14.30.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: