To optimize workflow (and avoid mistakes) I wanted to set a default account(ing) category so that tax,.. is set by default. Took a little bit of experimenting, but I got it:
__name__ = 'product.template'
return Pool().get('product.category').search([('name', '=', 'MWSt'), ('accounting', '=', True)]).id
# FIXME: should I log an error here for not finding a hardcoded accounting category?
I could have of course also returned the number for the tax rate I am usign as well, but I found this to be (a lot) more flexible should I ever want to make it user/admin configurable and not hardcode it. But for now this is more than fine.Share on Twitter Share on Facebook