Pārlūkot izejas kodu

fixes in alter table and updated listviews for delivery note and purchase receipt

version-14
Rushabh Mehta pirms 12 gadiem
vecāks
revīzija
01ff7d4f9d
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. +8
    -2
      webnotes/model/db_schema.py

+ 8
- 2
webnotes/model/db_schema.py Parādīt failu

@@ -34,7 +34,7 @@ type_map = {
'currency': ('decimal', '18,6') 'currency': ('decimal', '18,6')
,'int': ('int', '11') ,'int': ('int', '11')
,'float': ('decimal', '18,6') ,'float': ('decimal', '18,6')
,'percent': ('decimal', '9,6')
,'percent': ('decimal', '18,6')
,'check': ('int', '1') ,'check': ('int', '1')
,'small text': ('text', '') ,'small text': ('text', '')
,'long text': ('longtext', '') ,'long text': ('longtext', '')
@@ -264,10 +264,16 @@ class DbColumn:
self.table.add_index.append(self) self.table.add_index.append(self)
# default # default
if (self.default and (current_def['default'] != self.default) and (self.default not in default_shortcuts) and not (column_def in ['text','blob'])):
if (self.default and self.default_changed(current_def) and (self.default not in default_shortcuts) and not (column_def in ['text','blob'])):
self.table.set_default.append(self) self.table.set_default.append(self)




def default_changed(self, current_def):
if "decimal" in current_def['type']:
return float(current_def['default'])!=float(self.default)
else:
return current_def['default'] != self.default

class DbManager: class DbManager:
""" """
Basically, a wrapper for oft-used mysql commands. like show tables,databases, variables etc... Basically, a wrapper for oft-used mysql commands. like show tables,databases, variables etc...


Notiek ielāde…
Atcelt
Saglabāt