'Preserve naming_series as property setter if it does not exist'

def preserve_naming_series_options_in_property_setter(self):

    naming_series = self.get(u'fields', {u'fieldname': u'naming_series'})
    if (not naming_series):
        return
    if (not (frappe.db.table_exists(self.name) and frappe.db.sql(u'select    name    from    `tab{}`    limit    1'.format(self.name)))):
        return
    existing_property_setter = frappe.db.get_value(u'Property    Setter', {u'doc_type': self.name, u'property': u'options', u'field_name': u'naming_series'})
    if (not existing_property_setter):
        make_property_setter(self.name, u'naming_series', u'options', naming_series[0].options, u'Text', validate_fields_for_doctype=False)
        if naming_series[0].default:
            make_property_setter(self.name, u'naming_series', u'default', naming_series[0].default, u'Text', validate_fields_for_doctype=False)
