My decision was very simple:
in file hooks.py i configure function after_install:
…
after_install = "default_settings.stock_settings.default_square_meters"
…
In file stock_settings.py I created functions:
def set_default_unit(unit):
doc = frappe.get_doc({"doctype": "Stock Settings"})
doc.stock_uom = unit
doc.save()
def default_square_meters():
set_default_unit("Square Meter")
…
But when docker install all applications, it gives me the next exception:
frappe.exceptions.LinkValidationError: Could not find Default Stock UOM: Square Meter
How I can fix it or is exist another way of realization of this case?