Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 1 | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import frappe |
| 6 | from frappe.custom.doctype.custom_field.custom_field import create_custom_fields |
| 7 | |
Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 8 | def setup(company=None, patch=True): |
| 9 | make_custom_fields() |
| 10 | add_print_formats() |
Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 11 | |
Deepesh Garg | 9df4532 | 2020-06-11 21:33:43 +0530 | [diff] [blame] | 12 | def make_custom_fields(update=True): |
Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 13 | custom_fields = { |
| 14 | 'Supplier': [ |
| 15 | dict(fieldname='irs_1099', fieldtype='Check', insert_after='tax_id', |
| 16 | label='Is IRS 1099 reporting required for supplier?') |
| 17 | ] |
| 18 | } |
Deepesh Garg | 9df4532 | 2020-06-11 21:33:43 +0530 | [diff] [blame] | 19 | create_custom_fields(custom_fields, update=update) |
Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 20 | |
Tyler Matteson | 53a6492 | 2019-01-17 14:04:01 -0500 | [diff] [blame] | 21 | def add_print_formats(): |
| 22 | frappe.reload_doc("regional", "print_format", "irs_1099_form") |
| 23 | frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where |
| 24 | name in('IRS 1099 Form') """) |