# Copyright (c) 2021, SolutionERP LLC and contributors
# For license information, please see license.txt

import xhiveframework
from xhiveframework.model.document import Document
from xhiveframework.model.naming import set_name_by_naming_series


class Campaign(Document):
	def autoname(self):
		if xhiveframework.defaults.get_global_default("campaign_naming_by") != "Naming Series":
			self.name = self.campaign_name
		else:
			set_name_by_naming_series(self)
