def METHOD_NAME(self, product):
    if (
        not product.property_account_income_id
        or not product.property_account_expense_id
    ):
        raise UserError(
            _("Product %s must have income and expense accounts") % product.name
        )
    income_vals = {
        "name": _("Tax Stamp Income"),
        "is_stamp_line": True,
        "partner_id": self.partner_id.id,
        "account_id": product.property_account_income_id.id,
        "journal_id": self.journal_id.id,
        "date": self.invoice_date,
        "debit": 0,
        "credit": product.list_price,
        "exclude_from_invoice_tab": True,
        "currency_id": self.currency_id.id,
    }
    if self.move_type == "out_refund":
        income_vals["debit"] = product.list_price
        income_vals["credit"] = 0
    expense_vals = {
        "name": _("Tax Stamp Expense"),
        "is_stamp_line": True,
        "partner_id": self.partner_id.id,
        "account_id": product.property_account_expense_id.id,
        "journal_id": self.journal_id.id,
        "date": self.invoice_date,
        "debit": product.list_price,
        "credit": 0,
        "exclude_from_invoice_tab": True,
        "currency_id": self.currency_id.id,
    }
    if self.move_type == "out_refund":
        income_vals["debit"] = 0
        income_vals["credit"] = product.list_price
    return income_vals, expense_vals