Remove not null on template and galatea website columns

This commit is contained in:
Sergi Almacellas Abellana 2015-12-24 10:41:24 +01:00
parent bd846cd7b7
commit 62bbdcca16

13
cms.py
View file

@ -5,6 +5,7 @@ from trytond.model import ModelSQL, ModelView, fields
from trytond.pool import Pool
from trytond.pyson import Bool, Equal, Eval, In, Not
from trytond.transaction import Transaction
from trytond import backend
from trytond.modules.galatea import GalateaVisiblePage
from trytond.modules.galatea.tools import slugify
@ -160,6 +161,18 @@ class Article(GalateaVisiblePage, ModelSQL, ModelView):
'Dissable active field.'),
})
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
cursor = Transaction().cursor
table = TableHandler(cursor, cls, module_name)
super(Article, cls).__register__(module_name)
table = TableHandler(cursor, cls, module_name)
table.not_null_action('galatea_website', action='remove')
table.not_null_action('template', action='remove')
@classmethod
def default_websites(cls):
Website = Pool().get('galatea.website')