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) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-06-24 14:46:36 +00:00
parent 23b83b089e
commit 7fb2eaccfd
1 changed files with 24 additions and 15 deletions

View File

@ -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