mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
fix: fixed zero tax rate issue by adding custom field
This commit is contained in:
@@ -4,11 +4,28 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe, os, json
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
from frappe.permissions import add_permission, update_permission_property
|
||||
|
||||
def setup(company=None, patch=True):
|
||||
add_permissions()
|
||||
|
||||
def make_custom_fields(update=True):
|
||||
is_zero_rated = dict(fieldname='is_zero_rated', label='Is Zero Rated',
|
||||
fieldtype='Check', fetch_from='item_code.is_zero_rated',
|
||||
insert_after='description', print_hide=1)
|
||||
custom_fields = {
|
||||
'Item': [
|
||||
dict(fieldname='is_zero_rated', label='Is Zero Rated',
|
||||
fieldtype='Check', insert_after='item_group',
|
||||
print_hide=1)
|
||||
],
|
||||
'Sales Invoice Item': is_zero_rated,
|
||||
'Purchase Invoice Item': is_zero_rated
|
||||
}
|
||||
|
||||
create_custom_fields(custom_fields, update=update)
|
||||
|
||||
def add_permissions():
|
||||
"""Add Permissions for South Africa VAT Settings and South Africa VAT Account"""
|
||||
for doctype in ('South Africa VAT Settings', 'South Africa VAT Account'):
|
||||
|
||||
Reference in New Issue
Block a user