From 7fb2eaccfdb960399a886db2c06dc044c4620ea2 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Wed, 24 Jun 2026 14:46:36 +0000 Subject: [PATCH] feat(item): Agricultural Goods checkbox on Item Add an item-level agricultural_goods flag so a document marked agricultural can still contain non-agricultural items; tax reports filter on it. Also fixes a duplicate "Item" key in the custom_fields dict (the second entry shadowed the first), by merging both Item blocks into one so all Item custom fields are created on a fresh install. Co-Authored-By: Claude Opus 4.8 (1M context) --- jey_erp/custom_fields.py | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/jey_erp/custom_fields.py b/jey_erp/custom_fields.py index b6198e5..e47a6a3 100644 --- a/jey_erp/custom_fields.py +++ b/jey_erp/custom_fields.py @@ -1088,7 +1088,30 @@ def create_custom_fields(): insert_after='product_group_code', in_list_view=1, in_standard_filter=1 - ) + ), + # Marks an item as agricultural goods. A document can be flagged + # agricultural while only some of its items actually count as + # agricultural goods for tax reporting. + dict( + fieldname='agricultural_goods', + label='Agricultural Goods', + fieldtype='Check', + insert_after='product_category', + default=0, + in_standard_filter=1 + ), + # Default expense account used by Landed Cost Voucher when this + # service item is added to the Landed Cost Taxes and Charges table. + # Hidden for stock items because LCV taxes are services only. + dict( + fieldname='default_landed_cost_account', + label='Default Landed Cost Account', + fieldtype='Link', + options='Account', + insert_after='is_stock_item', + depends_on='eval:doc.is_stock_item==0', + description='Used as the Expense Account when this service item is selected in a Landed Cost Voucher.', + ), ], "Item Group": [ dict( @@ -2104,20 +2127,6 @@ def create_custom_fields(): insert_after='custom_medical_insurance_column_break' ), ], - "Item": [ - # Default expense account used by Landed Cost Voucher when this - # service item is added to the Landed Cost Taxes and Charges table. - # Hidden for stock items because LCV taxes are services only. - dict( - fieldname='default_landed_cost_account', - label='Default Landed Cost Account', - fieldtype='Link', - options='Account', - insert_after='is_stock_item', - depends_on='eval:doc.is_stock_item==0', - description='Used as the Expense Account when this service item is selected in a Landed Cost Voucher.', - ), - ], "Landed Cost Voucher": [ # In-form button placed right above the Landed Cost (taxes) table, # mirroring the standard `get_items_from_purchase_receipts` button